| Promise\<Array\<[AbilityRunningInfo](js-apis-inner-application-abilityRunningInfo.md)>> | Callback used to return the API call result and the ability running information. You can perform error handling or custom processing in this callback.|
| Promise\<Array\<[AbilityRunningInfo](js-apis-inner-application-abilityRunningInfo.md)>> | Promise used to return the API call result and the UIAbility running information. You can perform error handling or custom processing in this callback.|
**Error codes**
...
...
@@ -212,13 +210,12 @@ import abilityManager from '@ohos.app.ability.abilityManager';
**System API**: This is a system API and cannot be called by third-party applications.
**Return value**
| Type| Description|
| -------- | -------- |
| Promise\<Array\<[ProcessRunningInformation](js-apis-inner-application-processRunningInformation.md)>> | Promise used to return the API call result and the process running information. You can perform error handling or custom processing in this callback.|
| Promise\<Array\<[ProcessInformation](js-apis-inner-application-processInformation.md)>> | Promise used to return the API call result and the process running information. You can perform error handling or custom processing in this callback.|
**Error codes**
...
...
@@ -255,16 +253,16 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
**System API**: This is a system API and cannot be called by third-party applications.
**Parameters**
| Type| Description|
| -------- | -------- |
|AsyncCallback\<Array\<[ProcessRunningInformation](js-apis-inner-application-processRunningInformation.md)>> | Callback used to return the API call result and the process running information. You can perform error handling or custom processing in this callback.|
|AsyncCallback\<Array\<[ProcessInformation](js-apis-inner-application-processInformation.md)>> | Callback used to return the API call result and the process running information. You can perform error handling or custom processing in this callback.|
**Error codes**
...
...
@@ -293,18 +289,18 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
Registers an observer to listen for the state changes of all applications.
...
...
@@ -318,7 +314,7 @@ Registers an observer to listen for the state changes of all applications.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| type | string | Yes| Type of the API to call. It is fixed at **"applicationState"**.|
| type | string | Yes| Type of the API to call. It is fixed at **'applicationState'**.|
| observer | [ApplicationStateObserver](./js-apis-inner-application-applicationStateObserver.md) | Yes| Application state observer, which is used to observe the lifecycle change of an application.|
Registers an observer to listen for the state changes of a specified application.
...
...
@@ -381,7 +377,7 @@ Registers an observer to listen for the state changes of a specified application
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| type | string | Yes| Type of the API to call. It is fixed at **"applicationState"**.|
| type | string | Yes| Type of the API to call. It is fixed at **'applicationState'**.|
| observer | [ApplicationStateObserver](./js-apis-inner-application-applicationStateObserver.md) | Yes| Application state observer, which is used to observe the lifecycle change of an application.|
| bundleNameList | `Array<string>` | Yes| **bundleName** array of the application. A maximum of 128 bundle names can be passed.|
...
...
@@ -423,7 +419,7 @@ let applicationStateObserver = {
Deregisters the application state observer. This API uses an asynchronous callback to return the result.
...
...
@@ -446,7 +442,7 @@ Deregisters the application state observer. This API uses an asynchronous callba
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| type | string | Yes| Type of the API to call. It is fixed at **"applicationState"**.|
| type | string | Yes| Type of the API to call. It is fixed at **'applicationState'**.|
| observerId | number | Yes| Digital code of the observer.|
| callback | AsyncCallback\<void> | Yes| Callback used to return the API call result. You can perform error handling or custom processing in this callback.|
...
...
@@ -485,7 +481,7 @@ let applicationStateObserver = {
@@ -22,16 +22,16 @@ Checks whether this application is undergoing a stability test. This API uses an
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<boolean> | Yes| Callback used to return the result. If the application is undergoing a stability test, **true** will be returned; otherwise, **false** will be returned.|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<boolean> | Yes| Callback used to return the result. If the application is undergoing a stability test, **true** will be returned; otherwise, **false** will be returned.|
**Example**
```ts
appManager.isRunningInStabilityTest((err,flag)=>{
console.log('error:'+JSON.stringfy(err));
console.log('The result of isRunningInStabilityTest is:'+JSON.stringify(flag));
console.log('error: ${JSON.stringify(err)}');
console.log('The result of isRunningInStabilityTest is: ${JSON.stringify(flag)}');
})
```
...
...
@@ -46,17 +46,17 @@ Checks whether this application is undergoing a stability test. This API uses a
**Return value**
| Type| Description|
| -------- | -------- |
| Promise<boolean> | Promise used to return the result. If the application is undergoing a stability test, **true** will be returned; otherwise, **false** will be returned.|
| Type| Description|
| -------- | -------- |
| Promise<boolean> | Promise used to return the result. If the application is undergoing a stability test, **true** will be returned; otherwise, **false** will be returned.|
console.log('The result of isRunningInStabilityTest is:'+JSON.stringify(flag));
console.log('The result of isRunningInStabilityTest is: ${JSON.stringify(flag)}');
}).catch((error)=>{
console.log('error:'+JSON.stringify(error));
console.log('error: ${JSON.stringify(error)}');
});
```
...
...
@@ -71,17 +71,17 @@ Checks whether this application is running on a RAM constrained device. This API
**Return value**
| Type| Description|
| -------- | -------- |
| Promise<boolean> | Promise used to return whether the application is running on a RAM constrained device. If the application is running on a RAM constrained device, **true** will be returned; otherwise, **false** will be returned.|
| Type| Description|
| -------- | -------- |
| Promise<boolean> | Promise used to return whether the application is running on a RAM constrained device. If the application is running on a RAM constrained device, **true** will be returned; otherwise, **false** will be returned.|
console.log('The result of isRamConstrainedDevice is:'+JSON.stringify(data));
console.log('The result of isRamConstrainedDevice is: ${JSON.stringify(data)}');
}).catch((error)=>{
console.log('error:'+JSON.stringify(error));
console.log('error: ${JSON.stringify(error)}');
});
```
...
...
@@ -95,16 +95,16 @@ Checks whether this application is running on a RAM constrained device. This API
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<boolean> | Yes| Callback used to return whether the application is running on a RAM constrained device. If the application is running on a RAM constrained device, **true** will be returned; otherwise, **false** will be returned.|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<boolean> | Yes| Callback used to return whether the application is running on a RAM constrained device. If the application is running on a RAM constrained device, **true** will be returned; otherwise, **false** will be returned.|
**Example**
```ts
appManager.isRamConstrainedDevice((err,data)=>{
console.log('error:'+JSON.stringify(err));
console.log('The result of isRamConstrainedDevice is:'+JSON.stringify(data));
console.log('error: ${JSON.stringify(err)}');
console.log('The result of isRamConstrainedDevice is: ${JSON.stringify(data)}');
})
```
...
...
@@ -118,17 +118,17 @@ Obtains the memory size of this application. This API uses a promise to return t
**Return value**
| Type| Description|
| -------- | -------- |
| Promise<number> | Size of the application memory.|
| Type| Description|
| -------- | -------- |
| Promise<number> | Promise used to return the memory size, in MB.|
**Example**
```ts
appManager.getAppMemorySize().then((data)=>{
console.log('The size of app memory is:'+JSON.stringify(data));
console.log('The size of app memory is: ${JSON.stringify(data)}');
}).catch((error)=>{
console.log('error:'+JSON.stringify(error));
console.log('error: ${JSON.stringify(error)}');
});
```
...
...
@@ -142,17 +142,17 @@ Obtains the memory size of this application. This API uses an asynchronous callb
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<number> | Yes| Size of the application memory.|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<number> | Yes| Callback used to return the memory size, in MB.|
**Example**
```ts
appManager.getAppMemorySize((err,data)=>{
console.log('error:'+JSON.stringify(err));
console.log('The size of app memory is:'+JSON.stringify(data));
})
console.log('error: ${JSON.stringify(err)}');
console.log('The size of app memory is: ${JSON.stringify(data)}');
Obtains information about the running processes. This API uses a promise to return the result.
> This API is deprecated since API version 9. You are advised to use [appManager.getProcessRunningInformation<sup>9+</sup>](#appmanagergetprocessrunninginformation9) instead.
> This API is deprecated since API version 9. You are advised to use [appManager.getRunningProcessInformation<sup>9+</sup>](js-apis-app-ability-appManager.md#appmanagergetrunningprocessinformation) instead.
console.log('The process running infos is:'+JSON.stringify(data));
console.log('The process running infos is: ${JSON.stringify(data)}');
}).catch((error)=>{
console.log('error:'+JSON.stringify(error));
console.log('error: ${JSON.stringify(error)}');
});
```
...
...
@@ -188,7 +188,7 @@ getProcessRunningInfos(callback: AsyncCallback\<Array\<ProcessRunningInfo>>): vo
Obtains information about the running processes. This API uses an asynchronous callback to return the result.
> This API is deprecated since API version 9. You are advised to use [appManager.getProcessRunningInformation<sup>9+</sup>](#appmanagergetprocessrunninginformation9-1) instead.
> This API is deprecated since API version 9. You are advised to use [appManager.getRunningProcessInformation<sup>9+</sup>](js-apis-app-ability-appManager.md#appmanagergetrunningprocessinformation9) instead.
| Promise\<Array\<[ProcessRunningInformation](js-apis-inner-application-processRunningInformation.md)>> | Obtains information about the running processes. This API uses a promise to return the result.|
| callback | AsyncCallback\<Array\<[ProcessRunningInformation](js-apis-inner-application-processRunningInformation.md)>> | Yes| Obtains information about the running processes. This API uses a promise to return the result.|