# @ohos.app.ability.abilityManager (AbilityManager) The AbilityManager module provides APIs for obtaining ability information and running status information. > **NOTE** > > The initial APIs of this module are supported since API version 14. Newly added APIs will be marked with a superscript to indicate their earliest API version. ## Modules to Import ```ts import { abilityManager } from '@kit.AbilityKit'; ``` ## AbilityState Enumerates the ability states. This enum can be used together with [AbilityRunningInfo](js-apis-inner-application-abilityRunningInfo.md) to return the ability state. **System capability**: SystemCapability.Ability.AbilityRuntime.Core | Name| Value| Description| | -------- | -------- | -------- | | INITIAL | 0 | The ability is in the initial state.| | FOCUS | 2 | The ability has the focus.| | FOREGROUND | 9 | The ability is in the foreground state. | | BACKGROUND | 10 | The ability is in the background state. | | FOREGROUNDING | 11 | The ability is in the state of being switched to the foreground. | | BACKGROUNDING | 12 | The ability is in the state of being switched to the background. | ## getAbilityRunningInfos getAbilityRunningInfos(): Promise\> Obtains the UIAbility running information. This API uses a promise to return the result. **Required permissions**: ohos.permission.GET_RUNNING_INFO **System capability**: SystemCapability.Ability.AbilityRuntime.Core **Return value** | Type | Description | | ---------------------------------------- | ------- | | Promise\> | Promise used to return the API call result and the UIAbility running information. You can perform error handling or custom processing in it.| **Error codes** For details about the error codes, see [Universal Error Codes](../errorcode-universal.md) and [Ability Error Codes](errorcode-ability.md). | ID| Error Message| | ------- | -------- | | 16000050 | Internal error. | **Example** ```ts import { abilityManager } from '@kit.AbilityKit'; import { BusinessError } from '@kit.BasicServicesKit'; try { abilityManager.getAbilityRunningInfos().then((data: Array) => { console.log(`getAbilityRunningInfos success, data: ${JSON.stringify(data)}`); }).catch((err: BusinessError) => { console.error(`getAbilityRunningInfos fail, err: ${JSON.stringify(err)}`); }); } catch (paramError) { let code: number = (paramError as BusinessError).code; let message: string = (paramError as BusinessError).message; console.error(`error.code: ${code}, error.message: ${message}`); } ```