1e41f4b71Sopenharmony_ci# AbilityStateData (System API)
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ciThe **AbilityStateData** module defines the ability state information, which can be obtained through the **onAbilityStateChanged** lifecycle callback of [ApplicationStateObserver](js-apis-inner-application-applicationStateObserver-sys.md). The callback can be invoked after a lifecycle change listener is registered through [on](js-apis-app-ability-appManager-sys.md#appmanageronappforegroundstate11).
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ci> **NOTE**
6e41f4b71Sopenharmony_ci> 
7e41f4b71Sopenharmony_ci> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
8e41f4b71Sopenharmony_ci> The APIs provided by this module are system APIs.
9e41f4b71Sopenharmony_ci
10e41f4b71Sopenharmony_ci## Modules to Import
11e41f4b71Sopenharmony_ci
12e41f4b71Sopenharmony_ci```ts
13e41f4b71Sopenharmony_ciimport { appManager } from '@kit.AbilityKit';
14e41f4b71Sopenharmony_ci```
15e41f4b71Sopenharmony_ci
16e41f4b71Sopenharmony_ci## Properties
17e41f4b71Sopenharmony_ci
18e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.AbilityRuntime.Core
19e41f4b71Sopenharmony_ci
20e41f4b71Sopenharmony_ci**System API**: This is a system API and cannot be called by third-party applications.
21e41f4b71Sopenharmony_ci
22e41f4b71Sopenharmony_ci| Name                    | Type    | Readable| Writable| Description                      |
23e41f4b71Sopenharmony_ci| ----------------------- | ---------| ---- | ---- | ------------------------- |
24e41f4b71Sopenharmony_ci| pid                     | number   | Yes  | No  | Process ID.                   |
25e41f4b71Sopenharmony_ci| bundleName              | string   | Yes  | No | Bundle name.         |
26e41f4b71Sopenharmony_ci| abilityName            | string   | Yes  | No  | Ability name.              |
27e41f4b71Sopenharmony_ci| uid                    | number   | Yes  | No  | User ID.                 |
28e41f4b71Sopenharmony_ci| state                   | number   | Yes  | No  | [Ability state](#ability-states).               |
29e41f4b71Sopenharmony_ci| moduleName<sup>9+</sup> | string   | Yes  | No  | Name of the HAP file to which the ability belongs.   |
30e41f4b71Sopenharmony_ci| abilityType | number | Yes  | No  | [Ability type](#ability-types), which can be **page** or **service**.|
31e41f4b71Sopenharmony_ci| isAtomicService<sup>12+</sup>| boolean   | Yes | No | Whether the ability belongs to an atomic service.<br>**true**: The ability belongs to an atomic service.<br>**false**: The ability does not belong to an atomic service.    |
32e41f4b71Sopenharmony_ci| appCloneIndex          | number   | Yes  | No  | Index of an application clone.                 |
33e41f4b71Sopenharmony_ci
34e41f4b71Sopenharmony_ci#### Ability States
35e41f4b71Sopenharmony_ci
36e41f4b71Sopenharmony_ci| Value  | State                      | Description                  |
37e41f4b71Sopenharmony_ci| ---- | -------------------------- | ---------------------- |
38e41f4b71Sopenharmony_ci| 0    | ABILITY_STATE_CREATE       | The ability is being created.     |
39e41f4b71Sopenharmony_ci| 1    | ABILITY_STATE_READY        | The ability has been created.     |
40e41f4b71Sopenharmony_ci| 2    | ABILITY_STATE_FOREGROUND   | The ability is running in the foreground.       |
41e41f4b71Sopenharmony_ci| 3    | ABILITY_STATE_FOCUS        | The ability has focus.       |
42e41f4b71Sopenharmony_ci| 4    | ABILITY_STATE_BACKGROUND   | The ability is running in the background.       |
43e41f4b71Sopenharmony_ci| 5    | ABILITY_STATE_TERMINATED   | The ability is terminated.       |
44e41f4b71Sopenharmony_ci| 8    | ABILITY_STATE_CONNECTED    | The background service is connected to the client.|
45e41f4b71Sopenharmony_ci| 9    | ABILITY_STATE_DISCONNECTED | The background service is disconnected from the client.|
46e41f4b71Sopenharmony_ci
47e41f4b71Sopenharmony_ci#### Ability Types
48e41f4b71Sopenharmony_ci
49e41f4b71Sopenharmony_ci| Value  | State   | Description                 |
50e41f4b71Sopenharmony_ci| ---- | ------- | --------------------- |
51e41f4b71Sopenharmony_ci| 0    | UNKNOWN | Unknown type.             |
52e41f4b71Sopenharmony_ci| 1    | PAGE    | Ability that has the UI.  |
53e41f4b71Sopenharmony_ci| 2    | SERVICE | Ability that provides the background service.|
54e41f4b71Sopenharmony_ci| 3    | DATA | Ability that provides the data service.             |
55e41f4b71Sopenharmony_ci| 4    | FORM    | Ability that provides the widget service.  |
56e41f4b71Sopenharmony_ci| 5    | EXTENSION | Ability that provides extension capabilities.|
57