未验证 提交 98988e7d 编写于 作者: O openharmony_ci 提交者: Gitee

!21493 翻译完成:20597+21011+19840+20325+21047++20795 【资料问题】vod问题处理

Merge pull request !21493 from wusongqing/TR20597
...@@ -13,6 +13,8 @@ The **Ability** module provides all level-2 module APIs for developers to export ...@@ -13,6 +13,8 @@ The **Ability** module provides all level-2 module APIs for developers to export
import ability from '@ohos.ability.ability'; import ability from '@ohos.ability.ability';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityBase **System capability**: SystemCapability.Ability.AbilityBase
| Name | Type | Description | | Name | Type | Description |
......
# @ohos.app.ability.appManager (appManager) # @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** > **NOTE**
> >
...@@ -22,9 +22,9 @@ Checks whether this application is undergoing a stability test. This API uses an ...@@ -22,9 +22,9 @@ Checks whether this application is undergoing a stability test. This API uses an
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | 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. | | 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** **Error codes**
...@@ -41,9 +41,9 @@ import appManager from '@ohos.app.ability.appManager'; ...@@ -41,9 +41,9 @@ import appManager from '@ohos.app.ability.appManager';
appManager.isRunningInStabilityTest((err, flag) => { appManager.isRunningInStabilityTest((err, flag) => {
if (err) { if (err) {
console.error('isRunningInStabilityTest fail, err: ${JSON.stringify(err)}'); console.error(`isRunningInStabilityTest fail, err: ${JSON.stringify(err)}`);
} else { } 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 ...@@ -59,9 +59,9 @@ Checks whether this application is undergoing a stability test. This API uses a
**Return value** **Return value**
| Type| Description| | 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.| | 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** **Error codes**
...@@ -77,9 +77,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error ...@@ -77,9 +77,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
import appManager from '@ohos.app.ability.appManager'; import appManager from '@ohos.app.ability.appManager';
appManager.isRunningInStabilityTest().then((flag) => { 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) => { }).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 ...@@ -94,9 +94,9 @@ Checks whether this application is running on a RAM constrained device. This API
**Return value** **Return value**
| Type| Description| | 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.| | 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** **Error codes**
...@@ -112,9 +112,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error ...@@ -112,9 +112,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
import appManager from '@ohos.app.ability.appManager'; import appManager from '@ohos.app.ability.appManager';
appManager.isRamConstrainedDevice().then((data) => { 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) => { }).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 ...@@ -128,9 +128,9 @@ Checks whether this application is running on a RAM constrained device. This API
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | 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. | | 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** **Error codes**
...@@ -147,9 +147,9 @@ import appManager from '@ohos.app.ability.appManager'; ...@@ -147,9 +147,9 @@ import appManager from '@ohos.app.ability.appManager';
appManager.isRamConstrainedDevice((err, data) => { appManager.isRamConstrainedDevice((err, data) => {
if (err) { if (err) {
console.error('isRamConstrainedDevice fail, err: ${JSON.stringify(err)}'); console.error(`isRamConstrainedDevice fail, err: ${JSON.stringify(err)}`);
} else { } 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) => { ...@@ -158,15 +158,15 @@ appManager.isRamConstrainedDevice((err, data) => {
getAppMemorySize(): Promise\<number>; getAppMemorySize(): Promise\<number>;
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 **System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;number&gt; | Promise used to return the API call result and the memory size. You can perform error handling or custom processing in this callback.| | Promise&lt;number&gt; | 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** **Error codes**
...@@ -182,9 +182,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error ...@@ -182,9 +182,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
import appManager from '@ohos.app.ability.appManager'; import appManager from '@ohos.app.ability.appManager';
appManager.getAppMemorySize().then((data) => { 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) => { }).catch((error) => {
console.error('error: ${JSON.stringify(error)}'); console.error(`error: ${JSON.stringify(error)}`);
}); });
``` ```
...@@ -192,15 +192,15 @@ appManager.getAppMemorySize().then((data) => { ...@@ -192,15 +192,15 @@ appManager.getAppMemorySize().then((data) => {
getAppMemorySize(callback: AsyncCallback\<number>): void; getAppMemorySize(callback: AsyncCallback\<number>): 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 **System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;number&gt; | Yes|Callback used to return the API call result and the memory size. You can perform error handling or custom processing in this callback.| | callback | AsyncCallback&lt;number&gt; | 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** **Error codes**
...@@ -217,9 +217,9 @@ import appManager from '@ohos.app.ability.appManager'; ...@@ -217,9 +217,9 @@ import appManager from '@ohos.app.ability.appManager';
appManager.getAppMemorySize((err, data) => { appManager.getAppMemorySize((err, data) => {
if (err) { if (err) {
console.error('getAppMemorySize fail, err: ${JSON.stringify(err)}'); console.error(`getAppMemorySize fail, err: ${JSON.stringify(err)}`);
} else { } 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 ...@@ -254,9 +254,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
import appManager from '@ohos.app.ability.appManager'; import appManager from '@ohos.app.ability.appManager';
appManager.getRunningProcessInformation().then((data) => { 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) => { }).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 ...@@ -272,9 +272,9 @@ Obtains information about the running processes. This API uses an asynchronous c
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback\<Array\<[ProcessInformation](js-apis-inner-application-processInformation.md)>> | 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.| | callback | AsyncCallback\<Array\<[ProcessInformation](js-apis-inner-application-processInformation.md)>> | 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** **Error codes**
...@@ -291,9 +291,9 @@ import appManager from '@ohos.app.ability.appManager'; ...@@ -291,9 +291,9 @@ import appManager from '@ohos.app.ability.appManager';
appManager.getRunningProcessInformation((err, data) => { appManager.getRunningProcessInformation((err, data) => {
if (err) { if (err) {
console.error('getRunningProcessInformation fail, err: ${JSON.stringify(err)}'); console.error(`getRunningProcessInformation fail, err: ${JSON.stringify(err)}`);
} else { } 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'; ...@@ -339,9 +339,9 @@ import appManager from '@ohos.app.ability.appManager';
const bundleName = "this is a bundleName"; const bundleName = "this is a bundleName";
const versionCode = 1; const versionCode = 1;
appManager.isSharedBundleRunning(bundleName, versionCode).then((data) => { 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) => { }).catch((error) => {
console.error('error: ${JSON.stringify(error)}'); console.error(`error: ${JSON.stringify(error)}`);
}); });
``` ```
...@@ -382,9 +382,9 @@ const bundleName = "this is a bundleName"; ...@@ -382,9 +382,9 @@ const bundleName = "this is a bundleName";
const versionCode = 1; const versionCode = 1;
appManager.isSharedBundleRunning(bundleName, versionCode, (err, data) => { appManager.isSharedBundleRunning(bundleName, versionCode, (err, data) => {
if (err) { if (err) {
console.error('err: ${JSON.stringify(err)}'); console.error(`err: ${JSON.stringify(err)}`);
} else { } 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 { ...@@ -581,7 +581,7 @@ try {
// 2. Deregister the application state observer. // 2. Deregister the application state observer.
function unregisterApplicationStateObserverCallback(err) { function unregisterApplicationStateObserverCallback(err) {
if (err) { if (err) {
console.error('unregisterApplicationStateObserverCallback fail, err: ${JSON.stringify(err)}'); console.error(`unregisterApplicationStateObserverCallback fail, err: ${JSON.stringify(err)}`);
} else { } else {
console.log('unregisterApplicationStateObserverCallback success.'); console.log('unregisterApplicationStateObserverCallback success.');
} }
...@@ -589,7 +589,7 @@ function unregisterApplicationStateObserverCallback(err) { ...@@ -589,7 +589,7 @@ function unregisterApplicationStateObserverCallback(err) {
try { try {
appManager.off('applicationState', observerId, unregisterApplicationStateObserverCallback); appManager.off('applicationState', observerId, unregisterApplicationStateObserverCallback);
} catch (paramError) { } catch (paramError) {
console.error('error: ${paramError.code}, ${paramError.message}'); console.error(`error: ${paramError.code}, ${paramError.message}`);
} }
``` ```
...@@ -662,12 +662,12 @@ try { ...@@ -662,12 +662,12 @@ try {
// 2. Deregister the application state observer. // 2. Deregister the application state observer.
try { try {
appManager.off('applicationState', observerId).then((data) => { appManager.off('applicationState', observerId).then((data) => {
console.log('unregisterApplicationStateObserver success, data: ${JSON.stringify(data)}'); console.log(`unregisterApplicationStateObserver success, data: ${JSON.stringify(data)}`);
}).catch((err) => { }).catch((err) => {
console.error('unregisterApplicationStateObserver fail, err: ${JSON.stringify(err)}'); console.error(`unregisterApplicationStateObserver fail, err: ${JSON.stringify(err)}`);
}); });
} catch (paramError) { } 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'; ...@@ -704,15 +704,15 @@ import appManager from '@ohos.app.ability.appManager';
function getForegroundApplicationsCallback(err, data) { function getForegroundApplicationsCallback(err, data) {
if (err) { if (err) {
console.error('getForegroundApplicationsCallback fail, err: ${JSON.stringify(err)}'); console.error(`getForegroundApplicationsCallback fail, err: ${JSON.stringify(err)}`);
} else { } else {
console.log('getForegroundApplicationsCallback success, data: ${JSON.stringify(data)}'); console.log(`getForegroundApplicationsCallback success, data: ${JSON.stringify(data)}`);
} }
} }
try { try {
appManager.getForegroundApplications(getForegroundApplicationsCallback); appManager.getForegroundApplications(getForegroundApplicationsCallback);
} catch (paramError) { } 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 ...@@ -748,9 +748,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
import appManager from '@ohos.app.ability.appManager'; import appManager from '@ohos.app.ability.appManager';
appManager.getForegroundApplications().then((data) => { appManager.getForegroundApplications().then((data) => {
console.log('getForegroundApplications success, data: ${JSON.stringify(data)}'); console.log(`getForegroundApplications success, data: ${JSON.stringify(data)}`);
}).catch((err) => { }).catch((err) => {
console.error('getForegroundApplications fail, err: ${JSON.stringify(err)}'); console.error(`getForegroundApplications fail, err: ${JSON.stringify(err)}`);
}); });
``` ```
...@@ -796,10 +796,10 @@ try { ...@@ -796,10 +796,10 @@ try {
appManager.killProcessWithAccount(bundleName, accountId).then(() => { appManager.killProcessWithAccount(bundleName, accountId).then(() => {
console.log('killProcessWithAccount success'); console.log('killProcessWithAccount success');
}).catch((err) => { }).catch((err) => {
console.error('killProcessWithAccount fail, err: ${JSON.stringify(err)}'); console.error(`killProcessWithAccount fail, err: ${JSON.stringify(err)}`);
}); });
} catch (paramError) { } 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 ...@@ -822,11 +822,11 @@ Kills a process by bundle name and account ID. This API uses an asynchronous cal
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| bundleName | string | Yes| Bundle name.| | bundleName | string | Yes| Bundle name.|
| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).| | accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
| callback | AsyncCallback\<void\> | Yes| Callback used to return the API call result. You can perform error handling or custom processing in this callback.| | callback | AsyncCallback\<void\> | Yes| Callback used to return the API call result. You can perform error handling or custom processing in this callback.|
**Error codes** **Error codes**
...@@ -845,7 +845,7 @@ let bundleName = 'bundleName'; ...@@ -845,7 +845,7 @@ let bundleName = 'bundleName';
let accountId = 0; let accountId = 0;
function killProcessWithAccountCallback(err, data) { function killProcessWithAccountCallback(err, data) {
if (err) { if (err) {
console.error('killProcessWithAccountCallback fail, err: ${JSON.stringify(err)}'); console.error(`killProcessWithAccountCallback fail, err: ${JSON.stringify(err)}`);
} else { } else {
console.log('killProcessWithAccountCallback success.'); console.log('killProcessWithAccountCallback success.');
} }
...@@ -888,7 +888,7 @@ import appManager from '@ohos.app.ability.appManager'; ...@@ -888,7 +888,7 @@ import appManager from '@ohos.app.ability.appManager';
let bundleName = 'bundleName'; let bundleName = 'bundleName';
function killProcessesByBundleNameCallback(err, data) { function killProcessesByBundleNameCallback(err, data) {
if (err) { if (err) {
console.error('killProcessesByBundleNameCallback fail, err: ${JSON.stringify(err)}'); console.error(`killProcessesByBundleNameCallback fail, err: ${JSON.stringify(err)}`);
} else { } else {
console.log('killProcessesByBundleNameCallback success.'); console.log('killProcessesByBundleNameCallback success.');
} }
...@@ -896,7 +896,7 @@ function killProcessesByBundleNameCallback(err, data) { ...@@ -896,7 +896,7 @@ function killProcessesByBundleNameCallback(err, data) {
try { try {
appManager.killProcessesByBundleName(bundleName, killProcessesByBundleNameCallback); appManager.killProcessesByBundleName(bundleName, killProcessesByBundleNameCallback);
} catch (paramError) { } catch (paramError) {
console.error('error: ${paramError.code}, ${paramError.message}'); console.error(`error: ${paramError.code}, ${paramError.message}`);
} }
``` ```
...@@ -942,10 +942,10 @@ try { ...@@ -942,10 +942,10 @@ try {
appManager.killProcessesByBundleName(bundleName).then((data) => { appManager.killProcessesByBundleName(bundleName).then((data) => {
console.log('killProcessesByBundleName success.'); console.log('killProcessesByBundleName success.');
}).catch((err) => { }).catch((err) => {
console.error('killProcessesByBundleName fail, err: ${JSON.stringify(err)}'); console.error(`killProcessesByBundleName fail, err: ${JSON.stringify(err)}`);
}); });
} catch (paramError) { } 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'; ...@@ -984,7 +984,7 @@ import appManager from '@ohos.app.ability.appManager';
let bundleName = 'bundleName'; let bundleName = 'bundleName';
function clearUpApplicationDataCallback(err, data) { function clearUpApplicationDataCallback(err, data) {
if (err) { if (err) {
console.error('clearUpApplicationDataCallback fail, err: ${JSON.stringify(err)}'); console.error(`clearUpApplicationDataCallback fail, err: ${JSON.stringify(err)}`);
} else { } else {
console.log('clearUpApplicationDataCallback success.'); console.log('clearUpApplicationDataCallback success.');
} }
...@@ -992,7 +992,7 @@ function clearUpApplicationDataCallback(err, data) { ...@@ -992,7 +992,7 @@ function clearUpApplicationDataCallback(err, data) {
try { try {
appManager.clearUpApplicationData(bundleName, clearUpApplicationDataCallback); appManager.clearUpApplicationData(bundleName, clearUpApplicationDataCallback);
} catch (paramError) { } catch (paramError) {
console.error('error: ${paramError.code}, ${paramError.message}'); console.error(`error: ${paramError.code}, ${paramError.message}`);
} }
``` ```
...@@ -1038,10 +1038,10 @@ try { ...@@ -1038,10 +1038,10 @@ try {
appManager.clearUpApplicationData(bundleName).then((data) => { appManager.clearUpApplicationData(bundleName).then((data) => {
console.log('clearUpApplicationData success.'); console.log('clearUpApplicationData success.');
}).catch((err) => { }).catch((err) => {
console.error('clearUpApplicationData fail, err: ${JSON.stringify(err)}'); console.error(`clearUpApplicationData fail, err: ${JSON.stringify(err)}`);
}); });
} catch (paramError) { } catch (paramError) {
console.error('error: ${paramError.code}, ${paramError.message}'); console.error(`error: ${paramError.code}, ${paramError.message}`);
} }
``` ```
...@@ -1049,7 +1049,7 @@ try { ...@@ -1049,7 +1049,7 @@ try {
getProcessMemoryByPid(pid: number, callback: AsyncCallback\<number>): void; getProcessMemoryByPid(pid: number, callback: AsyncCallback\<number>): 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 **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -1078,7 +1078,7 @@ import appManager from '@ohos.app.ability.appManager'; ...@@ -1078,7 +1078,7 @@ import appManager from '@ohos.app.ability.appManager';
let pid = 0; let pid = 0;
function getProcessMemoryByPidCallback(err, data) { function getProcessMemoryByPidCallback(err, data) {
if (err) { if (err) {
console.error('getProcessMemoryByPidCallback fail, err: ${JSON.stringify(err)}'); console.error(`getProcessMemoryByPidCallback fail, err: ${JSON.stringify(err)}`);
} else { } else {
console.log('getProcessMemoryByPidCallback success.'); console.log('getProcessMemoryByPidCallback success.');
} }
...@@ -1086,7 +1086,7 @@ function getProcessMemoryByPidCallback(err, data) { ...@@ -1086,7 +1086,7 @@ function getProcessMemoryByPidCallback(err, data) {
try { try {
appManager.getProcessMemoryByPid(pid, getProcessMemoryByPidCallback); appManager.getProcessMemoryByPid(pid, getProcessMemoryByPidCallback);
} catch (paramError) { } catch (paramError) {
console.error('error: ${paramError.code}, ${paramError.message}'); console.error(`error: ${paramError.code}, ${paramError.message}`);
} }
``` ```
...@@ -1094,7 +1094,7 @@ try { ...@@ -1094,7 +1094,7 @@ try {
getProcessMemoryByPid(pid: number): Promise\<number>; getProcessMemoryByPid(pid: number): Promise\<number>;
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 **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -1130,10 +1130,10 @@ try { ...@@ -1130,10 +1130,10 @@ try {
appManager.getProcessMemoryByPid(pid).then((data) => { appManager.getProcessMemoryByPid(pid).then((data) => {
console.log('getProcessMemoryByPid success.'); console.log('getProcessMemoryByPid success.');
}).catch((err) => { }).catch((err) => {
console.error('getProcessMemoryByPid fail, err: ${JSON.stringify(err)}'); console.error(`getProcessMemoryByPid fail, err: ${JSON.stringify(err)}`);
}); });
} catch (paramError) { } 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'; ...@@ -1170,7 +1170,7 @@ import appManager from '@ohos.app.ability.appManager';
let bundleName = "bundleName"; let bundleName = "bundleName";
function getRunningProcessInfoByBundleNameCallback(err, data) { function getRunningProcessInfoByBundleNameCallback(err, data) {
if (err) { if (err) {
console.error('getRunningProcessInfoByBundleNameCallback fail, err: ${JSON.stringify(err)}'); console.error(`getRunningProcessInfoByBundleNameCallback fail, err: ${JSON.stringify(err)}`);
} else { } else {
console.log('getRunningProcessInfoByBundleNameCallback success.'); console.log('getRunningProcessInfoByBundleNameCallback success.');
} }
...@@ -1178,7 +1178,7 @@ function getRunningProcessInfoByBundleNameCallback(err, data) { ...@@ -1178,7 +1178,7 @@ function getRunningProcessInfoByBundleNameCallback(err, data) {
try { try {
appManager.getRunningProcessInfoByBundleName(bundleName, getRunningProcessInfoByBundleNameCallback); appManager.getRunningProcessInfoByBundleName(bundleName, getRunningProcessInfoByBundleNameCallback);
} catch (paramError) { } catch (paramError) {
console.error('error: ${paramError.code}, ${paramError.message}'); console.error(`error: ${paramError.code}, ${paramError.message}`);
} }
``` ```
...@@ -1222,10 +1222,10 @@ try { ...@@ -1222,10 +1222,10 @@ try {
appManager.getRunningProcessInfoByBundleName(bundleName).then((data) => { appManager.getRunningProcessInfoByBundleName(bundleName).then((data) => {
console.log('getRunningProcessInfoByBundleName success.'); console.log('getRunningProcessInfoByBundleName success.');
}).catch((err) => { }).catch((err) => {
console.error('getRunningProcessInfoByBundleName fail, err: ${JSON.stringify(err)}'); console.error(`getRunningProcessInfoByBundleName fail, err: ${JSON.stringify(err)}`);
}); });
} catch (paramError) { } catch (paramError) {
console.error('error: ${paramError.code}, ${paramError.message}'); console.error(`error: ${paramError.code}, ${paramError.message}`);
} }
``` ```
...@@ -1264,7 +1264,7 @@ let bundleName = "bundleName"; ...@@ -1264,7 +1264,7 @@ let bundleName = "bundleName";
let userId = 0; let userId = 0;
function getRunningProcessInfoByBundleNameCallback(err, data) { function getRunningProcessInfoByBundleNameCallback(err, data) {
if (err) { if (err) {
console.error('getRunningProcessInfoByBundleNameCallback fail, err: ${JSON.stringify(err)}'); console.error(`getRunningProcessInfoByBundleNameCallback fail, err: ${JSON.stringify(err)}`);
} else { } else {
console.log('getRunningProcessInfoByBundleNameCallback success.'); console.log('getRunningProcessInfoByBundleNameCallback success.');
} }
...@@ -1272,7 +1272,7 @@ function getRunningProcessInfoByBundleNameCallback(err, data) { ...@@ -1272,7 +1272,7 @@ function getRunningProcessInfoByBundleNameCallback(err, data) {
try { try {
appManager.getRunningProcessInfoByBundleName(bundleName, userId, getRunningProcessInfoByBundleNameCallback); appManager.getRunningProcessInfoByBundleName(bundleName, userId, getRunningProcessInfoByBundleNameCallback);
} catch (paramError) { } catch (paramError) {
console.error('error: ${paramError.code}, ${paramError.message}'); console.error(`error: ${paramError.code}, ${paramError.message}`);
} }
``` ```
...@@ -1318,10 +1318,10 @@ try { ...@@ -1318,10 +1318,10 @@ try {
appManager.getRunningProcessInfoByBundleName(bundleName, userId).then((data) => { appManager.getRunningProcessInfoByBundleName(bundleName, userId).then((data) => {
console.log('getRunningProcessInfoByBundleName success.'); console.log('getRunningProcessInfoByBundleName success.');
}).catch((err) => { }).catch((err) => {
console.error('getRunningProcessInfoByBundleName fail, err: ${JSON.stringify(err)}'); console.error(`getRunningProcessInfoByBundleName fail, err: ${JSON.stringify(err)}`);
}); });
} catch (paramError) { } catch (paramError) {
console.error('error: ${paramError.code}, ${paramError.message}'); console.error(`error: ${paramError.code}, ${paramError.message}`);
} }
``` ```
......
...@@ -12,8 +12,9 @@ The **Common** module provides all level-2 module APIs for developers to export. ...@@ -12,8 +12,9 @@ The **Common** module provides all level-2 module APIs for developers to export.
```ts ```ts
import common from '@ohos.app.ability.common'; import common from '@ohos.app.ability.common';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityBase **System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name | Type | Description | | Name | Type | Description |
| ----------- | -------------------- | ------------------------------------------------------------ | | ----------- | -------------------- | ------------------------------------------------------------ |
......
...@@ -12,6 +12,8 @@ The **Configuration** module defines environment change information. **Configura ...@@ -12,6 +12,8 @@ The **Configuration** module defines environment change information. **Configura
import Configuration from '@ohos.app.ability.Configuration'; import Configuration from '@ohos.app.ability.Configuration';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityBase **System capability**: SystemCapability.Ability.AbilityBase
| Name| Type| Readable| Writable| Description| | Name| Type| Readable| Writable| Description|
......
...@@ -1098,3 +1098,315 @@ try { ...@@ -1098,3 +1098,315 @@ try {
console.error('moveMissionToFront failed. Cause: ${error.message}'); console.error('moveMissionToFront failed. Cause: ${error.message}');
} }
``` ```
## missionManager.moveMissionsToForeground<sup>10+</sup>
moveMissionsToForeground(missionIds: Array&lt;number&gt;, callback: AsyncCallback&lt;void&gt;): 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&lt;number&gt; | Yes| Array holding the mission IDs.|
| callback | AsyncCallback&lt;void&gt; | 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<number>();
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.moveMissionsToForeground<sup>10+</sup>
moveMissionsToForeground(missionIds: Array&lt;number&gt;, topMission: number, callback: AsyncCallback&lt;void&gt;): 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&lt;number&gt; | Yes| Array holding the mission IDs.|
| topMission | number | Yes| ID of the mission to be moved to the top.|
| callback | AsyncCallback&lt;void&gt; | 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<number>();
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.moveMissionsToForeground<sup>10+</sup>
moveMissionsToForeground(missionIds: Array&lt;number&gt;, topMission?: number): Promise&lt;void&gt; ;
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&lt;number&gt; | Yes| Array holding the mission IDs.|
| topMission | number | No| ID of the mission to be moved to the top.|
**Return value**
| Type| Description|
| -------- | -------- |
| Promise&lt;void&gt; | 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<number>();
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.moveMissionsToBackground<sup>10+</sup>
moveMissionsToBackground(missionIds: Array&lt;number&gt;, callback: AsyncCallback&lt;Array&lt;number&gt;&gt;): 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&lt;number&gt; | Yes| Array holding the mission IDs.|
| callback | AsyncCallback&lt;Array&lt;number&gt;&gt; | 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<number>();
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.moveMissionsToBackground<sup>10+</sup>
moveMissionsToBackground(missionIds : Array&lt;number&gt;): Promise&lt;Array&lt;number&gt;&gt;;
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&lt;number&gt; | Yes| Array holding the mission IDs.|
**Return value**
| Type| Description|
| -------- | -------- |
| Promise&lt;Array&lt;number&gt;&gt; | 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<number>();
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);
}
```
...@@ -64,21 +64,13 @@ Applies a quick fix patch. This API uses an asynchronous callback to return the ...@@ -64,21 +64,13 @@ Applies a quick fix patch. This API uses an asynchronous callback to return the
**Error codes** **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| | ID| Error Message|
| ------- | -------- | | ------- | -------- |
| 18500002 | The specified quick fix is invalid. It may not exist or inaccessible. | | 18500002 | The specified quick fix is invalid. It may not exist or inaccessible. |
| 18500008 | Internal error. | | 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). For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
> **NOTE** > **NOTE**
...@@ -128,21 +120,13 @@ Applies a quick fix patch. This API uses a promise to return the result. ...@@ -128,21 +120,13 @@ Applies a quick fix patch. This API uses a promise to return the result.
**Error codes** **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| | ID| Error Message|
| ------- | -------- | | ------- | -------- |
| 18500002 | The specified quick fix is invalid. It may not exist or inaccessible. | | 18500002 | The specified quick fix is invalid. It may not exist or inaccessible. |
| 18500008 | Internal error. | | 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). For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
...@@ -281,13 +265,7 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error ...@@ -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. | | 18500001 | The bundle is not exist or no patch has applied. |
| 18500009 | The application has a apply quick fix task that is being processed. | | 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. 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).
| ID| Error Message|
| ------- | -------- |
| 18500004 | Switch hqf failed. |
| 18500005 | Delete hqf failed. |
| 18500007 | Unload patch failed. |
**Example** **Example**
......
...@@ -171,6 +171,7 @@ import Want from '@ohos.app.ability.Want'; ...@@ -171,6 +171,7 @@ import Want from '@ohos.app.ability.Want';
```ts ```ts
// (1) UIAbility1 starts a ServiceExtensionAbility. // (1) UIAbility1 starts a ServiceExtensionAbility.
import common from '@ohos.app.ability.common';
let context = getContext(this) as common.UIAbilityContext; // UIAbilityContext let context = getContext(this) as common.UIAbilityContext; // UIAbilityContext
let want = { let want = {
bundleName: 'com.example.myapplication1', bundleName: 'com.example.myapplication1',
......
...@@ -30,6 +30,8 @@ Defines **Params** (specifying the action that can be performed) in the Want. ...@@ -30,6 +30,8 @@ Defines **Params** (specifying the action that can be performed) in the Want.
| CONTENT_TITLE_KEY<sup>10+</sup> | ohos.extra.param.key.contentTitle | Action of sharing the content title. | | CONTENT_TITLE_KEY<sup>10+</sup> | ohos.extra.param.key.contentTitle | Action of sharing the content title. |
| SHARE_ABSTRACT_KEY<sup>10+</sup> | ohos.extra.param.key.shareAbstract | Action of sharing the abstract. | | SHARE_ABSTRACT_KEY<sup>10+</sup> | ohos.extra.param.key.shareAbstract | Action of sharing the abstract. |
| SHARE_URL_KEY<sup>10+</sup> | ohos.extra.param.key.shareUrl | Action of sharing the URL. | | SHARE_URL_KEY<sup>10+</sup> | ohos.extra.param.key.shareUrl | Action of sharing the URL. |
| SUPPORT_CONTINUE_PAGE_STACK_KEY<sup>10+</sup> | 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_KEY<sup>10+</sup> | 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 ## wantConstant.Flags
......
...@@ -75,14 +75,3 @@ try { ...@@ -75,14 +75,3 @@ try {
console.error(`catch error, code: ${error.code}, message: ${error.message}`); 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.|
...@@ -169,6 +169,8 @@ Defines the information about the widget provider. ...@@ -169,6 +169,8 @@ Defines the information about the widget provider.
**System capability**: SystemCapability.Ability.Form **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 | | Name | Type | Readable | Writable | Description |
| ----------- | -------- | -------- | -------------------- | ------------------------------------------------------------ | | ----------- | -------- | -------- | -------------------- | ------------------------------------------------------------ |
| bundleName | string | Yes | No | Name of the bundle to which the widget provider belongs. | | bundleName | string | Yes | No | Name of the bundle to which the widget provider belongs. |
......
...@@ -404,7 +404,7 @@ Kills a process by bundle name and account ID. This API uses a promise to return ...@@ -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. > 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 **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 ...@@ -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. **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** **Parameters**
......
...@@ -26,7 +26,7 @@ For details, see [Permission Levels](../../security/accesstoken-overview.md#perm ...@@ -26,7 +26,7 @@ For details, see [Permission Levels](../../security/accesstoken-overview.md#perm
Enumerates the types of business abilities. 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. **System API**: This is a system API.
...@@ -39,7 +39,7 @@ Enumerates the types of business abilities. ...@@ -39,7 +39,7 @@ Enumerates the types of business abilities.
Describes the criteria for filtering 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. **System API**: This is a system API.
...@@ -57,7 +57,7 @@ Obtains the business ability information based on the specified filter criteria. ...@@ -57,7 +57,7 @@ Obtains the business ability information based on the specified filter criteria.
**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED **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. **System API**: This is a system API.
...@@ -94,7 +94,7 @@ Obtains the business ability information based on the specified filter criteria. ...@@ -94,7 +94,7 @@ Obtains the business ability information based on the specified filter criteria.
**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED **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. **System API**: This is a system API.
......
...@@ -12,9 +12,11 @@ The **AbilityResult** module defines the result code and data returned when an a ...@@ -12,9 +12,11 @@ The **AbilityResult** module defines the result code and data returned when an a
import ability from '@ohos.ability.ability'; import ability from '@ohos.ability.ability';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityBase **System capability**: SystemCapability.Ability.AbilityBase
| Name | Readable | Writable | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | -------- |-------- | -------------------- | ---- | ------------------------------------------------------------ | | ----------- | -------------------- | ---- | ------------------------------------------------------------ |
| resultCode | Yes | Yes | number | Yes | Result code returned after the started ability is terminated. | | resultCode | 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.| | want | [Want](./js-apis-app-ability-want.md) | No | Data returned after the started ability is terminated.|
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
import common from '@ohos.app.ability.common'; import common from '@ohos.app.ability.common';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
......
...@@ -13,6 +13,8 @@ The **DataAbilityOperation** module defines the operation on DataAbilities. It c ...@@ -13,6 +13,8 @@ The **DataAbilityOperation** module defines the operation on DataAbilities. It c
import ability from '@ohos.ability.ability'; import ability from '@ohos.ability.ability';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
| Name | Template | Mandatory| Description | | Name | Template | Mandatory| Description |
......
...@@ -13,6 +13,8 @@ The **DataAbilityResult** module defines the operation result on DataAbilities. ...@@ -13,6 +13,8 @@ The **DataAbilityResult** module defines the operation result on DataAbilities.
import ability from '@ohos.ability.ability'; import ability from '@ohos.ability.ability';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
......
...@@ -13,6 +13,8 @@ The **StartAbilityParameter** module defines the parameters for starting an abil ...@@ -13,6 +13,8 @@ The **StartAbilityParameter** module defines the parameters for starting an abil
import ability from '@ohos.ability.ability'; import ability from '@ohos.ability.ability';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.FAModel **System capability**: SystemCapability.Ability.AbilityRuntime.FAModel
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
......
...@@ -12,6 +12,8 @@ Want is a carrier for information transfer between objects (application componen ...@@ -12,6 +12,8 @@ Want is a carrier for information transfer between objects (application componen
import Want from '@ohos.app.ability.Want'; import Want from '@ohos.app.ability.Want';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityBase **System capability**: SystemCapability.Ability.AbilityBase
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
...@@ -25,7 +27,7 @@ import Want from '@ohos.app.ability.Want'; ...@@ -25,7 +27,7 @@ import Want from '@ohos.app.ability.Want';
| 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). | | 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:<br>- **ohos.aafwk.callerPid**: PID of the caller.<br>- **ohos.aafwk.param.callerToken**: token of the caller.<br>- **ohos.aafwk.param.callerUid**: UID in [bundleInfo](js-apis-bundle-BundleInfo.md#bundleinfo), that is, the application UID in the bundle information.<br>- **component.startup.newRules**: whether to enable the new control rule.<br>- **moduleName**: module name of the caller. No matter what this field is set to, the correct module name will be sent to the peer.<br>- **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:<br>- **ohos.aafwk.callerPid**: PID of the caller.<br>- **ohos.aafwk.param.callerToken**: token of the caller.<br>- **ohos.aafwk.param.callerUid**: UID in [bundleInfo](js-apis-bundle-BundleInfo.md#bundleinfo), that is, the application UID in the bundle information.<br>- **component.startup.newRules**: whether to enable the new control rule.<br>- **moduleName**: module name of the caller. No matter what this field is set to, the correct module name will be sent to the peer.<br>- **ohos.dlp.params.sandbox**: available only for DLP files. |
| entities | Array\<string> | 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). | | entities | Array\<string> | 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). |
| moduleName<sup>9+</sup> | string | No | Module to which the ability belongs.| | moduleName<sup>10+</sup> | string | No | Module to which the ability belongs.|
**Example** **Example**
...@@ -72,6 +74,6 @@ import Want from '@ohos.app.ability.Want'; ...@@ -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).
<!--no_check--> <!--no_check-->
...@@ -12,6 +12,8 @@ The **AppVersionInfo** module defines the application version information. You c ...@@ -12,6 +12,8 @@ The **AppVersionInfo** module defines the application version information. You c
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name | Type | Readable| Writable| Description | | Name | Type | Readable| Writable| Description |
......
...@@ -12,6 +12,8 @@ The **ProcessInfo** module defines process information. You can use [getProcessI ...@@ -12,6 +12,8 @@ The **ProcessInfo** module defines process information. You can use [getProcessI
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name| Type| Readable| Writable| Description| | Name| Type| Readable| Writable| Description|
......
...@@ -1231,7 +1231,7 @@ Waits for an **AbilityStage** instance that matches the conditions set in an **A ...@@ -1231,7 +1231,7 @@ Waits for an **AbilityStage** instance that matches the conditions set in an **A
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| monitor | [AbilityStageMonitor](js-apis-inner-application-abilityStageMonitor.md) | Yes | [AbilityStageMonitor](js-apis-inner-application-abilityStageMonitor.md) instance.| | 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** **Return value**
......
...@@ -6,6 +6,8 @@ The **AbilityStageMonitor** module provides conditions for matching **AbilitySta ...@@ -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. > 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 **System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name | Type | Readable| Writable| Description | | Name | Type | Readable| Writable| Description |
......
...@@ -12,8 +12,12 @@ The **AbilityStateData** module defines the ability state information, which can ...@@ -12,8 +12,12 @@ The **AbilityStateData** module defines the ability state information, which can
import appManager from '@ohos.application.appManager'; import appManager from '@ohos.application.appManager';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **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 | | Name | Type | Readable| Writable| Description |
| ----------------------- | ---------| ---- | ---- | ------------------------- | | ----------------------- | ---------| ---- | ---- | ------------------------- |
| pid | number | Yes | No | Process ID. | | pid | number | Yes | No | Process ID. |
......
...@@ -12,6 +12,8 @@ The **AppStateData** module defines the application state data, which can be obt ...@@ -12,6 +12,8 @@ The **AppStateData** module defines the application state data, which can be obt
import appManager from '@ohos.app.ability.appManager'; import appManager from '@ohos.app.ability.appManager';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This module is marked as @systemapi and not visible to third-party applications. **System API**: This module is marked as @systemapi and not visible to third-party applications.
......
...@@ -12,6 +12,8 @@ The **ApplicationStateObserver** module defines an observer to listen for applic ...@@ -12,6 +12,8 @@ The **ApplicationStateObserver** module defines an observer to listen for applic
import appManager from '@ohos.app.ability.appManager'; import appManager from '@ohos.app.ability.appManager';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications. **System API**: This is a system API and cannot be called by third-party applications.
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
import common from '@ohos.app.ability.common'; import common from '@ohos.app.ability.common';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name | Type | Readable | Writable | Description | | Name | Type | Readable | Writable | Description |
......
...@@ -158,7 +158,7 @@ try { ...@@ -158,7 +158,7 @@ try {
## Context.getGroupDir<sup>10+</sup> ## Context.getGroupDir<sup>10+</sup>
getGroupDir(groupId: string): Promise\<string>; getGroupDir(dataGroupID: string): Promise\<string>;
Obtains the shared directory based on a group ID. This API uses a promise to return the result. 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 ...@@ -168,7 +168,7 @@ Obtains the shared directory based on a group ID. This API uses a promise to ret
| Name | Type | Mandatory | Description | | 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** **Return value**
...@@ -188,16 +188,19 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error ...@@ -188,16 +188,19 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
```ts ```ts
let groupId = "1"; let groupId = "1";
context.getGroupDir(groupId).then(data => { let getGroupDirContext: common.Context;
try {
getGroupDirContext.getGroupDir(groupId).then(data => {
console.log("getGroupDir result:" + 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.getGroupDir<sup>10+</sup> ## Context.getGroupDir<sup>10+</sup>
getGroupDir(groupId: string, callback: AsyncCallback\<string>); getGroupDir(dataGroupID: string, callback: AsyncCallback\<string>);
Obtains the shared directory based on a group ID. This API uses an asynchronous callback to return the result. 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 ...@@ -207,7 +210,7 @@ Obtains the shared directory based on a group ID. This API uses an asynchronous
| Name | Type | Mandatory | Description | | 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\<string> | Yes | Callback used to return the result. If no shared directory exists, null is returned. Only the encryption level EL2 is supported.| | callback | AsyncCallback\<string> | Yes | Callback used to return the result. If no shared directory exists, null is returned. Only the encryption level EL2 is supported.|
**Error codes** **Error codes**
...@@ -221,7 +224,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error ...@@ -221,7 +224,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
**Example** **Example**
```ts ```ts
context.getGroupDir("1", (err, data) => { let getGroupDirContext: common.Context;
getGroupDirContext.getGroupDir("1", (err, data) => {
if (err) { if (err) {
console.error('getGroupDir faile, err: ${JSON.stringify(err)}'); console.error('getGroupDir faile, err: ${JSON.stringify(err)}');
} else { } else {
......
...@@ -13,6 +13,8 @@ The **ContinuableInfo** module provides the mission continuation information to ...@@ -13,6 +13,8 @@ The **ContinuableInfo** module provides the mission continuation information to
import distributedMissionManager from '@ohos.distributedMissionManager'; import distributedMissionManager from '@ohos.distributedMissionManager';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission **System capability**: SystemCapability.Ability.AbilityRuntime.Mission
| Name | Type | Readable | Writable | Description | | Name | Type | Readable | Writable | Description |
......
...@@ -6,8 +6,12 @@ The **ContinueDeviceInfo** module defines the parameters required for initiating ...@@ -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. > 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 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 | | Name | Type | Readable | Writable | Description |
| -------- | ------ | ---- | ---- | ------- | | -------- | ------ | ---- | ---- | ------- |
| srcDeviceId | string | Yes | Yes | ID of the source device.| | srcDeviceId | string | Yes | Yes | ID of the source device.|
......
...@@ -13,6 +13,8 @@ The **ContinueMissionInfo** module defines the parameters required for initiatin ...@@ -13,6 +13,8 @@ The **ContinueMissionInfo** module defines the parameters required for initiatin
import distributedMissionManager from '@ohos.distributedMissionManager'; import distributedMissionManager from '@ohos.distributedMissionManager';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission **System capability**: SystemCapability.Ability.AbilityRuntime.Mission
| Name | Type | Readable | Writable | Description | | Name | Type | Readable | Writable | Description |
...@@ -20,7 +22,7 @@ import distributedMissionManager from '@ohos.distributedMissionManager'; ...@@ -20,7 +22,7 @@ import distributedMissionManager from '@ohos.distributedMissionManager';
| srcDeviceId | string | Yes | Yes | ID of the source device.| | srcDeviceId | string | Yes | Yes | ID of the source device.|
| dstDeviceId | string | Yes | Yes | ID of the target device.| | dstDeviceId | string | Yes | Yes | ID of the target device.|
| bundleName | string | Yes | Yes | Name of the bundle to which the mission belongs.| | 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** **Example**
......
...@@ -12,6 +12,8 @@ The **MissionInfo** module defines detailed information about a mission. The inf ...@@ -12,6 +12,8 @@ The **MissionInfo** module defines detailed information about a mission. The inf
import missionManager from '@ohos.app.ability.missionManager'; import missionManager from '@ohos.app.ability.missionManager';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission **System capability**: SystemCapability.Ability.AbilityRuntime.Mission
**System API**: This is a system API and cannot be called by third-party applications. **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'; ...@@ -26,6 +28,7 @@ import missionManager from '@ohos.app.ability.missionManager';
| label | string | Yes| Yes| Label of the mission.| | label | string | Yes| Yes| Label of the mission.|
| iconPath | string | Yes| Yes| Path of the mission icon.| | iconPath | string | Yes| Yes| Path of the mission icon.|
| continuable | boolean | Yes| Yes| Whether the mission can be continued on another device.| | continuable | boolean | Yes| Yes| Whether the mission can be continued on another device.|
| abilityState | number | Yes| Yes| Capability status of the mission.|
| unclearable<sup>10+</sup> | boolean | Yes| Yes| Whether the mission can be manually deleted.| | unclearable<sup>10+</sup> | boolean | Yes| Yes| Whether the mission can be manually deleted.|
**Example** **Example**
......
...@@ -12,8 +12,12 @@ The **MissionListener** module defines the listeners used to observe the mission ...@@ -12,8 +12,12 @@ The **MissionListener** module defines the listeners used to observe the mission
import missionManager from '@ohos.app.ability.missionManager'; import missionManager from '@ohos.app.ability.missionManager';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission **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 | | Name | Type | Mandatory| Description |
| ----------- | -------- | ---- | ------------------------------------------------------------ | | ----------- | -------- | ---- | ------------------------------------------------------------ |
| onMissionCreated | function | No | Called when the system creates a mission. | | onMissionCreated | function | No | Called when the system creates a mission. |
......
...@@ -13,6 +13,8 @@ The **MissionSnapshot** module defines the snapshot of a mission. The snapshot c ...@@ -13,6 +13,8 @@ The **MissionSnapshot** module defines the snapshot of a mission. The snapshot c
import missionManager from '@ohos.app.ability.missionManager'; import missionManager from '@ohos.app.ability.missionManager';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission **System capability**: SystemCapability.Ability.AbilityRuntime.Mission
| Name| Type| Readable| Writable| Description| | Name| Type| Readable| Writable| Description|
......
...@@ -12,6 +12,8 @@ The **ProcessData** module defines process data. If a lifecycle change listener ...@@ -12,6 +12,8 @@ The **ProcessData** module defines process data. If a lifecycle change listener
import appManager from '@ohos.application.appManager'; import appManager from '@ohos.application.appManager';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
**System API**: This is a system API and cannot be called by third-party applications. **System API**: This is a system API and cannot be called by third-party applications.
......
...@@ -1102,6 +1102,7 @@ Connects this ability to a ServiceExtensionAbility. ...@@ -1102,6 +1102,7 @@ Connects this ability to a ServiceExtensionAbility.
| 16000001 | The specified ability does not exist. | | 16000001 | The specified ability does not exist. |
| 16000002 | Incorrect ability type. | | 16000002 | Incorrect ability type. |
| 16000004 | Can not start invisible component. | | 16000004 | Can not start invisible component. |
| 16000005 | The specified process does not have the permission. |
| 16000006 | Cross-user operations are not allowed. | | 16000006 | Cross-user operations are not allowed. |
| 16000008 | The crowdtesting application expires. | | 16000008 | The crowdtesting application expires. |
| 16000053 | The ability is not on the top of the UI. | | 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 ...@@ -1169,6 +1170,7 @@ Uses the **AbilityInfo.AbilityType.SERVICE** template and account ID to connect
| 16000001 | The specified ability does not exist. | | 16000001 | The specified ability does not exist. |
| 16000002 | Incorrect ability type. | | 16000002 | Incorrect ability type. |
| 16000004 | Can not start invisible component. | | 16000004 | Can not start invisible component. |
| 16000005 | The specified process does not have the permission. |
| 16000006 | Cross-user operations are not allowed. | | 16000006 | Cross-user operations are not allowed. |
| 16000008 | The crowdtesting application expires. | | 16000008 | The crowdtesting application expires. |
| 16000053 | The ability is not on the top of the UI. | | 16000053 | The ability is not on the top of the UI. |
......
...@@ -12,6 +12,8 @@ The **ShellCmdResult** module provides the shell command execution result. ...@@ -12,6 +12,8 @@ The **ShellCmdResult** module provides the shell command execution result.
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name | Type | Readable| Writable| Description | | Name | Type | Readable| Writable| Description |
......
...@@ -116,7 +116,6 @@ Observe the following when using this API: ...@@ -116,7 +116,6 @@ Observe the following when using this API:
**Error codes** **Error codes**
| ID | Error Message |
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 16000001 | The specified ability does not exist. | | 16000001 | The specified ability does not exist. |
...@@ -276,6 +275,8 @@ Observe the following when using this API: ...@@ -276,6 +275,8 @@ Observe the following when using this API:
| 16000009 | An ability cannot be started or stopped in Wukong mode. | | 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. | | 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. | | 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. | | 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. | | 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. | | 16000055 | Installation-free timed out. |
...@@ -345,6 +346,8 @@ Observe the following when using this API: ...@@ -345,6 +346,8 @@ Observe the following when using this API:
| 16000009 | An ability cannot be started or stopped in Wukong mode. | | 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. | | 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. | | 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. | | 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. | | 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. | | 16000055 | Installation-free timed out. |
...@@ -424,6 +427,8 @@ Observe the following when using this API: ...@@ -424,6 +427,8 @@ Observe the following when using this API:
| 16000009 | An ability cannot be started or stopped in Wukong mode. | | 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. | | 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. | | 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. | | 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. | | 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. | | 16000055 | Installation-free timed out. |
...@@ -979,6 +984,7 @@ Stops a ServiceExtensionAbility in the same application. This API uses an asynch ...@@ -979,6 +984,7 @@ Stops a ServiceExtensionAbility in the same application. This API uses an asynch
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 16000001 | The specified ability does not exist. | | 16000001 | The specified ability does not exist. |
| 16000002 | Incorrect ability type. | | 16000002 | Incorrect ability type. |
| 16000004 | Can not start invisible component. |
| 16000005 | The specified process does not have the permission. | | 16000005 | The specified process does not have the permission. |
| 16000006 | Cross-user operations are not allowed. | | 16000006 | Cross-user operations are not allowed. |
| 16000011 | The context does not exist. | | 16000011 | The context does not exist. |
...@@ -1040,8 +1046,6 @@ Stops a ServiceExtensionAbility in the same application. This API uses a promise ...@@ -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. | | 16000005 | The specified process does not have the permission. |
| 16000006 | Cross-user operations are not allowed. | | 16000006 | Cross-user operations are not allowed. |
| 16000011 | The context does not exist. | | 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. | | 16000050 | Internal error. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
...@@ -1445,6 +1449,7 @@ Connects this ability to an ability that uses the **AbilityInfo.AbilityType.SERV ...@@ -1445,6 +1449,7 @@ Connects this ability to an ability that uses the **AbilityInfo.AbilityType.SERV
| 16000001 | The specified ability does not exist. | | 16000001 | The specified ability does not exist. |
| 16000002 | Incorrect ability type. | | 16000002 | Incorrect ability type. |
| 16000004 | Can not start invisible component. | | 16000004 | Can not start invisible component. |
| 16000005 | The specified process does not have the permission. |
| 16000006 | Cross-user operations are not allowed. | | 16000006 | Cross-user operations are not allowed. |
| 16000008 | The crowdtesting application expires. | | 16000008 | The crowdtesting application expires. |
| 16000053 | The ability is not on the top of the UI. | | 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 ...@@ -2226,7 +2231,7 @@ Sets the mission continuation state of this UIAbility. This API uses an asynchro
| Name| Type| Mandatory| Description| | 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&lt;void&gt; | Yes| Callback used to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes| Callback used to return the result.|
**Error codes** **Error codes**
...@@ -2260,7 +2265,7 @@ Sets the mission continuation state of this UIAbility. This API uses a promise t ...@@ -2260,7 +2265,7 @@ Sets the mission continuation state of this UIAbility. This API uses a promise t
| Name| Type| Mandatory| Description| | 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** **Return value**
...@@ -2787,9 +2792,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error ...@@ -2787,9 +2792,9 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
} }
``` ```
## UIAbilityContext.reportDrawnCompleted ## UIAbilityContext.reportDrawnCompleted<sup>10+</sup>
reportDrawnCompleted(callback: AsyncCallback<void>): void; reportDrawnCompleted(callback: AsyncCallback\<void>): void;
Reports an event indicating that page loading is complete (**loadContent()** is successfully called). This API uses an asynchronous callback to return the result. 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 **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -2812,7 +2817,11 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error ...@@ -2812,7 +2817,11 @@ For details about the error codes, see [Ability Error Codes](../errorcodes/error
**Example** **Example**
```ts ```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) => { windowStage.loadContent('pages/Index', (err, data) => {
if (err.code) { if (err.code) {
return; return;
...@@ -2833,5 +2842,6 @@ onWindowStageCreate(windowStage: Window.WindowStage) { ...@@ -2833,5 +2842,6 @@ onWindowStageCreate(windowStage: Window.WindowStage) {
} }
}); });
console.log("MainAbility onWindowStageCreate") console.log("MainAbility onWindowStageCreate")
} }
};
``` ```
...@@ -12,6 +12,8 @@ The **TriggerInfo** module defines the information required for triggering the W ...@@ -12,6 +12,8 @@ The **TriggerInfo** module defines the information required for triggering the W
import wantAgent from '@ohos.app.ability.wantAgent'; import wantAgent from '@ohos.app.ability.wantAgent';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
......
...@@ -12,6 +12,8 @@ The **WantAgentInfo** module defines the information required for triggering a * ...@@ -12,6 +12,8 @@ The **WantAgentInfo** module defines the information required for triggering a *
import wantAgent from '@ohos.app.ability.wantAgent'; import wantAgent from '@ohos.app.ability.wantAgent';
``` ```
## Attributes
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册