diff --git a/en/application-dev/reference/apis/js-apis-ability-ability.md b/en/application-dev/reference/apis/js-apis-ability-ability.md index 04313f3dfe02920b468647e7e717065760da46cc..1d080a340a75b5189c8913d8797180b9b54aa8fe 100644 --- a/en/application-dev/reference/apis/js-apis-ability-ability.md +++ b/en/application-dev/reference/apis/js-apis-ability-ability.md @@ -13,6 +13,8 @@ The **Ability** module provides all level-2 module APIs for developers to export import ability from '@ohos.ability.ability'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityBase | Name | Type | Description | diff --git a/en/application-dev/reference/apis/js-apis-app-ability-appManager.md b/en/application-dev/reference/apis/js-apis-app-ability-appManager.md index 8eecb89d08f2ae788a16e0790f5f34c0dbee962e..e01617aa2d1c5f76c3cd6a2f7e1db7f3b4b8451e 100644 --- a/en/application-dev/reference/apis/js-apis-app-ability-appManager.md +++ b/en/application-dev/reference/apis/js-apis-app-ability-appManager.md @@ -1,6 +1,6 @@ # @ohos.app.ability.appManager (appManager) -The **appManager** module implements application management. You can use the APIs of this module to query whether the application is undergoing a stability test, whether the application is running on a RAM constrained device, the memory usage of the application, and information about the running process. +The **appManager** module implements application management. You can use the APIs of this module to query whether the application is undergoing a stability test, whether the application is running on a RAM constrained device, the memory size of the application, and information about the running process. > **NOTE** > @@ -22,9 +22,9 @@ 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 API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is undergoing a stability test, and **false** means the opposite. | + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | callback | AsyncCallback<boolean> | Yes|Callback used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is undergoing a stability test, and **false** means the opposite. | **Error codes** @@ -41,9 +41,9 @@ import appManager from '@ohos.app.ability.appManager'; appManager.isRunningInStabilityTest((err, flag) => { if (err) { - console.error('isRunningInStabilityTest fail, err: ${JSON.stringify(err)}'); + console.error(`isRunningInStabilityTest fail, err: ${JSON.stringify(err)}`); } else { - console.log('The result of isRunningInStabilityTest is: ${JSON.stringify(flag)}'); + console.log(`The result of isRunningInStabilityTest is: ${JSON.stringify(flag)}`); } }); ``` @@ -59,9 +59,9 @@ Checks whether this application is undergoing a stability test. This API uses a **Return value** -| Type| Description| -| -------- | -------- | -| Promise<boolean> | Promise used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is undergoing a stability test, and **false** means the opposite.| + | Type| Description| + | -------- | -------- | + | Promise<boolean> | Promise used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is undergoing a stability test, and **false** means the opposite.| **Error codes** @@ -77,9 +77,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error import appManager from '@ohos.app.ability.appManager'; appManager.isRunningInStabilityTest().then((flag) => { - console.log('The result of isRunningInStabilityTest is: ${JSON.stringify(flag)}'); + console.log(`The result of isRunningInStabilityTest is: ${JSON.stringify(flag)}`); }).catch((error) => { - console.error('error: ${JSON.stringify(error)}'); + console.error(`error: ${JSON.stringify(error)}`); }); ``` @@ -94,9 +94,9 @@ Checks whether this application is running on a RAM constrained device. This API **Return value** -| Type| Description| -| -------- | -------- | -| Promise<boolean> | Promise used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is running on a RAM constrained device, and **false** means the opposite.| + | Type| Description| + | -------- | -------- | + | Promise<boolean> | Promise used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is running on a RAM constrained device, and **false** means the opposite.| **Error codes** @@ -112,9 +112,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error import appManager from '@ohos.app.ability.appManager'; appManager.isRamConstrainedDevice().then((data) => { - console.log('The result of isRamConstrainedDevice is: ${JSON.stringify(data)}'); + console.log(`The result of isRamConstrainedDevice is: ${JSON.stringify(data)}`); }).catch((error) => { - console.error('error: ${JSON.stringify(error)}'); + console.error(`error: ${JSON.stringify(error)}`); }); ``` @@ -128,9 +128,9 @@ 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 the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is running on a RAM constrained device, and **false** means the opposite. | + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | callback | AsyncCallback<boolean> | Yes|Callback used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is running on a RAM constrained device, and **false** means the opposite. | **Error codes** @@ -147,9 +147,9 @@ import appManager from '@ohos.app.ability.appManager'; appManager.isRamConstrainedDevice((err, data) => { if (err) { - console.error('isRamConstrainedDevice fail, err: ${JSON.stringify(err)}'); + console.error(`isRamConstrainedDevice fail, err: ${JSON.stringify(err)}`); } else { - console.log('The result of isRamConstrainedDevice is: ${JSON.stringify(data)}'); + console.log(`The result of isRamConstrainedDevice is: ${JSON.stringify(data)}`); } }); ``` @@ -158,15 +158,15 @@ appManager.isRamConstrainedDevice((err, data) => { getAppMemorySize(): Promise\; -Obtains the memory usage of this application. This API uses a promise to return the result. +Obtains the memory size of this application. This API uses a promise to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Core **Return value** -| Type| Description| -| -------- | -------- | -| Promise<number> | Promise used to return the API call result and the memory size. You can perform error handling or custom processing in this callback.| + | Type| Description| + | -------- | -------- | + | Promise<number> | Promise used to return the API call result and the memory size. You can perform error handling or custom processing in this callback.| **Error codes** @@ -182,9 +182,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error import appManager from '@ohos.app.ability.appManager'; 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.error('error: ${JSON.stringify(error)}'); + console.error(`error: ${JSON.stringify(error)}`); }); ``` @@ -192,15 +192,15 @@ appManager.getAppMemorySize().then((data) => { getAppMemorySize(callback: AsyncCallback\): void; -Obtains the memory usage of this application. This API uses an asynchronous callback to return the result. +Obtains the memory size of this application. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Core **Parameters** -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| callback | AsyncCallback<number> | Yes|Callback used to return the API call result and the memory size. You can perform error handling or custom processing in this callback.| + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | callback | AsyncCallback<number> | Yes|Callback used to return the API call result and the memory size. You can perform error handling or custom processing in this callback.| **Error codes** @@ -217,9 +217,9 @@ import appManager from '@ohos.app.ability.appManager'; appManager.getAppMemorySize((err, data) => { if (err) { - console.error('getAppMemorySize fail, err: ${JSON.stringify(err)}'); + console.error(`getAppMemorySize fail, err: ${JSON.stringify(err)}`); } else { - console.log('The size of app memory is: ${JSON.stringify(data)}'); + console.log(`The size of app memory is: ${JSON.stringify(data)}`); } }); ``` @@ -254,9 +254,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error import appManager from '@ohos.app.ability.appManager'; appManager.getRunningProcessInformation().then((data) => { - console.log('The running process information is: ${JSON.stringify(data)}'); + console.log(`The running process information is: ${JSON.stringify(data)}`); }).catch((error) => { - console.error('error: ${JSON.stringify(error)}'); + console.error(`error: ${JSON.stringify(error)}`); }); ``` @@ -272,9 +272,9 @@ Obtains information about the running processes. This API uses an asynchronous c **Parameters** -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| callback | AsyncCallback\> | Yes|Callback used to return the API call result and the process running information. You can perform error handling or custom processing in this callback.| + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | callback | AsyncCallback\> | Yes|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** @@ -291,9 +291,9 @@ import appManager from '@ohos.app.ability.appManager'; appManager.getRunningProcessInformation((err, data) => { if (err) { - console.error('getRunningProcessInformation fail, err: ${JSON.stringify(err)}'); + console.error(`getRunningProcessInformation fail, err: ${JSON.stringify(err)}`); } else { - console.log('The process running information is: ${JSON.stringify(data)}'); + console.log(`The process running information is: ${JSON.stringify(data)}`); } }); ``` @@ -339,9 +339,9 @@ import appManager from '@ohos.app.ability.appManager'; const bundleName = "this is a bundleName"; const versionCode = 1; appManager.isSharedBundleRunning(bundleName, versionCode).then((data) => { - console.log('The shared bundle running is: ${JSON.stringify(data)}'); + console.log(`The shared bundle running is: ${JSON.stringify(data)}`); }).catch((error) => { - console.error('error: ${JSON.stringify(error)}'); + console.error(`error: ${JSON.stringify(error)}`); }); ``` @@ -382,9 +382,9 @@ const bundleName = "this is a bundleName"; const versionCode = 1; appManager.isSharedBundleRunning(bundleName, versionCode, (err, data) => { if (err) { - console.error('err: ${JSON.stringify(err)}'); + console.error(`err: ${JSON.stringify(err)}`); } else { - console.log('The shared bundle running is: ${JSON.stringify(data)}'); + console.log(`The shared bundle running is: ${JSON.stringify(data)}`); } }); ``` @@ -581,7 +581,7 @@ try { // 2. Deregister the application state observer. function unregisterApplicationStateObserverCallback(err) { if (err) { - console.error('unregisterApplicationStateObserverCallback fail, err: ${JSON.stringify(err)}'); + console.error(`unregisterApplicationStateObserverCallback fail, err: ${JSON.stringify(err)}`); } else { console.log('unregisterApplicationStateObserverCallback success.'); } @@ -589,7 +589,7 @@ function unregisterApplicationStateObserverCallback(err) { try { appManager.off('applicationState', observerId, unregisterApplicationStateObserverCallback); } catch (paramError) { - console.error('error: ${paramError.code}, ${paramError.message}'); + console.error(`error: ${paramError.code}, ${paramError.message}`); } ``` @@ -662,12 +662,12 @@ try { // 2. Deregister the application state observer. try { appManager.off('applicationState', observerId).then((data) => { - console.log('unregisterApplicationStateObserver success, data: ${JSON.stringify(data)}'); + console.log(`unregisterApplicationStateObserver success, data: ${JSON.stringify(data)}`); }).catch((err) => { - console.error('unregisterApplicationStateObserver fail, err: ${JSON.stringify(err)}'); + console.error(`unregisterApplicationStateObserver fail, err: ${JSON.stringify(err)}`); }); } catch (paramError) { - console.error('error: ${paramError.code}, ${paramError.message}'); + console.error(`error: ${paramError.code}, ${paramError.message}`); } ``` @@ -704,15 +704,15 @@ import appManager from '@ohos.app.ability.appManager'; function getForegroundApplicationsCallback(err, data) { if (err) { - console.error('getForegroundApplicationsCallback fail, err: ${JSON.stringify(err)}'); + console.error(`getForegroundApplicationsCallback fail, err: ${JSON.stringify(err)}`); } else { - console.log('getForegroundApplicationsCallback success, data: ${JSON.stringify(data)}'); + console.log(`getForegroundApplicationsCallback success, data: ${JSON.stringify(data)}`); } } try { appManager.getForegroundApplications(getForegroundApplicationsCallback); } catch (paramError) { - console.error('error: ${paramError.code}, ${paramError.message}'); + console.error(`error: ${paramError.code}, ${paramError.message}`); } ``` @@ -748,9 +748,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error import appManager from '@ohos.app.ability.appManager'; appManager.getForegroundApplications().then((data) => { - console.log('getForegroundApplications success, data: ${JSON.stringify(data)}'); + console.log(`getForegroundApplications success, data: ${JSON.stringify(data)}`); }).catch((err) => { - console.error('getForegroundApplications fail, err: ${JSON.stringify(err)}'); + console.error(`getForegroundApplications fail, err: ${JSON.stringify(err)}`); }); ``` @@ -796,10 +796,10 @@ try { appManager.killProcessWithAccount(bundleName, accountId).then(() => { console.log('killProcessWithAccount success'); }).catch((err) => { - console.error('killProcessWithAccount fail, err: ${JSON.stringify(err)}'); + console.error(`killProcessWithAccount fail, err: ${JSON.stringify(err)}`); }); } catch (paramError) { - console.error('error: ${paramError.code}, ${paramError.message}'); + console.error(`error: ${paramError.code}, ${paramError.message}`); } ``` @@ -822,11 +822,11 @@ Kills a process by bundle name and account ID. This API uses an asynchronous cal **Parameters** -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| bundleName | string | Yes| Bundle name.| -| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).| -| callback | AsyncCallback\ | Yes| Callback used to return the API call result. You can perform error handling or custom processing in this callback.| + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | bundleName | string | Yes| Bundle name.| + | accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).| + | callback | AsyncCallback\ | Yes| Callback used to return the API call result. You can perform error handling or custom processing in this callback.| **Error codes** @@ -845,7 +845,7 @@ let bundleName = 'bundleName'; let accountId = 0; function killProcessWithAccountCallback(err, data) { if (err) { - console.error('killProcessWithAccountCallback fail, err: ${JSON.stringify(err)}'); + console.error(`killProcessWithAccountCallback fail, err: ${JSON.stringify(err)}`); } else { console.log('killProcessWithAccountCallback success.'); } @@ -888,7 +888,7 @@ import appManager from '@ohos.app.ability.appManager'; let bundleName = 'bundleName'; function killProcessesByBundleNameCallback(err, data) { if (err) { - console.error('killProcessesByBundleNameCallback fail, err: ${JSON.stringify(err)}'); + console.error(`killProcessesByBundleNameCallback fail, err: ${JSON.stringify(err)}`); } else { console.log('killProcessesByBundleNameCallback success.'); } @@ -896,7 +896,7 @@ function killProcessesByBundleNameCallback(err, data) { try { appManager.killProcessesByBundleName(bundleName, killProcessesByBundleNameCallback); } catch (paramError) { - console.error('error: ${paramError.code}, ${paramError.message}'); + console.error(`error: ${paramError.code}, ${paramError.message}`); } ``` @@ -942,10 +942,10 @@ try { appManager.killProcessesByBundleName(bundleName).then((data) => { console.log('killProcessesByBundleName success.'); }).catch((err) => { - console.error('killProcessesByBundleName fail, err: ${JSON.stringify(err)}'); + console.error(`killProcessesByBundleName fail, err: ${JSON.stringify(err)}`); }); } catch (paramError) { - console.error('error: ${paramError.code}, ${paramError.message}'); + console.error(`error: ${paramError.code}, ${paramError.message}`); } ``` @@ -984,7 +984,7 @@ import appManager from '@ohos.app.ability.appManager'; let bundleName = 'bundleName'; function clearUpApplicationDataCallback(err, data) { if (err) { - console.error('clearUpApplicationDataCallback fail, err: ${JSON.stringify(err)}'); + console.error(`clearUpApplicationDataCallback fail, err: ${JSON.stringify(err)}`); } else { console.log('clearUpApplicationDataCallback success.'); } @@ -992,7 +992,7 @@ function clearUpApplicationDataCallback(err, data) { try { appManager.clearUpApplicationData(bundleName, clearUpApplicationDataCallback); } catch (paramError) { - console.error('error: ${paramError.code}, ${paramError.message}'); + console.error(`error: ${paramError.code}, ${paramError.message}`); } ``` @@ -1038,10 +1038,10 @@ try { appManager.clearUpApplicationData(bundleName).then((data) => { console.log('clearUpApplicationData success.'); }).catch((err) => { - console.error('clearUpApplicationData fail, err: ${JSON.stringify(err)}'); + console.error(`clearUpApplicationData fail, err: ${JSON.stringify(err)}`); }); } catch (paramError) { - console.error('error: ${paramError.code}, ${paramError.message}'); + console.error(`error: ${paramError.code}, ${paramError.message}`); } ``` @@ -1049,7 +1049,7 @@ try { getProcessMemoryByPid(pid: number, callback: AsyncCallback\): void; -Obtains the memory usage of a process. This API uses an asynchronous callback to return the result. +Obtains the memory size of a process. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Core @@ -1078,7 +1078,7 @@ import appManager from '@ohos.app.ability.appManager'; let pid = 0; function getProcessMemoryByPidCallback(err, data) { if (err) { - console.error('getProcessMemoryByPidCallback fail, err: ${JSON.stringify(err)}'); + console.error(`getProcessMemoryByPidCallback fail, err: ${JSON.stringify(err)}`); } else { console.log('getProcessMemoryByPidCallback success.'); } @@ -1086,7 +1086,7 @@ function getProcessMemoryByPidCallback(err, data) { try { appManager.getProcessMemoryByPid(pid, getProcessMemoryByPidCallback); } catch (paramError) { - console.error('error: ${paramError.code}, ${paramError.message}'); + console.error(`error: ${paramError.code}, ${paramError.message}`); } ``` @@ -1094,7 +1094,7 @@ try { getProcessMemoryByPid(pid: number): Promise\; -Obtains the memory usage of a process. This API uses a promise to return the result. +Obtains the memory size of a process. This API uses a promise to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Core @@ -1130,10 +1130,10 @@ try { appManager.getProcessMemoryByPid(pid).then((data) => { console.log('getProcessMemoryByPid success.'); }).catch((err) => { - console.error('getProcessMemoryByPid fail, err: ${JSON.stringify(err)}'); + console.error(`getProcessMemoryByPid fail, err: ${JSON.stringify(err)}`); }); } catch (paramError) { - console.error('error: ${paramError.code}, ${paramError.message}'); + console.error(`error: ${paramError.code}, ${paramError.message}`); } ``` @@ -1170,7 +1170,7 @@ import appManager from '@ohos.app.ability.appManager'; let bundleName = "bundleName"; function getRunningProcessInfoByBundleNameCallback(err, data) { if (err) { - console.error('getRunningProcessInfoByBundleNameCallback fail, err: ${JSON.stringify(err)}'); + console.error(`getRunningProcessInfoByBundleNameCallback fail, err: ${JSON.stringify(err)}`); } else { console.log('getRunningProcessInfoByBundleNameCallback success.'); } @@ -1178,7 +1178,7 @@ function getRunningProcessInfoByBundleNameCallback(err, data) { try { appManager.getRunningProcessInfoByBundleName(bundleName, getRunningProcessInfoByBundleNameCallback); } catch (paramError) { - console.error('error: ${paramError.code}, ${paramError.message}'); + console.error(`error: ${paramError.code}, ${paramError.message}`); } ``` @@ -1222,10 +1222,10 @@ try { appManager.getRunningProcessInfoByBundleName(bundleName).then((data) => { console.log('getRunningProcessInfoByBundleName success.'); }).catch((err) => { - console.error('getRunningProcessInfoByBundleName fail, err: ${JSON.stringify(err)}'); + console.error(`getRunningProcessInfoByBundleName fail, err: ${JSON.stringify(err)}`); }); } catch (paramError) { - console.error('error: ${paramError.code}, ${paramError.message}'); + console.error(`error: ${paramError.code}, ${paramError.message}`); } ``` @@ -1264,7 +1264,7 @@ let bundleName = "bundleName"; let userId = 0; function getRunningProcessInfoByBundleNameCallback(err, data) { if (err) { - console.error('getRunningProcessInfoByBundleNameCallback fail, err: ${JSON.stringify(err)}'); + console.error(`getRunningProcessInfoByBundleNameCallback fail, err: ${JSON.stringify(err)}`); } else { console.log('getRunningProcessInfoByBundleNameCallback success.'); } @@ -1272,7 +1272,7 @@ function getRunningProcessInfoByBundleNameCallback(err, data) { try { appManager.getRunningProcessInfoByBundleName(bundleName, userId, getRunningProcessInfoByBundleNameCallback); } catch (paramError) { - console.error('error: ${paramError.code}, ${paramError.message}'); + console.error(`error: ${paramError.code}, ${paramError.message}`); } ``` @@ -1318,10 +1318,10 @@ try { appManager.getRunningProcessInfoByBundleName(bundleName, userId).then((data) => { console.log('getRunningProcessInfoByBundleName success.'); }).catch((err) => { - console.error('getRunningProcessInfoByBundleName fail, err: ${JSON.stringify(err)}'); + console.error(`getRunningProcessInfoByBundleName fail, err: ${JSON.stringify(err)}`); }); } catch (paramError) { - console.error('error: ${paramError.code}, ${paramError.message}'); + console.error(`error: ${paramError.code}, ${paramError.message}`); } ``` diff --git a/en/application-dev/reference/apis/js-apis-app-ability-common.md b/en/application-dev/reference/apis/js-apis-app-ability-common.md index dacf140793402f8d0512b7ac388fe7f7d65ee6b0..022e15da82ba2092cd934ef09e4092874cfde989 100644 --- a/en/application-dev/reference/apis/js-apis-app-ability-common.md +++ b/en/application-dev/reference/apis/js-apis-app-ability-common.md @@ -12,8 +12,9 @@ The **Common** module provides all level-2 module APIs for developers to export. ```ts import common from '@ohos.app.ability.common'; ``` +## Attributes -**System capability**: SystemCapability.Ability.AbilityBase +**System capability**: SystemCapability.Ability.AbilityRuntime.Core | Name | Type | Description | | ----------- | -------------------- | ------------------------------------------------------------ | diff --git a/en/application-dev/reference/apis/js-apis-app-ability-configuration.md b/en/application-dev/reference/apis/js-apis-app-ability-configuration.md index 8f1b67879a4f13bd6c911eaa6303c9812e1cde0e..08a77add5eccc1db79990cd679b24ce0cd34e1a2 100644 --- a/en/application-dev/reference/apis/js-apis-app-ability-configuration.md +++ b/en/application-dev/reference/apis/js-apis-app-ability-configuration.md @@ -12,6 +12,8 @@ The **Configuration** module defines environment change information. **Configura import Configuration from '@ohos.app.ability.Configuration'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityBase | Name| Type| Readable| Writable| Description| diff --git a/en/application-dev/reference/apis/js-apis-app-ability-missionManager.md b/en/application-dev/reference/apis/js-apis-app-ability-missionManager.md index 9e3b401e5bf5f21c31210ef12736e5bc7e6fbc58..a6755ee89d809672854aaf08c258566821f7e879 100644 --- a/en/application-dev/reference/apis/js-apis-app-ability-missionManager.md +++ b/en/application-dev/reference/apis/js-apis-app-ability-missionManager.md @@ -1098,3 +1098,315 @@ try { console.error('moveMissionToFront failed. Cause: ${error.message}'); } ``` + +## missionManager.moveMissionsToForeground10+ + +moveMissionsToForeground(missionIds: Array<number>, callback: AsyncCallback<void>): void; + +Switches a batch of missions to the foreground. This API uses an asynchronous callback to return the result. + +**Required permissions**: ohos.permission.MANAGE_MISSIONS + +**System capability**: SystemCapability.Ability.AbilityRuntime.Mission + +**System API**: This is a system API. + +**Parameters** + + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | missionIds | Array<number> | Yes| Array holding the mission IDs.| + | callback | AsyncCallback<void> | Yes| Callback used to return the result.| + +**Error codes** + +For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). + +| ID| Error Message| +| ------- | -------- | +| 16000050 | Internal error. | + +**Example** + +```ts +import abilityManager from '@ohos.app.ability.abilityManager'; +import missionManager from '@ohos.app.ability.missionManager'; + +try { + missionManager.getMissionInfos("", 10, (error, missionInfos) => { + if (error.code) { + console.log("getMissionInfos failed, error.code:" + JSON.stringify(error.code)); + return; + } + if (missionInfos.length < 1) { + return; + } + + let toShows = new Array(); + for (let missionInfo of missionInfos) { + if (missionInfo.abilityState == abilityManager.AbilityState.BACKGROUND) { + toShows.push(missionInfo.missionId); + } + } + missionManager.moveMissionsToForeground(toShows, (err, data) => { + if (err) { + console.error('moveMissionsToForeground failed: ${err.message}'); + } else { + console.info('moveMissionsToForeground successfully: ${JSON.stringify(data)}'); + } + }); + }); +} catch (paramError) { + console.log("error: " + paramError.code + ", " + paramError.message); +} + +``` + +## missionManager.moveMissionsToForeground10+ + +moveMissionsToForeground(missionIds: Array<number>, topMission: number, callback: AsyncCallback<void>): void; + +Switches a batch of missions to the foreground, and moves the mission with the specified ID to the top. This API uses an asynchronous callback to return the result. + +**Required permissions**: ohos.permission.MANAGE_MISSIONS + +**System capability**: SystemCapability.Ability.AbilityRuntime.Mission + +**System API**: This is a system API. + +**Parameters** + + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | missionIds | Array<number> | Yes| Array holding the mission IDs.| + | topMission | number | Yes| ID of the mission to be moved to the top.| + | callback | AsyncCallback<void> | Yes| Callback used to return the result.| + +**Error codes** + +For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). + +| ID| Error Message| +| ------- | -------- | +| 16000050 | Internal error. | + +**Example** + +```ts +import abilityManager from '@ohos.app.ability.abilityManager'; +import missionManager from '@ohos.app.ability.missionManager'; + +try { + missionManager.getMissionInfos("", 10, (error, missionInfos) => { + if (error.code) { + console.log("getMissionInfos failed, error.code:" + JSON.stringify(error.code)); + return; + } + if (missionInfos.length < 1) { + return; + } + + let toShows = new Array(); + for (let missionInfo of missionInfos) { + if (missionInfo.abilityState == abilityManager.AbilityState.BACKGROUND) { + toShows.push(missionInfo.missionId); + } + } + missionManager.moveMissionsToForeground(toShows, toShows[0], (err, data) => { + if (err) { + console.error('moveMissionsToForeground failed: ${err.message}'); + } else { + console.info('moveMissionsToForeground successfully: ${JSON.stringify(data)}'); + } + }); + }); +} catch (paramError) { + console.log("error: " + paramError.code + ", " + paramError.message); +} + +``` + +## missionManager.moveMissionsToForeground10+ + +moveMissionsToForeground(missionIds: Array<number>, topMission?: number): Promise<void> ; + +Switches a batch of missions to the foreground, and moves the mission with the specified ID to the top. This API uses a promise to return the result. + +**Required permissions**: ohos.permission.MANAGE_MISSIONS + +**System capability**: SystemCapability.Ability.AbilityRuntime.Mission + +**System API**: This is a system API. + +**Parameters** + + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | missionIds | Array<number> | Yes| Array holding the mission IDs.| + | topMission | number | No| ID of the mission to be moved to the top.| + +**Return value** + + | Type| Description| + | -------- | -------- | + | Promise<void> | Promise used to return the result.| + +**Error codes** + +For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). + +| ID| Error Message| +| ------- | -------- | +| 16000050 | Internal error. | + +**Example** + +```ts +import abilityManager from '@ohos.app.ability.abilityManager'; +import missionManager from '@ohos.app.ability.missionManager'; + +try { + missionManager.getMissionInfos("", 10, (error, missionInfos) => { + if (error.code) { + console.log("getMissionInfos failed, error.code:" + JSON.stringify(error.code)); + return; + } + if (missionInfos.length < 1) { + return; + } + + let toShows = new Array(); + for (let missionInfo of missionInfos) { + if (missionInfo.abilityState == abilityManager.AbilityState.BACKGROUND) { + toShows.push(missionInfo.missionId); + } + } + missionManager.moveMissionsToForeground(toShows, toShows[0]).then(() => { + console.log("moveMissionsToForeground is called" ); + }); + }); +} catch (paramError) { + console.log("error: " + paramError.code + ", " + paramError.message); +} + +``` + +## missionManager.moveMissionsToBackground10+ + +moveMissionsToBackground(missionIds: Array<number>, callback: AsyncCallback<Array<number>>): void; + +Switches a batch of missions to the background. This API uses an asynchronous callback to return the result. The mission IDs in the callback are sorted by mission level when the missions are switched. + +**Required permissions**: ohos.permission.MANAGE_MISSIONS + +**System capability**: SystemCapability.Ability.AbilityRuntime.Mission + +**System API**: This is a system API. + +**Parameters** + + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | missionIds | Array<number> | Yes| Array holding the mission IDs.| + | callback | AsyncCallback<Array<number>> | Yes| Callback used to return the result.| + +**Error codes** + +For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). + +| ID| Error Message| +| ------- | -------- | +| 16000050 | Internal error. | + +**Example** + +```ts +import abilityManager from '@ohos.app.ability.abilityManager'; +import missionManager from '@ohos.app.ability.missionManager'; + +try { + missionManager.getMissionInfos("", 10, (error, missionInfos) => { + if (error.code) { + console.log("getMissionInfos failed, error.code:" + JSON.stringify(error.code)); + return; + } + + let toHides = new Array(); + for (let missionInfo of missionInfos) { + if (missionInfo.abilityState == abilityManager.AbilityState.FOREGROUND) { + toHides.push(missionInfo.missionId); + } + } + missionManager.moveMissionsToBackground(toHides, (err, data) => { + if (err) { + console.error('moveMissionsToBackground failed: ${err.message}'); + } else { + console.info('moveMissionsToBackground successfully: ${JSON.stringify(data)}'); + } + }); + }); +} catch (paramError) { + console.log("error: " + paramError.code + ", " + paramError.message); +} +``` + +## missionManager.moveMissionsToBackground10+ + +moveMissionsToBackground(missionIds : Array<number>): Promise<Array<number>>; + +Switches a batch of missions to the background. This API uses a promise to return the result. The mission IDs in the promise are sorted by mission level when the missions are switched. + +**Required permissions**: ohos.permission.MANAGE_MISSIONS + +**System capability**: SystemCapability.Ability.AbilityRuntime.Mission + +**System API**: This is a system API. + +**Parameters** + + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | missionIds | Array<number> | Yes| Array holding the mission IDs.| + +**Return value** + + | Type| Description| + | -------- | -------- | + | Promise<Array<number>> | Promise used to return the result.| + +**Error codes** + +For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). + +| ID| Error Message| +| ------- | -------- | +| 16000050 | Internal error. | + +**Example** + +```ts +import abilityManager from '@ohos.app.ability.abilityManager'; +import missionManager from '@ohos.app.ability.missionManager'; + +try { + missionManager.getMissionInfos("", 10, (error, missionInfos) => { + if (error.code) { + console.log("getMissionInfos failed, error.code:" + JSON.stringify(error.code)); + return; + } + + let toHides = new Array(); + for (let missionInfo of missionInfos) { + if (missionInfo.abilityState == abilityManager.AbilityState.FOREGROUND) { + toHides.push(missionInfo.missionId); + } + } + missionManager.moveMissionsToBackground(toHides).then((hideRes) => { + console.log("moveMissionsToBackground is called, res: "+ JSON.stringify(hideRes)); + }); + }); +} catch (paramError) { + console.log("error: " + paramError.code + ", " + paramError.message); +} + +``` diff --git a/en/application-dev/reference/apis/js-apis-app-ability-quickFixManager.md b/en/application-dev/reference/apis/js-apis-app-ability-quickFixManager.md index 7d69b42f05b76dcc76ce670281ce13273261e269..b39cd248c64b88d07704b4c15556f0b74f04e1b8 100644 --- a/en/application-dev/reference/apis/js-apis-app-ability-quickFixManager.md +++ b/en/application-dev/reference/apis/js-apis-app-ability-quickFixManager.md @@ -64,21 +64,13 @@ Applies a quick fix patch. This API uses an asynchronous callback to return the **Error codes** +If an error occurs during patch installation, the error code and message are returned through the common event [COMMON_EVENT_QUICK_FIX_APPLY_RESULT](commonEvent-definitions.md#common_event_quick_fix_apply_result9). + | ID| Error Message| | ------- | -------- | | 18500002 | The specified quick fix is invalid. It may not exist or inaccessible. | | 18500008 | Internal error. | -If an error occurs during patch installation, the error code and message are returned through the common event [COMMON_EVENT_QUICK_FIX_APPLY_RESULT](commonEvent-definitions.md#common_event_quick_fix_apply_result9). The table below lists the possible error codes and messages. - -| ID| Error Message| -| ------- | -------- | -| 18500003 | Deploy hqf failed. | -| 18500004 | Switch hqf failed. | -| 18500005 | Delete hqf failed. | -| 18500006 | Load patch failed. | -| 18500007 | Unload patch failed. | - For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). > **NOTE** @@ -128,21 +120,13 @@ Applies a quick fix patch. This API uses a promise to return the result. **Error codes** +If an error occurs during patch installation, the error code and message are returned through the common event [COMMON_EVENT_QUICK_FIX_APPLY_RESULT](commonEvent-definitions.md#common_event_quick_fix_apply_result9). + | ID| Error Message| | ------- | -------- | | 18500002 | The specified quick fix is invalid. It may not exist or inaccessible. | | 18500008 | Internal error. | -If an error occurs during patch installation, the error code and message are returned through the common event [COMMON_EVENT_QUICK_FIX_APPLY_RESULT](commonEvent-definitions.md#common_event_quick_fix_apply_result9). The table below lists the possible error codes and messages. - -| ID| Error Message| -| ------- | -------- | -| 18500003 | Deploy hqf failed. | -| 18500004 | Switch hqf failed. | -| 18500005 | Delete hqf failed. | -| 18500006 | Load patch failed. | -| 18500007 | Unload patch failed. | - For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). **Example** @@ -281,13 +265,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error | 18500001 | The bundle is not exist or no patch has applied. | | 18500009 | The application has a apply quick fix task that is being processed. | -If an error occurs during patch installation, the error code and message are returned through the common event [COMMON_EVENT_QUICK_FIX_REVOKE_RESULT](./common_event/commonEvent-ability.md#common_event_quick_fix_revoke_result10). The table below lists the possible error codes and messages. - -| ID| Error Message| -| ------- | -------- | -| 18500004 | Switch hqf failed. | -| 18500005 | Delete hqf failed. | -| 18500007 | Unload patch failed. | +If an error occurs during patch installation, the error code and message are returned through the common event [COMMON_EVENT_QUICK_FIX_REVOKE_RESULT](./common_event/commonEvent-ability.md#common_event_quick_fix_revoke_result10). **Example** diff --git a/en/application-dev/reference/apis/js-apis-app-ability-want.md b/en/application-dev/reference/apis/js-apis-app-ability-want.md index 777ea195d6990d7a2decfefce46272ed3c1074f0..71be678cfd53dec571a3f69ddec8dc811b304ed8 100644 --- a/en/application-dev/reference/apis/js-apis-app-ability-want.md +++ b/en/application-dev/reference/apis/js-apis-app-ability-want.md @@ -171,6 +171,7 @@ import Want from '@ohos.app.ability.Want'; ```ts // (1) UIAbility1 starts a ServiceExtensionAbility. + import common from '@ohos.app.ability.common'; let context = getContext(this) as common.UIAbilityContext; // UIAbilityContext let want = { bundleName: 'com.example.myapplication1', diff --git a/en/application-dev/reference/apis/js-apis-app-ability-wantConstant.md b/en/application-dev/reference/apis/js-apis-app-ability-wantConstant.md index ddb7f5227f4f675317c7d0a891eeb4459010d84f..9081c7daca20bee94e6eafb58502d1bd6e5e66d3 100644 --- a/en/application-dev/reference/apis/js-apis-app-ability-wantConstant.md +++ b/en/application-dev/reference/apis/js-apis-app-ability-wantConstant.md @@ -30,6 +30,8 @@ Defines **Params** (specifying the action that can be performed) in the Want. | CONTENT_TITLE_KEY10+ | ohos.extra.param.key.contentTitle | Action of sharing the content title. | | SHARE_ABSTRACT_KEY10+ | ohos.extra.param.key.shareAbstract | Action of sharing the abstract. | | SHARE_URL_KEY10+ | ohos.extra.param.key.shareUrl | Action of sharing the URL. | +| SUPPORT_CONTINUE_PAGE_STACK_KEY10+ | ohos.extra.param.key.supportContinuePageStack | Whether to migrate page stack information during cross-device migration. The default value is **true**, indicating that page stack information is automatically migrated.| +| SUPPORT_CONTINUE_SOURCE_EXIT_KEY10+ | ohos.extra.param.key.supportContinueSourceExit | Whether to exit the application on the source device during cross-device migration. The default value is **true**, indicating that the application on the source device automatically exits.| ## wantConstant.Flags diff --git a/en/application-dev/reference/apis/js-apis-app-form-formBindingData.md b/en/application-dev/reference/apis/js-apis-app-form-formBindingData.md index ef63982ff82bac7f1deca5d5628fac7ea39c02aa..39a7d2b1ec4699882f2155420b5071b0e8ad73a2 100644 --- a/en/application-dev/reference/apis/js-apis-app-form-formBindingData.md +++ b/en/application-dev/reference/apis/js-apis-app-form-formBindingData.md @@ -75,14 +75,3 @@ try { console.error(`catch error, code: ${error.code}, message: ${error.message}`); } ``` - -## ProxyData - -Defines the widget proxy data. - -**System capability**: SystemCapability.Ability.Form - -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| key | string | Yes| Key of the proxy. The value depends on the data publisher.| -| subscriberId | string | No| Subscriber ID. The value depends on the data publisher. The default value is the current widget ID.| diff --git a/en/application-dev/reference/apis/js-apis-app-form-formInfo.md b/en/application-dev/reference/apis/js-apis-app-form-formInfo.md index 76ff555eb092c390183ce13cd3adfca25132429b..244a529a20a21a8f2ed5400a7cf4d1aa71bacbfc 100644 --- a/en/application-dev/reference/apis/js-apis-app-form-formInfo.md +++ b/en/application-dev/reference/apis/js-apis-app-form-formInfo.md @@ -169,6 +169,8 @@ Defines the information about the widget provider. **System capability**: SystemCapability.Ability.Form +**System API**: This is a system API and cannot be called by third-party applications. + | Name | Type | Readable | Writable | Description | | ----------- | -------- | -------- | -------------------- | ------------------------------------------------------------ | | bundleName | string | Yes | No | Name of the bundle to which the widget provider belongs. | diff --git a/en/application-dev/reference/apis/js-apis-application-appManager.md b/en/application-dev/reference/apis/js-apis-application-appManager.md index 543bf219536b118f028b1b747bd9ad784b824f83..59b752b78d9374560cd5c955923e32b9707ab61f 100644 --- a/en/application-dev/reference/apis/js-apis-application-appManager.md +++ b/en/application-dev/reference/apis/js-apis-application-appManager.md @@ -404,7 +404,7 @@ Kills a process by bundle name and account ID. This API uses a promise to return > > The **ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS** permission is not required when **accountId** specifies the current user. -**Required permissions**: ohos.permission.CLEAN_BACKGROUND_PROCESSES and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS +**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and ohos.permission.CLEAN_BACKGROUND_PROCESSES **System capability**: SystemCapability.Ability.AbilityRuntime.Core @@ -446,7 +446,7 @@ Kills a process by bundle name and account ID. This API uses an asynchronous cal **System API**: This is a system API and cannot be called by third-party applications. -**Required permissions**: ohos.permission.CLEAN_BACKGROUND_PROCESSES and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS +**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and ohos.permission.CLEAN_BACKGROUND_PROCESSES **Parameters** diff --git a/en/application-dev/reference/apis/js-apis-businessAbilityRouter.md b/en/application-dev/reference/apis/js-apis-businessAbilityRouter.md index 020d99ccce7c5a65427e8943faeb99676d6362ff..d582a2d634bde5fdeead85d9de222694ab0b17dd 100644 --- a/en/application-dev/reference/apis/js-apis-businessAbilityRouter.md +++ b/en/application-dev/reference/apis/js-apis-businessAbilityRouter.md @@ -26,7 +26,7 @@ For details, see [Permission Levels](../../security/accesstoken-overview.md#perm Enumerates the types of business abilities. -**System capability**: SystemCapability.BundleManager.BundleFramework.Core +**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System API**: This is a system API. @@ -39,7 +39,7 @@ Enumerates the types of business abilities. Describes the criteria for filtering business abilities. -**System capability**: SystemCapability.BundleManager.BundleFramework.Core +**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System API**: This is a system API. @@ -57,7 +57,7 @@ Obtains the business ability information based on the specified filter criteria. **Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED -**System capability**: SystemCapability.BundleManager.BundleFramework.Core +**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System API**: This is a system API. @@ -94,7 +94,7 @@ Obtains the business ability information based on the specified filter criteria. **Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED -**System capability**: SystemCapability.BundleManager.BundleFramework.Core +**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System API**: This is a system API. diff --git a/en/application-dev/reference/apis/js-apis-inner-ability-abilityResult.md b/en/application-dev/reference/apis/js-apis-inner-ability-abilityResult.md index 6723f4116a43b6aee237e07c0db6984ed91278a6..7ce1bcb0c99124d4f731aef43c33fe3eb89f402d 100644 --- a/en/application-dev/reference/apis/js-apis-inner-ability-abilityResult.md +++ b/en/application-dev/reference/apis/js-apis-inner-ability-abilityResult.md @@ -12,9 +12,11 @@ The **AbilityResult** module defines the result code and data returned when an a import ability from '@ohos.ability.ability'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityBase -| Name | Readable | Writable | Type | Mandatory| Description | -| ----------- | -------- |-------- | -------------------- | ---- | ------------------------------------------------------------ | -| resultCode | Yes | Yes | number | Yes | Result code returned after the started ability is terminated. | -| want | Yes | Yes | [Want](./js-apis-app-ability-want.md) | No | Data returned after the started ability is terminated.| +| Name | Type | Mandatory| Description | +| ----------- | -------------------- | ---- | ------------------------------------------------------------ | +| resultCode | number | Yes | Result code returned after the started ability is terminated. | +| want | [Want](./js-apis-app-ability-want.md) | No | Data returned after the started ability is terminated.| diff --git a/en/application-dev/reference/apis/js-apis-inner-ability-connectOptions.md b/en/application-dev/reference/apis/js-apis-inner-ability-connectOptions.md index edfc9b732c956deed3257032d9983eab3d86a095..27fae4b6b9f266a4bbc81993b1c09a7087aec9bc 100644 --- a/en/application-dev/reference/apis/js-apis-inner-ability-connectOptions.md +++ b/en/application-dev/reference/apis/js-apis-inner-ability-connectOptions.md @@ -12,9 +12,11 @@ import common from '@ohos.app.ability.common'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.Core -| Name | Type | Mandatory | Description | +| Name | Type | Mandatory | Description | | ------------ | -------- | ---- | ------------------------- | | onConnect7+ | function | Yes | Callback invoked when a connection is set up. | | onDisconnect7+ | function | Yes | Callback invoked when a connection is interrupted. | diff --git a/en/application-dev/reference/apis/js-apis-inner-ability-dataAbilityOperation.md b/en/application-dev/reference/apis/js-apis-inner-ability-dataAbilityOperation.md index 1037dfe2d682cd0cf579d457ee3f8f642b048fdc..2671351a3954cbaccceb72945eccf2c4f9a2af62 100644 --- a/en/application-dev/reference/apis/js-apis-inner-ability-dataAbilityOperation.md +++ b/en/application-dev/reference/apis/js-apis-inner-ability-dataAbilityOperation.md @@ -13,6 +13,8 @@ The **DataAbilityOperation** module defines the operation on DataAbilities. It c import ability from '@ohos.ability.ability'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel | Name | Template | Mandatory| Description | diff --git a/en/application-dev/reference/apis/js-apis-inner-ability-dataAbilityResult.md b/en/application-dev/reference/apis/js-apis-inner-ability-dataAbilityResult.md index 2a3cb7f384319fdc99f72e52e6e952eff951f7bb..c734230bbd4ac3d21417d5b1976a6242567f1a39 100644 --- a/en/application-dev/reference/apis/js-apis-inner-ability-dataAbilityResult.md +++ b/en/application-dev/reference/apis/js-apis-inner-ability-dataAbilityResult.md @@ -13,6 +13,8 @@ The **DataAbilityResult** module defines the operation result on DataAbilities. import ability from '@ohos.ability.ability'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel | Name | Type | Mandatory | Description | diff --git a/en/application-dev/reference/apis/js-apis-inner-ability-startAbilityParameter.md b/en/application-dev/reference/apis/js-apis-inner-ability-startAbilityParameter.md index 44903a992f5a319f13049ffe682962214ebfd7be..0957b72c2fba069831baed256fac14f4f1074644 100644 --- a/en/application-dev/reference/apis/js-apis-inner-ability-startAbilityParameter.md +++ b/en/application-dev/reference/apis/js-apis-inner-ability-startAbilityParameter.md @@ -13,6 +13,8 @@ The **StartAbilityParameter** module defines the parameters for starting an abil import ability from '@ohos.ability.ability'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel | Name | Type | Mandatory | Description | diff --git a/en/application-dev/reference/apis/js-apis-inner-ability-want.md b/en/application-dev/reference/apis/js-apis-inner-ability-want.md index 7e6211f628986e02503c8c130614770b57656b74..b106f2aa8822680b81a402511111916c93f463bb 100644 --- a/en/application-dev/reference/apis/js-apis-inner-ability-want.md +++ b/en/application-dev/reference/apis/js-apis-inner-ability-want.md @@ -12,6 +12,8 @@ Want is a carrier for information transfer between objects (application componen import Want from '@ohos.app.ability.Want'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityBase | Name | Type | Mandatory| Description | @@ -23,9 +25,9 @@ import Want from '@ohos.app.ability.Want'; | type | string | No | MIME type, that is, the type of the file to open, for example, **'text/xml'** and **'image/*'**. For details about the MIME type definition, see https://www.iana.org/assignments/media-types/media-types.xhtml?utm_source=ld246.com. | | flags | number | No | How the **Want** object will be handled. By default, numbers are passed in. For details, see [flags](js-apis-ability-wantConstant.md#wantconstantflags).| | action | string | No | Action to take, such as viewing and sharing application details. In implicit Want, you can define this field and use it together with **uri** or **parameters** to specify the operation to be performed on the data. For details, see [action](js-apis-ability-wantConstant.md#wantconstantaction). For details about the definition and matching rules of implicit Want, see [Matching Rules of Explicit Want and Implicit Want](../../application-models/explicit-implicit-want-mappings.md). | -| parameters | {[key: string]: Object} | No | Want parameters in the form of custom key-value (KV) pairs. By default, the following keys are carried:
- **ohos.aafwk.callerPid**: PID of the caller.
- **ohos.aafwk.param.callerToken**: token of the caller.
- **ohos.aafwk.param.callerUid**: UID in [bundleInfo](js-apis-bundle-BundleInfo.md#bundleinfo), that is, the application UID in the bundle information.
- **component.startup.newRules**: whether to enable the new control rule.
- **moduleName**: module name of the caller. No matter what this field is set to, the correct module name will be sent to the peer.
- **ohos.dlp.params.sandbox**: available only for DLP files. | +| parameters | {[key: string]: Object} | No | Want parameters in the form of custom key-value (KV) pairs. By default, the following keys are carried:
- **ohos.aafwk.callerPid**: PID of the caller.
- **ohos.aafwk.param.callerToken**: token of the caller.
- **ohos.aafwk.param.callerUid**: UID in [bundleInfo](js-apis-bundle-BundleInfo.md#bundleinfo), that is, the application UID in the bundle information.
- **component.startup.newRules**: whether to enable the new control rule.
- **moduleName**: module name of the caller. No matter what this field is set to, the correct module name will be sent to the peer.
- **ohos.dlp.params.sandbox**: available only for DLP files. | | entities | Array\ | No | Additional category information (such as browser and video player) of the target ability. It is a supplement to **action** in implicit Want and is used to filter ability types. For details, see [entity](js-apis-app-ability-wantConstant.md#wantconstantentity). | -| moduleName9+ | string | No | Module to which the ability belongs.| +| moduleName10+ | string | No | Module to which the ability belongs.| **Example** @@ -72,6 +74,6 @@ import Want from '@ohos.app.ability.Want'; // ... ``` -- For more details and examples, see [Application Model](../../application-models/application-model-composition.md). +- For more details and examples, see [Want](../../application-models/want-overview.md). diff --git a/en/application-dev/reference/apis/js-apis-inner-app-appVersionInfo.md b/en/application-dev/reference/apis/js-apis-inner-app-appVersionInfo.md index f5da165225786f606479e470a72b7ae99d894b72..aa01271dff80a4529b6c369fc65557aa9853865a 100644 --- a/en/application-dev/reference/apis/js-apis-inner-app-appVersionInfo.md +++ b/en/application-dev/reference/apis/js-apis-inner-app-appVersionInfo.md @@ -12,6 +12,8 @@ The **AppVersionInfo** module defines the application version information. You c import featureAbility from '@ohos.ability.featureAbility'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.Core | Name | Type | Readable| Writable| Description | diff --git a/en/application-dev/reference/apis/js-apis-inner-app-processInfo.md b/en/application-dev/reference/apis/js-apis-inner-app-processInfo.md index 6bc1f2037c669246c759e7a54b7c92739391c1b3..6cb7285a6804455977e2d65f07d2cc8c4090d0f9 100644 --- a/en/application-dev/reference/apis/js-apis-inner-app-processInfo.md +++ b/en/application-dev/reference/apis/js-apis-inner-app-processInfo.md @@ -12,6 +12,8 @@ The **ProcessInfo** module defines process information. You can use [getProcessI import featureAbility from '@ohos.ability.featureAbility'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.Core | Name| Type| Readable| Writable| Description| diff --git a/en/application-dev/reference/apis/js-apis-inner-application-abilityDelegator.md b/en/application-dev/reference/apis/js-apis-inner-application-abilityDelegator.md index 2a95498f3b1731fcad2883ea3373def1a16e332f..8d5867998b6330eb8da75cae01c111c97505fa74 100644 --- a/en/application-dev/reference/apis/js-apis-inner-application-abilityDelegator.md +++ b/en/application-dev/reference/apis/js-apis-inner-application-abilityDelegator.md @@ -1231,7 +1231,7 @@ Waits for an **AbilityStage** instance that matches the conditions set in an **A | Name | Type | Mandatory| Description | | ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | monitor | [AbilityStageMonitor](js-apis-inner-application-abilityStageMonitor.md) | Yes | [AbilityStageMonitor](js-apis-inner-application-abilityStageMonitor.md) instance.| -| timeout | number | No | Maximum waiting time, in milliseconds.| +| timeout | number | Yes | Maximum waiting time, in milliseconds.| **Return value** diff --git a/en/application-dev/reference/apis/js-apis-inner-application-abilityStageMonitor.md b/en/application-dev/reference/apis/js-apis-inner-application-abilityStageMonitor.md index 8e55c316de31c1bc20b5b13bf5e25ebc7315db2f..4e583d6daead0c8aecdf40532212217541293601 100644 --- a/en/application-dev/reference/apis/js-apis-inner-application-abilityStageMonitor.md +++ b/en/application-dev/reference/apis/js-apis-inner-application-abilityStageMonitor.md @@ -6,6 +6,8 @@ The **AbilityStageMonitor** module provides conditions for matching **AbilitySta > > The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.Core | Name | Type | Readable| Writable| Description | diff --git a/en/application-dev/reference/apis/js-apis-inner-application-abilityStateData.md b/en/application-dev/reference/apis/js-apis-inner-application-abilityStateData.md index 89737dea1984d4dbb8b5e46df6738b4dbb869e63..7397f0a192af4b6fb449ea39da9493bb8348195a 100644 --- a/en/application-dev/reference/apis/js-apis-inner-application-abilityStateData.md +++ b/en/application-dev/reference/apis/js-apis-inner-application-abilityStateData.md @@ -12,8 +12,12 @@ The **AbilityStateData** module defines the ability state information, which can import appManager from '@ohos.application.appManager'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.Core +**System API**: This is a system API and cannot be called by third-party applications. + | Name | Type | Readable| Writable| Description | | ----------------------- | ---------| ---- | ---- | ------------------------- | | pid | number | Yes | No | Process ID. | diff --git a/en/application-dev/reference/apis/js-apis-inner-application-appStateData.md b/en/application-dev/reference/apis/js-apis-inner-application-appStateData.md index 3d0dc128b614f7547eb5a921a7a56d83084b7b94..84af0c40abf00e28afcb87123ebca24ae6e02a71 100644 --- a/en/application-dev/reference/apis/js-apis-inner-application-appStateData.md +++ b/en/application-dev/reference/apis/js-apis-inner-application-appStateData.md @@ -12,6 +12,8 @@ The **AppStateData** module defines the application state data, which can be obt import appManager from '@ohos.app.ability.appManager'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.Core **System API**: This module is marked as @systemapi and not visible to third-party applications. diff --git a/en/application-dev/reference/apis/js-apis-inner-application-applicationStateObserver.md b/en/application-dev/reference/apis/js-apis-inner-application-applicationStateObserver.md index a36b30aa6ebeff234d11c1f928bbb688664e06bd..d429ca852f0e7a49a3181d826c3827b1d6428a75 100644 --- a/en/application-dev/reference/apis/js-apis-inner-application-applicationStateObserver.md +++ b/en/application-dev/reference/apis/js-apis-inner-application-applicationStateObserver.md @@ -12,6 +12,8 @@ The **ApplicationStateObserver** module defines an observer to listen for applic import appManager from '@ohos.app.ability.appManager'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.Core **System API**: This is a system API and cannot be called by third-party applications. diff --git a/en/application-dev/reference/apis/js-apis-inner-application-baseContext.md b/en/application-dev/reference/apis/js-apis-inner-application-baseContext.md index 707731bd3f213efe3a631dbdfb36baa465f91493..07dc810a71e3e22e55c27091059da3dac9bed563 100644 --- a/en/application-dev/reference/apis/js-apis-inner-application-baseContext.md +++ b/en/application-dev/reference/apis/js-apis-inner-application-baseContext.md @@ -12,6 +12,8 @@ import common from '@ohos.app.ability.common'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.Core | Name | Type | Readable | Writable | Description | diff --git a/en/application-dev/reference/apis/js-apis-inner-application-context.md b/en/application-dev/reference/apis/js-apis-inner-application-context.md index cc5ace51fb6896a9fb97669d2350e23b22f546f7..41559d21d9ab24e5ad3011bcefea6a84b721d342 100644 --- a/en/application-dev/reference/apis/js-apis-inner-application-context.md +++ b/en/application-dev/reference/apis/js-apis-inner-application-context.md @@ -158,7 +158,7 @@ try { ## Context.getGroupDir10+ -getGroupDir(groupId: string): Promise\; +getGroupDir(dataGroupID: string): Promise\; Obtains the shared directory based on a group ID. This API uses a promise to return the result. @@ -168,7 +168,7 @@ Obtains the shared directory based on a group ID. This API uses a promise to ret | Name | Type | Mandatory | Description | | -------- | ---------------------- | ---- | ------------- | -| groupId | string | Yes | Group ID, which is assigned by the system when an atomic service application project is created.| +| dataGroupID | string | Yes | Group ID, which is assigned by the system when an atomic service application project is created.| **Return value** @@ -188,16 +188,19 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error ```ts let groupId = "1"; -context.getGroupDir(groupId).then(data => { +let getGroupDirContext: common.Context; +try { + getGroupDirContext.getGroupDir(groupId).then(data => { console.log("getGroupDir result:" + data); -}).catch((err) => { - console.error('error: ${JSON.stringify(err)}'); -}); + }) +} catch (error) { + console.error('getGroupDirContext failed, error.code: ${error.code}, error.message: ${error.message}'); +} ``` ## Context.getGroupDir10+ -getGroupDir(groupId: string, callback: AsyncCallback\); +getGroupDir(dataGroupID: string, callback: AsyncCallback\); Obtains the shared directory based on a group ID. This API uses an asynchronous callback to return the result. @@ -207,7 +210,7 @@ Obtains the shared directory based on a group ID. This API uses an asynchronous | Name | Type | Mandatory | Description | | -------- | ---------------------- | ---- | ------------- | -| groupId | string | Yes | Group ID, which is assigned by the system when an atomic service application project is created.| +| dataGroupID | string | Yes | Group ID, which is assigned by the system when an atomic service application project is created.| | callback | AsyncCallback\ | Yes | Callback used to return the result. If no shared directory exists, null is returned. Only the encryption level EL2 is supported.| **Error codes** @@ -221,11 +224,13 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error **Example** ```ts -context.getGroupDir("1", (err, data) => { - if (err) { - console.error('getGroupDir faile, err: ${JSON.stringify(err)}'); - } else { - console.log('getGroupDir result is: ${JSON.stringify(data)}'); - } +let getGroupDirContext: common.Context; + +getGroupDirContext.getGroupDir("1", (err, data) => { + if (err) { + console.error('getGroupDir faile, err: ${JSON.stringify(err)}'); + } else { + console.log('getGroupDir result is: ${JSON.stringify(data)}'); + } }); ``` diff --git a/en/application-dev/reference/apis/js-apis-inner-application-continuableInfo.md b/en/application-dev/reference/apis/js-apis-inner-application-continuableInfo.md index f82aebadfdc9a1cc8e9acd4334a32e4ca58ec048..79dfc7c9b9a0d9b9d082fc38d06e75cb1d09b6a1 100644 --- a/en/application-dev/reference/apis/js-apis-inner-application-continuableInfo.md +++ b/en/application-dev/reference/apis/js-apis-inner-application-continuableInfo.md @@ -13,6 +13,8 @@ The **ContinuableInfo** module provides the mission continuation information to import distributedMissionManager from '@ohos.distributedMissionManager'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.Mission | Name | Type | Readable | Writable | Description | diff --git a/en/application-dev/reference/apis/js-apis-inner-application-continueDeviceInfo.md b/en/application-dev/reference/apis/js-apis-inner-application-continueDeviceInfo.md index f3ceddab5232e926724fce0e2e91c8630aa97c68..d60982e02eb139d5877f0e418f72af4ff6691e0e 100644 --- a/en/application-dev/reference/apis/js-apis-inner-application-continueDeviceInfo.md +++ b/en/application-dev/reference/apis/js-apis-inner-application-continueDeviceInfo.md @@ -6,8 +6,12 @@ The **ContinueDeviceInfo** module defines the parameters required for initiating > > The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.Mission +**System API**: This is a system API and cannot be called by third-party applications. + | Name | Type | Readable | Writable | Description | | -------- | ------ | ---- | ---- | ------- | | srcDeviceId | string | Yes | Yes | ID of the source device.| diff --git a/en/application-dev/reference/apis/js-apis-inner-application-continueMissionInfo.md b/en/application-dev/reference/apis/js-apis-inner-application-continueMissionInfo.md index 40b6e6f28b9bc6dddd2abbc5ace156662a7e9784..79baeb009554b5c33cdd9420939b7df37e4b6af2 100644 --- a/en/application-dev/reference/apis/js-apis-inner-application-continueMissionInfo.md +++ b/en/application-dev/reference/apis/js-apis-inner-application-continueMissionInfo.md @@ -13,6 +13,8 @@ The **ContinueMissionInfo** module defines the parameters required for initiatin import distributedMissionManager from '@ohos.distributedMissionManager'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.Mission | Name | Type | Readable | Writable | Description | @@ -20,7 +22,7 @@ import distributedMissionManager from '@ohos.distributedMissionManager'; | srcDeviceId | string | Yes | Yes | ID of the source device.| | dstDeviceId | string | Yes | Yes | ID of the target device.| | bundleName | string | Yes | Yes | Name of the bundle to which the mission belongs.| -| wantParam | {[key: string]: any} | Yes | Yes | Extended parameters.| +| wantParam | {[key: string]: Object} | Yes | Yes | Extended parameters.| **Example** diff --git a/en/application-dev/reference/apis/js-apis-inner-application-missionInfo.md b/en/application-dev/reference/apis/js-apis-inner-application-missionInfo.md index 721eafcce7ed260717e5fe8e3d4847a39bf7daf9..42d6acfa7fbae8a6c661a6b4a341b6c54d46bc06 100644 --- a/en/application-dev/reference/apis/js-apis-inner-application-missionInfo.md +++ b/en/application-dev/reference/apis/js-apis-inner-application-missionInfo.md @@ -12,6 +12,8 @@ The **MissionInfo** module defines detailed information about a mission. The inf import missionManager from '@ohos.app.ability.missionManager'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.Mission **System API**: This is a system API and cannot be called by third-party applications. @@ -26,6 +28,7 @@ import missionManager from '@ohos.app.ability.missionManager'; | label | string | Yes| Yes| Label of the mission.| | iconPath | string | Yes| Yes| Path of the mission icon.| | continuable | boolean | Yes| Yes| Whether the mission can be continued on another device.| +| abilityState | number | Yes| Yes| Capability status of the mission.| | unclearable10+ | boolean | Yes| Yes| Whether the mission can be manually deleted.| **Example** diff --git a/en/application-dev/reference/apis/js-apis-inner-application-missionListener.md b/en/application-dev/reference/apis/js-apis-inner-application-missionListener.md index 4dfb8ed40af7b3198d395fc3f1ddbb2e369077e7..df5d42fc2be56ea3d970c3020c6bc97211908722 100644 --- a/en/application-dev/reference/apis/js-apis-inner-application-missionListener.md +++ b/en/application-dev/reference/apis/js-apis-inner-application-missionListener.md @@ -12,8 +12,12 @@ The **MissionListener** module defines the listeners used to observe the mission import missionManager from '@ohos.app.ability.missionManager'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.Mission +**System API**: This is a system API and cannot be called by third-party applications. + | Name | Type | Mandatory| Description | | ----------- | -------- | ---- | ------------------------------------------------------------ | | onMissionCreated | function | No | Called when the system creates a mission. | diff --git a/en/application-dev/reference/apis/js-apis-inner-application-missionSnapshot.md b/en/application-dev/reference/apis/js-apis-inner-application-missionSnapshot.md index cb4cb0bd726b76f628eff2f3ae065217981f8f18..cd3b7b3b918e9d3c58a54ac984dfe5090953614c 100644 --- a/en/application-dev/reference/apis/js-apis-inner-application-missionSnapshot.md +++ b/en/application-dev/reference/apis/js-apis-inner-application-missionSnapshot.md @@ -13,6 +13,8 @@ The **MissionSnapshot** module defines the snapshot of a mission. The snapshot c import missionManager from '@ohos.app.ability.missionManager'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.Mission | Name| Type| Readable| Writable| Description| diff --git a/en/application-dev/reference/apis/js-apis-inner-application-processData.md b/en/application-dev/reference/apis/js-apis-inner-application-processData.md index 16427a352dc32cca383fdca9e6615b08b602a3f0..0fc3378b982e8d2be52360c70964739087c281fb 100644 --- a/en/application-dev/reference/apis/js-apis-inner-application-processData.md +++ b/en/application-dev/reference/apis/js-apis-inner-application-processData.md @@ -12,6 +12,8 @@ The **ProcessData** module defines process data. If a lifecycle change listener import appManager from '@ohos.application.appManager'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.Core **System API**: This is a system API and cannot be called by third-party applications. diff --git a/en/application-dev/reference/apis/js-apis-inner-application-serviceExtensionContext.md b/en/application-dev/reference/apis/js-apis-inner-application-serviceExtensionContext.md index 72d7ba8418203cf82a1f61518868398193f20f0c..5d20e8796f0cf1e4b865bffe7a36087875c2390d 100644 --- a/en/application-dev/reference/apis/js-apis-inner-application-serviceExtensionContext.md +++ b/en/application-dev/reference/apis/js-apis-inner-application-serviceExtensionContext.md @@ -1102,6 +1102,7 @@ Connects this ability to a ServiceExtensionAbility. | 16000001 | The specified ability does not exist. | | 16000002 | Incorrect ability type. | | 16000004 | Can not start invisible component. | +| 16000005 | The specified process does not have the permission. | | 16000006 | Cross-user operations are not allowed. | | 16000008 | The crowdtesting application expires. | | 16000053 | The ability is not on the top of the UI. | @@ -1169,6 +1170,7 @@ Uses the **AbilityInfo.AbilityType.SERVICE** template and account ID to connect | 16000001 | The specified ability does not exist. | | 16000002 | Incorrect ability type. | | 16000004 | Can not start invisible component. | +| 16000005 | The specified process does not have the permission. | | 16000006 | Cross-user operations are not allowed. | | 16000008 | The crowdtesting application expires. | | 16000053 | The ability is not on the top of the UI. | diff --git a/en/application-dev/reference/apis/js-apis-inner-application-shellCmdResult.md b/en/application-dev/reference/apis/js-apis-inner-application-shellCmdResult.md index 1692916d936d2688792a9a793f75bb4855e215a3..cb77559481674a6ed1e1958ce11195ebf0c952d6 100644 --- a/en/application-dev/reference/apis/js-apis-inner-application-shellCmdResult.md +++ b/en/application-dev/reference/apis/js-apis-inner-application-shellCmdResult.md @@ -12,6 +12,8 @@ The **ShellCmdResult** module provides the shell command execution result. import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.Core | Name | Type | Readable| Writable| Description | diff --git a/en/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md b/en/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md index c3e911f3e701d912996c761ca646c9dd178c4333..d4631ab32d661917983f344e6e80afd3059d90ae 100644 --- a/en/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md +++ b/en/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md @@ -116,7 +116,6 @@ Observe the following when using this API: **Error codes** -| ID | Error Message | | ID| Error Message| | ------- | -------------------------------- | | 16000001 | The specified ability does not exist. | @@ -276,6 +275,8 @@ Observe the following when using this API: | 16000009 | An ability cannot be started or stopped in Wukong mode. | | 16000010 | The call with the continuation flag is forbidden. | | 16000011 | The context does not exist. | +| 16000012 | The application is controlled. | +| 16000013 | The application is controlled by EDM. | | 16000050 | Internal error. | | 16000053 | The ability is not on the top of the UI. | | 16000055 | Installation-free timed out. | @@ -345,6 +346,8 @@ Observe the following when using this API: | 16000009 | An ability cannot be started or stopped in Wukong mode. | | 16000010 | The call with the continuation flag is forbidden. | | 16000011 | The context does not exist. | +| 16000012 | The application is controlled. | +| 16000013 | The application is controlled by EDM. | | 16000050 | Internal error. | | 16000053 | The ability is not on the top of the UI. | | 16000055 | Installation-free timed out. | @@ -424,6 +427,8 @@ Observe the following when using this API: | 16000009 | An ability cannot be started or stopped in Wukong mode. | | 16000010 | The call with the continuation flag is forbidden. | | 16000011 | The context does not exist. | +| 16000012 | The application is controlled. | +| 16000013 | The application is controlled by EDM. | | 16000050 | Internal error. | | 16000053 | The ability is not on the top of the UI. | | 16000055 | Installation-free timed out. | @@ -979,6 +984,7 @@ Stops a ServiceExtensionAbility in the same application. This API uses an asynch | ------- | -------------------------------- | | 16000001 | The specified ability does not exist. | | 16000002 | Incorrect ability type. | +| 16000004 | Can not start invisible component. | | 16000005 | The specified process does not have the permission. | | 16000006 | Cross-user operations are not allowed. | | 16000011 | The context does not exist. | @@ -1040,8 +1046,6 @@ Stops a ServiceExtensionAbility in the same application. This API uses a promise | 16000005 | The specified process does not have the permission. | | 16000006 | Cross-user operations are not allowed. | | 16000011 | The context does not exist. | -| 16000012 | The application is controlled. | -| 16000013 | The application is controlled by EDM. | | 16000050 | Internal error. | | 16200001 | The caller has been released. | @@ -1445,6 +1449,7 @@ Connects this ability to an ability that uses the **AbilityInfo.AbilityType.SERV | 16000001 | The specified ability does not exist. | | 16000002 | Incorrect ability type. | | 16000004 | Can not start invisible component. | +| 16000005 | The specified process does not have the permission. | | 16000006 | Cross-user operations are not allowed. | | 16000008 | The crowdtesting application expires. | | 16000053 | The ability is not on the top of the UI. | @@ -2226,7 +2231,7 @@ Sets the mission continuation state of this UIAbility. This API uses an asynchro | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| state | [ContinueState](js-apis-app-ability-abilityConstant.md#abilityconstantcontinuestate10) | Yes| Mission continuation state.| +| state | [AbilityConstant.ContinueState](js-apis-app-ability-abilityConstant.md#abilityconstantcontinuestate10) | Yes| Mission continuation state.| | callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Error codes** @@ -2260,7 +2265,7 @@ Sets the mission continuation state of this UIAbility. This API uses a promise t | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| state | [ContinueState](js-apis-app-ability-abilityConstant.md#abilityconstantcontinuestate10) | Yes| Mission continuation state.| +| state | [AbilityConstant.ContinueState](js-apis-app-ability-abilityConstant.md#abilityconstantcontinuestate10) | Yes| Mission continuation state.| **Return value** @@ -2787,9 +2792,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error } ``` -## UIAbilityContext.reportDrawnCompleted +## UIAbilityContext.reportDrawnCompleted10+ -reportDrawnCompleted(callback: AsyncCallback): void; +reportDrawnCompleted(callback: AsyncCallback\): void; Reports an event indicating that page loading is complete (**loadContent()** is successfully called). This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Ability.AbilityRuntime.Core @@ -2812,26 +2817,31 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error **Example** ```ts -onWindowStageCreate(windowStage: Window.WindowStage) { +import UIAbility from '@ohos.app.ability.UIAbility'; +import window from '@ohos.window'; + +export default class EntryAbility extends UIAbility { + onWindowStageCreate(windowStage: window.WindowStage) { windowStage.loadContent('pages/Index', (err, data) => { - if (err.code) { - return; - } - try { - this.context.reportDrawnCompleted((err) => { - if (err.code) { - // Process service logic errors. - console.error(`reportDrawnCompleted failed, code is ${err.code}, message is ${err.message}`); - return; - } - // Carry out normal service processing. - console.info('reportDrawnCompleted succeed'); - }); - } catch (err) { - // Capture the synchronization parameter error. + if (err.code) { + return; + } + try { + this.context.reportDrawnCompleted((err) => { + if (err.code) { + // Process service logic errors. console.error(`reportDrawnCompleted failed, code is ${err.code}, message is ${err.message}`); - } + return; + } + // Carry out normal service processing. + console.info('reportDrawnCompleted succeed'); + }); + } catch (err) { + // Capture the synchronization parameter error. + console.error(`reportDrawnCompleted failed, code is ${err.code}, message is ${err.message}`); + } }); console.log("MainAbility onWindowStageCreate") -} + } +}; ``` diff --git a/en/application-dev/reference/apis/js-apis-inner-wantAgent-triggerInfo.md b/en/application-dev/reference/apis/js-apis-inner-wantAgent-triggerInfo.md index 6b90099bbdef7f61042528281dc947b6fdc43c92..b8d7249b11d6065193bf9bce515d5ff70305a5f8 100644 --- a/en/application-dev/reference/apis/js-apis-inner-wantAgent-triggerInfo.md +++ b/en/application-dev/reference/apis/js-apis-inner-wantAgent-triggerInfo.md @@ -12,6 +12,8 @@ The **TriggerInfo** module defines the information required for triggering the W import wantAgent from '@ohos.app.ability.wantAgent'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.Core | Name | Type | Mandatory| Description | diff --git a/en/application-dev/reference/apis/js-apis-inner-wantAgent-wantAgentInfo.md b/en/application-dev/reference/apis/js-apis-inner-wantAgent-wantAgentInfo.md index 1673db7dc02a2ed297718bf6eeb67e2adb89c90f..f30cd49eedc9063a10aacbaffa55ac5e74afc52b 100644 --- a/en/application-dev/reference/apis/js-apis-inner-wantAgent-wantAgentInfo.md +++ b/en/application-dev/reference/apis/js-apis-inner-wantAgent-wantAgentInfo.md @@ -12,6 +12,8 @@ The **WantAgentInfo** module defines the information required for triggering a * import wantAgent from '@ohos.app.ability.wantAgent'; ``` +## Attributes + **System capability**: SystemCapability.Ability.AbilityRuntime.Core | Name | Type | Mandatory| Description |