You need to sign in or sign up before continuing.
提交 749b8803 编写于 作者: G Gloria

Update docs against 16805+16893+16636+17501+17295+16927

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 148438ff
...@@ -26,7 +26,7 @@ import Want from '@ohos.app.ability.Want'; ...@@ -26,7 +26,7 @@ import Want from '@ohos.app.ability.Want';
| entities | Array\<string> | No| Additional category information (such as browser and video player) of the ability. It is a supplement to the **action** field for implicit Want. and is used to filter ability types.| | entities | Array\<string> | No| Additional category information (such as browser and video player) of the ability. It is a supplement to the **action** field for implicit Want. and is used to filter ability types.|
| uri | string | No| Data carried. This field is used together with **type** to specify the data type. If **uri** is specified in a Want, the Want will match the specified URI information, including **scheme**, **schemeSpecificPart**, **authority**, and **path**.| | uri | string | No| Data carried. This field is used together with **type** to specify the data type. If **uri** is specified in a Want, the Want will match the specified URI information, including **scheme**, **schemeSpecificPart**, **authority**, and **path**.|
| 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.| | 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.|
| parameters | {[key: string]: any} | 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-bundleManager-bundleInfo.md#bundleinfo-1), 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]: any} | 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.callerBundleName**: bundle name of the caller.<br>- **ohos.aafwk.param.callerToken**: token of the caller.<br>- **ohos.aafwk.param.callerUid**: UID in [BundleInfo](js-apis-bundleManager-bundleInfo.md#bundleinfo-1), 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.|
| [flags](js-apis-ability-wantConstant.md#wantconstantflags) | number | No| How the **Want** object will be handled. By default, a number is passed in.<br>For example, **wantConstant.Flags.FLAG_ABILITY_CONTINUATION** specifies whether to start the ability in cross-device migration scenarios.| | [flags](js-apis-ability-wantConstant.md#wantconstantflags) | number | No| How the **Want** object will be handled. By default, a number is passed in.<br>For example, **wantConstant.Flags.FLAG_ABILITY_CONTINUATION** specifies whether to start the ability in cross-device migration scenarios.|
**Example** **Example**
...@@ -34,6 +34,7 @@ import Want from '@ohos.app.ability.Want'; ...@@ -34,6 +34,7 @@ import Want from '@ohos.app.ability.Want';
- Basic usage: called in a UIAbility object, as shown in the example below. For details about how to obtain the context, see [Obtaining the Context of UIAbility](../../application-models/uiability-usage.md#obtaining-the-context-of-uiability). - Basic usage: called in a UIAbility object, as shown in the example below. For details about how to obtain the context, see [Obtaining the Context of UIAbility](../../application-models/uiability-usage.md#obtaining-the-context-of-uiability).
```ts ```ts
let context = ...; // UIAbilityContext
let want = { let want = {
'deviceId': '', // An empty deviceId indicates the local device. 'deviceId': '', // An empty deviceId indicates the local device.
'bundleName': 'com.example.myapplication', 'bundleName': 'com.example.myapplication',
...@@ -41,16 +42,17 @@ import Want from '@ohos.app.ability.Want'; ...@@ -41,16 +42,17 @@ import Want from '@ohos.app.ability.Want';
'moduleName': 'entry' // moduleName is optional. 'moduleName': 'entry' // moduleName is optional.
}; };
this.context.startAbility(want, (err) => { context.startAbility(want, (err) => {
// Start an ability explicitly. The bundleName, abilityName, and moduleName parameters work together to uniquely identify an ability. // Start an ability explicitly. The bundleName, abilityName, and moduleName parameters work together to uniquely identify an ability.
console.error(`startAbility failed, code is ${err.code}, message is ${err.message}`); console.error(`Failed to startAbility. Code: ${err.code}, message: ${err.message}`);
}); });
``` ```
- Data is transferred through user-defined fields. The following data types are supported (called in a UIAbility object, as shown in the example below. For details about how to obtain the context, see [Obtaining the Context of UIAbility](../../application-models/uiability-usage.md#obtaining-the-context-of-uiability).) - Currently, the following data types are supported: string, number, Boolean, object, array, and file descriptor (FD).
* String * String
```ts ```ts
let context = ...; // UIAbilityContext
let want = { let want = {
bundleName: 'com.example.myapplication', bundleName: 'com.example.myapplication',
abilityName: 'FuncAbility', abilityName: 'FuncAbility',
...@@ -59,12 +61,13 @@ import Want from '@ohos.app.ability.Want'; ...@@ -59,12 +61,13 @@ import Want from '@ohos.app.ability.Want';
}, },
}; };
this.context.startAbility(want, (err) => { context.startAbility(want, (err) => {
console.error(`startAbility failed, code is ${err.code}, message is ${err.message}`); console.error(`Failed to startAbility. Code: ${err.code}, message: ${err.message}`);
}); });
``` ```
* Number * Number
```ts ```ts
let context = ...; // UIAbilityContext
let want = { let want = {
bundleName: 'com.example.myapplication', bundleName: 'com.example.myapplication',
abilityName: 'FuncAbility', abilityName: 'FuncAbility',
...@@ -74,12 +77,13 @@ import Want from '@ohos.app.ability.Want'; ...@@ -74,12 +77,13 @@ import Want from '@ohos.app.ability.Want';
}, },
}; };
this.context.startAbility(want, (err) => { context.startAbility(want, (err) => {
console.error(`startAbility failed, code is ${err.code}, message is ${err.message}`); console.error(`Failed to startAbility. Code: ${err.code}, message: ${err.message}`);
}); });
``` ```
* Boolean * Boolean
```ts ```ts
let context = ...; // UIAbilityContext
let want = { let want = {
bundleName: 'com.example.myapplication', bundleName: 'com.example.myapplication',
abilityName: 'FuncAbility', abilityName: 'FuncAbility',
...@@ -88,12 +92,13 @@ import Want from '@ohos.app.ability.Want'; ...@@ -88,12 +92,13 @@ import Want from '@ohos.app.ability.Want';
}, },
}; };
this.context.startAbility(want, (err) => { context.startAbility(want, (err) => {
console.error(`startAbility failed, code is ${err.code}, message is ${err.message}`); console.error(`Failed to startAbility. Code: ${err.code}, message: ${err.message}`);
}); });
``` ```
* Object * Object
```ts ```ts
let context = ...; // UIAbilityContext
let want = { let want = {
bundleName: 'com.example.myapplication', bundleName: 'com.example.myapplication',
abilityName: 'FuncAbility', abilityName: 'FuncAbility',
...@@ -107,12 +112,13 @@ import Want from '@ohos.app.ability.Want'; ...@@ -107,12 +112,13 @@ import Want from '@ohos.app.ability.Want';
}, },
}; };
this.context.startAbility(want, (err) => { context.startAbility(want, (err) => {
console.error(`startAbility failed, code is ${err.code}, message is ${err.message}`); console.error(`Failed to startAbility. Code: ${err.code}, message: ${err.message}`);
}); });
``` ```
* Array * Array
```ts ```ts
let context = ...; // UIAbilityContext
let want = { let want = {
bundleName: 'com.example.myapplication', bundleName: 'com.example.myapplication',
abilityName: 'FuncAbility', abilityName: 'FuncAbility',
...@@ -124,19 +130,21 @@ import Want from '@ohos.app.ability.Want'; ...@@ -124,19 +130,21 @@ import Want from '@ohos.app.ability.Want';
}, },
}; };
this.context.startAbility(want, (err) => { context.startAbility(want, (err) => {
console.error(`startAbility failed, code is ${err.code}, message is ${err.message}`); console.error(`Failed to startAbility. Code: ${err.code}, message: ${err.message}`);
}); });
``` ```
* File descriptor (FD) * FD
```ts ```ts
import fileio from '@ohos.fileio'; import fs from '@ohos.file.fs';
let context = ...; // UIAbilityContext
let fd; let fd;
try { try {
fd = fileio.openSync('/data/storage/el2/base/haps/pic.png'); fd = fs.openSync('/data/storage/el2/base/haps/pic.png').fd;
} catch(e) { } catch(err) {
console.error('openSync fail: ${JSON.stringify(e)}'); console.error(`Failed to openSync. Code: ${err.code}, message: ${err.message}`);
} }
let want = { let want = {
'deviceId': '', // An empty deviceId indicates the local device. 'deviceId': '', // An empty deviceId indicates the local device.
...@@ -148,7 +156,7 @@ import Want from '@ohos.app.ability.Want'; ...@@ -148,7 +156,7 @@ import Want from '@ohos.app.ability.Want';
} }
}; };
this.context.startAbility(want, (err) => { context.startAbility(want, (err) => {
console.error(`startAbility failed, code is ${err.code}, message is ${err.message}`); console.error(`Failed to startAbility. Code: ${err.code}, message: ${err.message}`);
}); });
``` ```
...@@ -24,9 +24,9 @@ import Want from '@ohos.application.Want'; ...@@ -24,9 +24,9 @@ import Want from '@ohos.application.Want';
| uri | string | No | URI information to match. If **uri** is specified in a **Want** object, the **Want** object will match the specified URI information, including **scheme**, **schemeSpecificPart**, **authority**, and **path**.| | uri | string | No | URI information to match. If **uri** is specified in a **Want** object, the **Want** object will match the specified URI information, including **scheme**, **schemeSpecificPart**, **authority**, and **path**.|
| 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. | | 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).| | 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 attribute 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 attribute 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]: any} | 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#bundleinfo1), 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]: any} | 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 ability. It is a supplement to the **action** field for 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 ability. It is a supplement to the **action** field for implicit Want. and is used to filter ability types. For details, see [entity](js-apis-ability-wantConstant.md#wantconstantentity). |
**Example** **Example**
...@@ -108,10 +108,10 @@ import Want from '@ohos.application.Want'; ...@@ -108,10 +108,10 @@ import Want from '@ohos.application.Want';
``` ```
* File descriptor (FD) * File descriptor (FD)
```ts ```ts
import fileio from '@ohos.fileio'; import fs from '@ohos.file.fs';
let fd; let fd;
try { try {
fd = fileio.openSync('/data/storage/el2/base/haps/pic.png'); fd = fs.openSync('/data/storage/el2/base/haps/pic.png').fd;
} catch(e) { } catch(e) {
console.error('openSync fail: ${JSON.stringify(e)}'); console.error('openSync fail: ${JSON.stringify(e)}');
} }
......
...@@ -15,10 +15,10 @@ Want is a carrier for information transfer between objects (application componen ...@@ -15,10 +15,10 @@ Want is a carrier for information transfer between objects (application componen
| abilityName | string | No | Name of the ability. If both **bundleName** and **abilityName** are specified in a **Want** object, the **Want** object can match a specific ability. The value of **abilityName** must be unique in an application.| | abilityName | string | No | Name of the ability. If both **bundleName** and **abilityName** are specified in a **Want** object, the **Want** object can match a specific ability. The value of **abilityName** must be unique in an application.|
| uri | string | No | URI. If **uri** is specified in a **Want** object, the **Want** object will match the specified URI information, including **scheme**, **schemeSpecificPart**, **authority**, and **path**.| | uri | string | No | URI. If **uri** is specified in a **Want** object, the **Want** object will match the specified URI information, including **scheme**, **schemeSpecificPart**, **authority**, and **path**.|
| 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. | | 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). | | 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-app-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#bundleinfo1), 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>9+</sup> | string | No | Module to which the ability belongs.|
**Example** **Example**
...@@ -41,12 +41,12 @@ Want is a carrier for information transfer between objects (application componen ...@@ -41,12 +41,12 @@ Want is a carrier for information transfer between objects (application componen
- Passing a file descriptor (FD) (called in the UIAbility object, where context in the example is the context object of the UIAbility): - Passing a file descriptor (FD) (called in the UIAbility object, where context in the example is the context object of the UIAbility):
```ts ```ts
import fileio from '@ohos.fileio'; import fs from '@ohos.file.fs';
// ... // ...
let fd; let fd;
try { try {
fd = fileio.openSync('/data/storage/el2/base/haps/pic.png'); fd = fs.openSync('/data/storage/el2/base/haps/pic.png').fd;
} catch(e) { } catch(e) {
console.error('openSync fail: ${JSON.stringify(e)}'); console.error('openSync fail: ${JSON.stringify(e)}');
} }
......
...@@ -46,26 +46,21 @@ Starts an ability. This API uses an asynchronous callback to return the result. ...@@ -46,26 +46,21 @@ Starts an ability. This API uses an asynchronous callback to return the result.
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. | | 16000001 | The specified ability does not exist. |
| 401 | Invalid input parameter. | | 16000002 | Incorrect ability type. |
| 16000001 | Input error. The specified ability name does not exist. | | 16000004 | Can not start invisible component. |
| 16000004 | Visibility verification failed. | | 16000005 | The specified process does not have the permission. |
| 16000005 | Static permission denied. The specified process does not have the permission. | | 16000006 | Cross-user operations are not allowed. |
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. | | 16000008 | The crowdtesting application expires. |
| 16000008 | Crowdtest App Expiration. | | 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000009 | Can not start ability in wukong mode. | | 16000010 | The call with the continuation flag is forbidden. |
| 16000010 | Can not operation with continue flag. | | 16000011 | The context does not exist. |
| 16000011 | Context does not exist. | | 16000050 | Internal error. |
| 16000017 | The previous ability is starting, wait start later. | | 16000053 | The ability is not on the top of the UI. |
| 16000051 | Network error. The network is abnormal. | | 16000055 | Installation-free timed out. |
| 16000052 | Free install not support. The application does not support freeinstall | | 16200001 | The caller has been released. |
| 16000053 | Not top ability. The application is not top ability. |
| 16000054 | Free install busyness. There are concurrent tasks, waiting for retry. | For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
| 16000055 | Free install timeout. |
| 16000056 | Can not free install other ability. |
| 16000057 | Not support cross device free install. |
| 16200001 | Caller released. The caller has been released. |
| 16000050 | Internal Error. |
**Example** **Example**
...@@ -118,26 +113,21 @@ Starts an ability. This API uses a promise to return the result. ...@@ -118,26 +113,21 @@ Starts an ability. This API uses a promise to return the result.
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. | | 16000001 | The specified ability does not exist. |
| 401 | Invalid input parameter. | | 16000002 | Incorrect ability type. |
| 16000001 | Input error. The specified ability name does not exist. | | 16000004 | Can not start invisible component. |
| 16000004 | Visibility verification failed. | | 16000005 | The specified process does not have the permission. |
| 16000005 | Static permission denied. The specified process does not have the permission. | | 16000006 | Cross-user operations are not allowed. |
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. | | 16000008 | The crowdtesting application expires. |
| 16000008 | Crowdtest App Expiration. | | 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000009 | Can not start ability in wukong mode. | | 16000010 | The call with the continuation flag is forbidden. |
| 16000010 | Can not operation with continue flag. | | 16000011 | The context does not exist. |
| 16000011 | Context does not exist. | | 16000050 | Internal error. |
| 16000017 | The previous ability is starting, wait start later. | | 16000053 | The ability is not on the top of the UI. |
| 16000051 | Network error. The network is abnormal. | | 16000055 | Installation-free timed out. |
| 16000052 | Free install not support. The application does not support freeinstall | | 16200001 | The caller has been released. |
| 16000053 | Not top ability. The application is not top ability. |
| 16000054 | Free install busyness. There are concurrent tasks, waiting for retry. | For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
| 16000055 | Free install timeout. |
| 16000056 | Can not free install other ability. |
| 16000057 | Not support cross device free install. |
| 16200001 | Caller released. The caller has been released. |
| 16000050 | Internal Error. |
**Example** **Example**
...@@ -170,7 +160,7 @@ Starts an ability. This API uses a promise to return the result. ...@@ -170,7 +160,7 @@ Starts an ability. This API uses a promise to return the result.
startAbility(want: Want, options: StartOptions, callback: AsyncCallback&lt;void&gt;): void startAbility(want: Want, options: StartOptions, callback: AsyncCallback&lt;void&gt;): void
Starts an ability. This API uses an asynchronous callback to return the result. Starts an ability with the start options specified. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -188,26 +178,21 @@ Starts an ability. This API uses an asynchronous callback to return the result. ...@@ -188,26 +178,21 @@ Starts an ability. This API uses an asynchronous callback to return the result.
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. | | 16000001 | The specified ability does not exist. |
| 401 | Invalid input parameter. | | 16000002 | Incorrect ability type. |
| 16000001 | Input error. The specified ability name does not exist. | | 16000004 | Can not start invisible component. |
| 16000004 | Visibility verification failed. | | 16000005 | The specified process does not have the permission. |
| 16000005 | Static permission denied. The specified process does not have the permission. | | 16000006 | Cross-user operations are not allowed. |
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. | | 16000008 | The crowdtesting application expires. |
| 16000008 | Crowdtest App Expiration. | | 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000009 | Can not start ability in wukong mode. | | 16000010 | The call with the continuation flag is forbidden. |
| 16000010 | Can not operation with continue flag. | | 16000011 | The context does not exist. |
| 16000011 | Context does not exist. | | 16000050 | Internal error. |
| 16000017 | The previous ability is starting, wait start later. | | 16000053 | The ability is not on the top of the UI. |
| 16000051 | Network error. The network is abnormal. | | 16000055 | Installation-free timed out. |
| 16000052 | Free install not support. The application does not support freeinstall | | 16200001 | The caller has been released. |
| 16000053 | Not top ability. The application is not top ability. |
| 16000054 | Free install busyness. There are concurrent tasks, waiting for retry. | For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
| 16000055 | Free install timeout. |
| 16000056 | Can not free install other ability. |
| 16000057 | Not support cross device free install. |
| 16200001 | Caller released. The caller has been released. |
| 16000050 | Internal Error. |
**Example** **Example**
...@@ -245,7 +230,7 @@ Starts an ability with the account ID specified. This API uses an asynchronous c ...@@ -245,7 +230,7 @@ Starts an ability with the account ID specified. This API uses an asynchronous c
Observe the following when using this API: Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -264,27 +249,21 @@ Observe the following when using this API: ...@@ -264,27 +249,21 @@ Observe the following when using this API:
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. | | 16000001 | The specified ability does not exist. |
| 401 | Invalid input parameter. | | 16000002 | Incorrect ability type. |
| 16000001 | Input error. The specified ability name does not exist. | | 16000004 | Can not start invisible component. |
| 16000004 | Visibility verification failed. | | 16000005 | The specified process does not have the permission. |
| 16000005 | Static permission denied. The specified process does not have the permission. | | 16000006 | Cross-user operations are not allowed. |
| 16000006 | Can not cross user operations. | | 16000008 | The crowdtesting application expires. |
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. | | 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000008 | Crowdtest App Expiration. | | 16000010 | The call with the continuation flag is forbidden. |
| 16000009 | Can not start ability in wukong mode. | | 16000011 | The context does not exist. |
| 16000010 | Can not operation with continue flag. | | 16000050 | Internal error. |
| 16000011 | Context does not exist. | | 16000053 | The ability is not on the top of the UI. |
| 16000017 | The previous ability is starting, wait start later. | | 16000055 | Installation-free timed out. |
| 16000051 | Network error. The network is abnormal. | | 16200001 | The caller has been released. |
| 16000052 | Free install not support. The application does not support freeinstall |
| 16000053 | Not top ability. The application is not top ability. | For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
| 16000054 | Free install busyness. There are concurrent tasks, waiting for retry. |
| 16000055 | Free install timeout. |
| 16000056 | Can not free install other ability. |
| 16000057 | Not support cross device free install. |
| 16200001 | Caller released. The caller has been released. |
| 16000050 | Internal Error. |
**Example** **Example**
...@@ -320,7 +299,7 @@ Starts an ability with the account ID and start options specified. This API uses ...@@ -320,7 +299,7 @@ Starts an ability with the account ID and start options specified. This API uses
Observe the following when using this API: Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -340,27 +319,21 @@ Observe the following when using this API: ...@@ -340,27 +319,21 @@ Observe the following when using this API:
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. | | 16000001 | The specified ability does not exist. |
| 401 | Invalid input parameter. | | 16000002 | Incorrect ability type. |
| 16000001 | Input error. The specified ability name does not exist. | | 16000004 | Can not start invisible component. |
| 16000004 | Visibility verification failed. | | 16000005 | The specified process does not have the permission. |
| 16000005 | Static permission denied. The specified process does not have the permission. | | 16000006 | Cross-user operations are not allowed. |
| 16000006 | Can not cross user operations. | | 16000008 | The crowdtesting application expires. |
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. | | 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000008 | Crowdtest App Expiration. | | 16000010 | The call with the continuation flag is forbidden. |
| 16000009 | Can not start ability in wukong mode. | | 16000011 | The context does not exist. |
| 16000010 | Can not operation with continue flag. | | 16000050 | Internal error. |
| 16000011 | Context does not exist. | | 16000053 | The ability is not on the top of the UI. |
| 16000017 | The previous ability is starting, wait start later. | | 16000055 | Installation-free timed out. |
| 16000051 | Network error. The network is abnormal. | | 16200001 | The caller has been released. |
| 16000052 | Free install not support. The application does not support freeinstall |
| 16000053 | Not top ability. The application is not top ability. | For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
| 16000054 | Free install busyness. There are concurrent tasks, waiting for retry. |
| 16000055 | Free install timeout. |
| 16000056 | Can not free install other ability. |
| 16000057 | Not support cross device free install. |
| 16200001 | Caller released. The caller has been released. |
| 16000050 | Internal Error. |
**Example** **Example**
...@@ -400,7 +373,7 @@ Starts an ability with the account ID specified. This API uses a promise to retu ...@@ -400,7 +373,7 @@ Starts an ability with the account ID specified. This API uses a promise to retu
Observe the following when using this API: Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -425,27 +398,21 @@ Observe the following when using this API: ...@@ -425,27 +398,21 @@ Observe the following when using this API:
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. | | 16000001 | The specified ability does not exist. |
| 401 | Invalid input parameter. | | 16000002 | Incorrect ability type. |
| 16000001 | Input error. The specified ability name does not exist. | | 16000004 | Can not start invisible component. |
| 16000004 | Visibility verification failed. | | 16000005 | The specified process does not have the permission. |
| 16000005 | Static permission denied. The specified process does not have the permission. | | 16000006 | Cross-user operations are not allowed. |
| 16000006 | Can not cross user operations. | | 16000008 | The crowdtesting application expires. |
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. | | 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000008 | Crowdtest App Expiration. | | 16000010 | The call with the continuation flag is forbidden. |
| 16000009 | Can not start ability in wukong mode. | | 16000011 | The context does not exist. |
| 16000010 | Can not operation with continue flag. | | 16000050 | Internal error. |
| 16000011 | Context does not exist. | | 16000053 | The ability is not on the top of the UI. |
| 16000017 | The previous ability is starting, wait start later. | | 16000055 | Installation-free timed out. |
| 16000051 | Network error. The network is abnormal. | | 16200001 | The caller has been released. |
| 16000052 | Free install not support. The application does not support freeinstall |
| 16000053 | Not top ability. The application is not top ability. | For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
| 16000054 | Free install busyness. There are concurrent tasks, waiting for retry. |
| 16000055 | Free install timeout. |
| 16000056 | Can not free install other ability. |
| 16000057 | Not support cross device free install. |
| 16200001 | Caller released. The caller has been released. |
| 16000050 | Internal Error. |
**Example** **Example**
...@@ -497,18 +464,16 @@ Starts a new ServiceExtensionAbility. This API uses an asynchronous callback to ...@@ -497,18 +464,16 @@ Starts a new ServiceExtensionAbility. This API uses an asynchronous callback to
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. | | 16000001 | The specified ability does not exist. |
| 401 | Invalid input parameter. | | 16000002 | Incorrect ability type. |
| 16000001 | Input error. The specified ability name does not exist. | | 16000005 | The specified process does not have the permission. |
| 16000002 | Ability type error. The specified ability type is wrong. | | 16000006 | Cross-user operations are not allowed. |
| 16000004 | Visibility verification failed. | | 16000008 | The crowdtesting application expires. |
| 16000005 | Static permission denied. The specified process does not have the permission. | | 16000011 | The context does not exist. |
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. | | 16000050 | Internal error. |
| 16000008 | Crowdtest App Expiration. | | 16200001 | The caller has been released. |
| 16000009 | Can not start ability in wukong mode. |
| 16000011 | Context does not exist. | For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
| 16200001 | Caller released. The caller has been released. |
| 16000050 | Internal Error. |
**Example** **Example**
...@@ -561,18 +526,16 @@ Starts a new ServiceExtensionAbility. This API uses a promise to return the resu ...@@ -561,18 +526,16 @@ Starts a new ServiceExtensionAbility. This API uses a promise to return the resu
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. | | 16000001 | The specified ability does not exist. |
| 401 | Invalid input parameter. | | 16000002 | Incorrect ability type. |
| 16000001 | Input error. The specified ability name does not exist. | | 16000005 | The specified process does not have the permission. |
| 16000002 | Ability type error. The specified ability type is wrong. | | 16000006 | Cross-user operations are not allowed. |
| 16000004 | Visibility verification failed. | | 16000008 | The crowdtesting application expires. |
| 16000005 | Static permission denied. The specified process does not have the permission. | | 16000011 | The context does not exist. |
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. | | 16000050 | Internal error. |
| 16000008 | Crowdtest App Expiration. | | 16200001 | The caller has been released. |
| 16000009 | Can not start ability in wukong mode. |
| 16000011 | Context does not exist. | For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
| 16200001 | Caller released. The caller has been released. |
| 16000050 | Internal Error. |
**Example** **Example**
...@@ -623,19 +586,16 @@ Starts a new ServiceExtensionAbility with the account ID specified. This API use ...@@ -623,19 +586,16 @@ Starts a new ServiceExtensionAbility with the account ID specified. This API use
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. | | 16000001 | The specified ability does not exist. |
| 401 | Invalid input parameter. | | 16000002 | Incorrect ability type. |
| 16000001 | Input error. The specified ability name does not exist. | | 16000005 | The specified process does not have the permission. |
| 16000002 | Ability type error. The specified ability type is wrong. | | 16000006 | Cross-user operations are not allowed. |
| 16000004 | Visibility verification failed. | | 16000008 | The crowdtesting application expires. |
| 16000005 | Static permission denied. The specified process does not have the permission. | | 16000011 | The context does not exist. |
| 16000006 | Can not cross user operations. | | 16000050 | Internal error. |
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. | | 16200001 | The caller has been released. |
| 16000008 | Crowdtest App Expiration. |
| 16000009 | Can not start ability in wukong mode. | For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
| 16000011 | Context does not exist. |
| 16200001 | Caller released. The caller has been released. |
| 16000050 | Internal Error. |
**Example** **Example**
...@@ -693,19 +653,16 @@ Starts a new ServiceExtensionAbility with the account ID specified. This API use ...@@ -693,19 +653,16 @@ Starts a new ServiceExtensionAbility with the account ID specified. This API use
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. | | 16000001 | The specified ability does not exist. |
| 401 | Invalid input parameter. | | 16000002 | Incorrect ability type. |
| 16000001 | Input error. The specified ability name does not exist. | | 16000005 | The specified process does not have the permission. |
| 16000002 | Ability type error. The specified ability type is wrong. | | 16000006 | Cross-user operations are not allowed. |
| 16000004 | Visibility verification failed. | | 16000008 | The crowdtesting application expires. |
| 16000005 | Static permission denied. The specified process does not have the permission. | | 16000011 | The context does not exist. |
| 16000006 | Can not cross user operations. | | 16000050 | Internal error. |
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. | | 16200001 | The caller has been released. |
| 16000008 | Crowdtest App Expiration. |
| 16000009 | Can not start ability in wukong mode. | For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
| 16000011 | Context does not exist. |
| 16200001 | Caller released. The caller has been released. |
| 16000050 | Internal Error. |
**Example** **Example**
...@@ -754,15 +711,15 @@ Stops a ServiceExtensionAbility in the same application. This API uses an asynch ...@@ -754,15 +711,15 @@ Stops a ServiceExtensionAbility in the same application. This API uses an asynch
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. | | 16000001 | The specified ability does not exist. |
| 401 | Invalid input parameter. | | 16000002 | Incorrect ability type. |
| 16000001 | Input error. The specified ability name does not exist. | | 16000005 | The specified process does not have the permission. |
| 16000002 | Ability type error. The specified ability type is wrong. | | 16000006 | Cross-user operations are not allowed. |
| 16000004 | Visibility verification failed. | | 16000011 | The context does not exist. |
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. | | 16000050 | Internal error. |
| 16000011 | Context does not exist. | | 16200001 | The caller has been released. |
| 16200001 | Caller released. The caller has been released. |
| 16000050 | Internal Error. | For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
...@@ -815,15 +772,15 @@ Stops a ServiceExtensionAbility in the same application. This API uses a promise ...@@ -815,15 +772,15 @@ Stops a ServiceExtensionAbility in the same application. This API uses a promise
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. | | 16000001 | The specified ability does not exist. |
| 401 | Invalid input parameter. | | 16000002 | Incorrect ability type. |
| 16000001 | Input error. The specified ability name does not exist. | | 16000005 | The specified process does not have the permission. |
| 16000002 | Ability type error. The specified ability type is wrong. | | 16000006 | Cross-user operations are not allowed. |
| 16000004 | Visibility verification failed. | | 16000011 | The context does not exist. |
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. | | 16000050 | Internal error. |
| 16000011 | Context does not exist. | | 16200001 | The caller has been released. |
| 16200001 | Caller released. The caller has been released. |
| 16000050 | Internal Error. | For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
...@@ -874,16 +831,15 @@ Stops a ServiceExtensionAbility in the same application with the account ID spec ...@@ -874,16 +831,15 @@ Stops a ServiceExtensionAbility in the same application with the account ID spec
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. | | 16000001 | The specified ability does not exist. |
| 401 | Invalid input parameter. | | 16000002 | Incorrect ability type. |
| 16000001 | Input error. The specified ability name does not exist. | | 16000005 | The specified process does not have the permission. |
| 16000002 | Ability type error. The specified ability type is wrong. | | 16000006 | Cross-user operations are not allowed. |
| 16000004 | Visibility verification failed. | | 16000011 | The context does not exist. |
| 16000006 | Can not cross user operations. | | 16000050 | Internal error. |
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. | | 16200001 | The caller has been released. |
| 16000011 | Context does not exist. |
| 16200001 | Caller released. The caller has been released. | For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
| 16000050 | Internal Error. |
**Example** **Example**
...@@ -940,16 +896,15 @@ Stops a ServiceExtensionAbility in the same application with the account ID spec ...@@ -940,16 +896,15 @@ Stops a ServiceExtensionAbility in the same application with the account ID spec
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. | | 16000001 | The specified ability does not exist. |
| 401 | Invalid input parameter. | | 16000002 | Incorrect ability type. |
| 16000001 | Input error. The specified ability name does not exist. | | 16000005 | The specified process does not have the permission. |
| 16000002 | Ability type error. The specified ability type is wrong. | | 16000006 | Cross-user operations are not allowed. |
| 16000004 | Visibility verification failed. | | 16000011 | The context does not exist. |
| 16000006 | Can not cross user operations. | | 16000050 | Internal error. |
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. | | 16200001 | The caller has been released. |
| 16000011 | Context does not exist. |
| 16200001 | Caller released. The caller has been released. | For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
| 16000050 | Internal Error. |
**Example** **Example**
...@@ -997,12 +952,14 @@ Terminates this ability. This API uses an asynchronous callback to return the re ...@@ -997,12 +952,14 @@ Terminates this ability. This API uses an asynchronous callback to return the re
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. | | 16000001 | The specified ability does not exist. |
| 401 | Invalid input parameter. | | 16000004 | Can not start invisible component. |
| 16000001 | Input error. The specified ability name does not exist. | | 16000005 | The specified process does not have the permission. |
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. | | 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000011 | Context does not exist. | | 16000011 | The context does not exist. |
| 16000050 | Internal Error. | | 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
...@@ -1038,12 +995,14 @@ Terminates this ability. This API uses a promise to return the result. ...@@ -1038,12 +995,14 @@ Terminates this ability. This API uses a promise to return the result.
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. | | 16000001 | The specified ability does not exist. |
| 401 | Invalid input parameter. | | 16000004 | Can not start invisible component. |
| 16000001 | Input error. The specified ability name does not exist. | | 16000005 | The specified process does not have the permission. |
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. | | 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000011 | Context does not exist. | | 16000011 | The context does not exist. |
| 16000050 | Internal Error. | | 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
...@@ -1084,14 +1043,13 @@ Connects this ability to a ServiceExtensionAbility. ...@@ -1084,14 +1043,13 @@ Connects this ability to a ServiceExtensionAbility.
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. |
| 401 | Invalid input parameter. |
| 16000001 | Input error. The specified ability name does not exist. | | 16000001 | Input error. The specified ability name does not exist. |
| 16000002 | Ability type error. The specified ability type is wrong. | | 16000005 | The specified process does not have the permission. |
| 16000004 | Visibility verification failed. | | 16000011 | The context does not exist. |
| 16000011 | Context does not exist. |
| 16000050 | Internal Error. | | 16000050 | Internal Error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1145,15 +1103,13 @@ Uses the **AbilityInfo.AbilityType.SERVICE** template and account ID to connect ...@@ -1145,15 +1103,13 @@ Uses the **AbilityInfo.AbilityType.SERVICE** template and account ID to connect
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. |
| 401 | Invalid input parameter. |
| 16000001 | Input error. The specified ability name does not exist. | | 16000001 | Input error. The specified ability name does not exist. |
| 16000002 | Ability type error. The specified ability type is wrong. | | 16000005 | The specified process does not have the permission. |
| 16000004 | Visibility verification failed. | | 16000011 | The context does not exist. |
| 16000006 | Can not cross user operations. |
| 16000011 | Context does not exist. |
| 16000050 | Internal Error. | | 16000050 | Internal Error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1202,13 +1158,11 @@ Disconnects this ability from a ServiceExtensionAbility and after the successful ...@@ -1202,13 +1158,11 @@ Disconnects this ability from a ServiceExtensionAbility and after the successful
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. | | 16000011 | The context does not exist. |
| 401 | Invalid input parameter. |
| 16000001 | Input error. The specified ability name does not exist. |
| 16000003 | Input error. The specified id does not exist. |
| 16000011 | Context does not exist. |
| 16000050 | Internal Error. | | 16000050 | Internal Error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1259,13 +1213,11 @@ Disconnects this ability from a ServiceExtensionAbility and after the successful ...@@ -1259,13 +1213,11 @@ Disconnects this ability from a ServiceExtensionAbility and after the successful
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. | | 16000011 | The context does not exist. |
| 401 | Invalid input parameter. |
| 16000001 | Input error. The specified ability name does not exist. |
| 16000003 | Input error. The specified id does not exist. |
| 16000011 | Context does not exist. |
| 16000050 | Internal Error. | | 16000050 | Internal Error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1299,7 +1251,7 @@ Starts an ability in the foreground or background and obtains the caller object ...@@ -1299,7 +1251,7 @@ Starts an ability in the foreground or background and obtains the caller object
Observe the following when using this API: Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- The rules for using this API in the same-device and cross-device scenarios are different. For details, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - The rules for using this API in the same-device and cross-device scenarios are different. For details, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -1322,16 +1274,17 @@ Observe the following when using this API: ...@@ -1322,16 +1274,17 @@ Observe the following when using this API:
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 201 | The application does not have permission to call the interface. |
| 401 | Invalid input parameter. |
| 16000001 | Input error. The specified ability name does not exist. | | 16000001 | Input error. The specified ability name does not exist. |
| 16000002 | Incorrect ability type. |
| 16000004 | Visibility verification failed. | | 16000004 | Visibility verification failed. |
| 16000005 | Static permission denied. The specified process does not have the permission. | | 16000005 | Static permission denied. The specified process does not have the permission. |
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. | | 16000006 | Cross-user operations are not allowed. |
| 16000008 | Crowdtest App Expiration. | | 16000008 | Crowdtest App Expiration. |
| 16000009 | Can not start ability in wukong mode. | | 16000011 | The context does not exist. |
| 16000017 | The previous ability is starting, wait start later. |
| 16000050 | Internal Error. | | 16000050 | Internal Error. |
| 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
......
...@@ -29,7 +29,7 @@ Starts an ability. This API uses an asynchronous callback to return the result. ...@@ -29,7 +29,7 @@ Starts an ability. This API uses an asynchronous callback to return the result.
Observe the following when using this API: Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -54,12 +54,13 @@ Observe the following when using this API: ...@@ -54,12 +54,13 @@ 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. |
| 16000017 | The previous ability is starting, wait start later. |
| 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. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -92,7 +93,7 @@ Starts an ability with the start options specified. This API uses an asynchronou ...@@ -92,7 +93,7 @@ Starts an ability with the start options specified. This API uses an asynchronou
Observe the following when using this API: Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -118,12 +119,13 @@ Observe the following when using this API: ...@@ -118,12 +119,13 @@ 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. |
| 16000017 | The previous ability is starting, wait start later. |
| 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. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -160,7 +162,7 @@ Starts an ability. This API uses a promise to return the result. ...@@ -160,7 +162,7 @@ Starts an ability. This API uses a promise to return the result.
Observe the following when using this API: Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -191,12 +193,13 @@ Observe the following when using this API: ...@@ -191,12 +193,13 @@ 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. |
| 16000017 | The previous ability is starting, wait start later. |
| 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. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -235,7 +238,7 @@ Starts an ability. This API uses an asynchronous callback to return the result w ...@@ -235,7 +238,7 @@ Starts an ability. This API uses an asynchronous callback to return the result w
Observe the following when using this API: Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -260,12 +263,13 @@ Observe the following when using this API: ...@@ -260,12 +263,13 @@ 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. |
| 16000017 | The previous ability is starting, wait start later. |
| 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. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -302,7 +306,7 @@ Starts an ability with the start options specified. This API uses an asynchronou ...@@ -302,7 +306,7 @@ Starts an ability with the start options specified. This API uses an asynchronou
Observe the following when using this API: Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -328,12 +332,13 @@ Observe the following when using this API: ...@@ -328,12 +332,13 @@ 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. |
| 16000017 | The previous ability is starting, wait start later. |
| 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. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -374,7 +379,7 @@ Starts an ability. This API uses a promise to return the result when the ability ...@@ -374,7 +379,7 @@ Starts an ability. This API uses a promise to return the result when the ability
Observe the following when using this API: Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -406,12 +411,13 @@ Observe the following when using this API: ...@@ -406,12 +411,13 @@ 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. |
| 16000017 | The previous ability is starting, wait start later. |
| 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. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -447,7 +453,7 @@ Starts an ability with the account ID specified. This API uses an asynchronous c ...@@ -447,7 +453,7 @@ Starts an ability with the account ID specified. This API uses an asynchronous c
Observe the following when using this API: Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) **Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user)
...@@ -477,12 +483,13 @@ Observe the following when using this API: ...@@ -477,12 +483,13 @@ 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. |
| 16000017 | The previous ability is starting, wait start later. |
| 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. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -518,7 +525,7 @@ Starts an ability with the start options and account ID specified. This API uses ...@@ -518,7 +525,7 @@ Starts an ability with the start options and account ID specified. This API uses
Observe the following when using this API: Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) **Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user)
...@@ -549,12 +556,13 @@ Observe the following when using this API: ...@@ -549,12 +556,13 @@ 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. |
| 16000017 | The previous ability is starting, wait start later. |
| 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. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -593,7 +601,7 @@ Starts an ability with the account ID specified. This API uses a promise to retu ...@@ -593,7 +601,7 @@ Starts an ability with the account ID specified. This API uses a promise to retu
Observe the following when using this API: Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) **Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user)
...@@ -629,12 +637,13 @@ Observe the following when using this API: ...@@ -629,12 +637,13 @@ 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. |
| 16000017 | The previous ability is starting, wait start later. |
| 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. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -693,6 +702,8 @@ Starts a ServiceExtensionAbility. This API uses an asynchronous callback to retu ...@@ -693,6 +702,8 @@ Starts a ServiceExtensionAbility. This API uses an asynchronous callback to retu
| 16000050 | Internal error. | | 16000050 | Internal error. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -747,6 +758,8 @@ Starts a ServiceExtensionAbility. This API uses a promise to return the result. ...@@ -747,6 +758,8 @@ Starts a ServiceExtensionAbility. This API uses a promise to return the result.
| 16000050 | Internal error. | | 16000050 | Internal error. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -805,6 +818,8 @@ Starts a ServiceExtensionAbility with the account ID specified. This API uses an ...@@ -805,6 +818,8 @@ Starts a ServiceExtensionAbility with the account ID specified. This API uses an
| 16000050 | Internal error. | | 16000050 | Internal error. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -863,6 +878,8 @@ Starts a ServiceExtensionAbility with the account ID specified. This API uses a ...@@ -863,6 +878,8 @@ Starts a ServiceExtensionAbility with the account ID specified. This API uses a
| 16000050 | Internal error. | | 16000050 | Internal error. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -917,6 +934,8 @@ Stops a ServiceExtensionAbility in the same application. This API uses an asynch ...@@ -917,6 +934,8 @@ Stops a ServiceExtensionAbility in the same application. This API uses an asynch
| 16000050 | Internal error. | | 16000050 | Internal error. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -970,6 +989,8 @@ Stops a ServiceExtensionAbility in the same application. This API uses a promise ...@@ -970,6 +989,8 @@ Stops a ServiceExtensionAbility in the same application. This API uses a promise
| 16000050 | Internal error. | | 16000050 | Internal error. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1027,6 +1048,8 @@ Stops a ServiceExtensionAbility with the account ID specified in the same applic ...@@ -1027,6 +1048,8 @@ Stops a ServiceExtensionAbility with the account ID specified in the same applic
| 16000050 | Internal error. | | 16000050 | Internal error. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1084,6 +1107,8 @@ Stops a ServiceExtensionAbility with the account ID specified in the same applic ...@@ -1084,6 +1107,8 @@ Stops a ServiceExtensionAbility with the account ID specified in the same applic
| 16000050 | Internal error. | | 16000050 | Internal error. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1135,6 +1160,8 @@ Terminates this ability. This API uses an asynchronous callback to return the re ...@@ -1135,6 +1160,8 @@ Terminates this ability. This API uses an asynchronous callback to return the re
| 16000011 | The context does not exist. | | 16000011 | The context does not exist. |
| 16000050 | Internal error. | | 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1180,6 +1207,8 @@ Terminates this ability. This API uses a promise to return the result. ...@@ -1180,6 +1207,8 @@ Terminates this ability. This API uses a promise to return the result.
| 16000011 | The context does not exist. | | 16000011 | The context does not exist. |
| 16000050 | Internal error. | | 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1226,6 +1255,8 @@ Terminates this ability. If the ability is started by calling [startAbilityForRe ...@@ -1226,6 +1255,8 @@ Terminates this ability. If the ability is started by calling [startAbilityForRe
| 16000011 | The context does not exist. | | 16000011 | The context does not exist. |
| 16000050 | Internal error. | | 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1288,6 +1319,8 @@ Terminates this ability. If the ability is started by calling [startAbilityForRe ...@@ -1288,6 +1319,8 @@ Terminates this ability. If the ability is started by calling [startAbilityForRe
| 16000011 | The context does not exist. | | 16000011 | The context does not exist. |
| 16000050 | Internal error. | | 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1348,6 +1381,8 @@ Connects this ability to an ability that uses the **AbilityInfo.AbilityType.SERV ...@@ -1348,6 +1381,8 @@ Connects this ability to an ability that uses the **AbilityInfo.AbilityType.SERV
| 16000011 | The context does not exist. | | 16000011 | The context does not exist. |
| 16000050 | Internal error. | | 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1414,6 +1449,8 @@ Connects this ability to an ability that uses the **AbilityInfo.AbilityType.SERV ...@@ -1414,6 +1449,8 @@ Connects this ability to an ability that uses the **AbilityInfo.AbilityType.SERV
| 16000011 | The context does not exist. | | 16000011 | The context does not exist. |
| 16000050 | Internal error. | | 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1469,11 +1506,11 @@ Disconnects this ability from a ServiceExtensionAbility and after the successful ...@@ -1469,11 +1506,11 @@ Disconnects this ability from a ServiceExtensionAbility and after the successful
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 16000001 | The specified ability does not exist. |
| 16000005 | The specified process does not have the permission. |
| 16000011 | The context does not exist. | | 16000011 | The context does not exist. |
| 16000050 | Internal error. | | 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1517,11 +1554,11 @@ Disconnects this ability from a ServiceExtensionAbility and after the successful ...@@ -1517,11 +1554,11 @@ Disconnects this ability from a ServiceExtensionAbility and after the successful
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 16000001 | The specified ability does not exist. |
| 16000005 | The specified process does not have the permission. |
| 16000011 | The context does not exist. | | 16000011 | The context does not exist. |
| 16000050 | Internal error. | | 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1554,7 +1591,7 @@ Starts an ability in the foreground or background and obtains the caller object ...@@ -1554,7 +1591,7 @@ Starts an ability in the foreground or background and obtains the caller object
Observe the following when using this API: Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- The rules for using this API in the same-device and cross-device scenarios are different. For details, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - The rules for using this API in the same-device and cross-device scenarios are different. For details, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -1581,15 +1618,12 @@ Observe the following when using this API: ...@@ -1581,15 +1618,12 @@ Observe the following when using this API:
| 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. |
| 16000008 | The crowdtesting application expires. | | 16000008 | The crowdtesting application expires. |
| 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. | | 16000011 | The context does not exist. |
| 16000017 | The previous ability is starting, wait start later. |
| 16000050 | Internal error. | | 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
Start an ability in the background. Start an ability in the background.
...@@ -1661,7 +1695,7 @@ Starts an ability with the account ID specified. This API uses an asynchronous c ...@@ -1661,7 +1695,7 @@ Starts an ability with the account ID specified. This API uses an asynchronous c
Observe the following when using this API: Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) **Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user)
...@@ -1691,12 +1725,13 @@ Observe the following when using this API: ...@@ -1691,12 +1725,13 @@ 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. |
| 16000017 | The previous ability is starting, wait start later. |
| 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. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1732,7 +1767,7 @@ Starts an ability with the account ID and start options specified. This API uses ...@@ -1732,7 +1767,7 @@ Starts an ability with the account ID and start options specified. This API uses
Observe the following when using this API: Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) **Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user)
...@@ -1763,12 +1798,13 @@ Observe the following when using this API: ...@@ -1763,12 +1798,13 @@ 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. |
| 16000017 | The previous ability is starting, wait start later. |
| 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. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1807,7 +1843,7 @@ Starts an ability with the account ID specified. This API uses a promise to retu ...@@ -1807,7 +1843,7 @@ Starts an ability with the account ID specified. This API uses a promise to retu
Observe the following when using this API: Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user) **Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS (required only when the account ID is not the current user)
...@@ -1837,12 +1873,13 @@ Observe the following when using this API: ...@@ -1837,12 +1873,13 @@ 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. |
| 16000017 | The previous ability is starting, wait start later. |
| 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. |
| 16200001 | The caller has been released. | | 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1887,6 +1924,15 @@ Sets a label for this UIAbility in the mission. This API uses an asynchronous ca ...@@ -1887,6 +1924,15 @@ Sets a label for this UIAbility in the mission. This API uses an asynchronous ca
| label | string | Yes| Label of the ability to set.| | label | string | Yes| Label of the ability to set.|
| 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**
| ID| Error Message|
| ------- | -------------------------------- |
| 16000011 | The context does not exist. |
| 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1922,6 +1968,8 @@ Sets a label for this UIAbility in the mission. This API uses a promise to retur ...@@ -1922,6 +1968,8 @@ Sets a label for this UIAbility in the mission. This API uses a promise to retur
| 16000011 | The context does not exist. | | 16000011 | The context does not exist. |
| 16000050 | Internal error. | | 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -1955,6 +2003,8 @@ Sets an icon for this ability in the mission. This API uses an asynchronous call ...@@ -1955,6 +2003,8 @@ Sets an icon for this ability in the mission. This API uses an asynchronous call
| 16000011 | The context does not exist. | | 16000011 | The context does not exist. |
| 16000050 | Internal error. | | 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -2010,6 +2060,8 @@ Sets an icon for this ability in the mission. This API uses a promise to return ...@@ -2010,6 +2060,8 @@ Sets an icon for this ability in the mission. This API uses a promise to return
| 16000011 | The context does not exist. | | 16000011 | The context does not exist. |
| 16000050 | Internal error. | | 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -2057,6 +2109,8 @@ Restores the WindowStage data in the UIAbility. ...@@ -2057,6 +2109,8 @@ Restores the WindowStage data in the UIAbility.
| 16000011 | The context does not exist. | | 16000011 | The context does not exist. |
| 16000050 | Internal error. | | 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -2083,7 +2137,8 @@ Checks whether this UIAbility is in the terminating state. ...@@ -2083,7 +2137,8 @@ Checks whether this UIAbility is in the terminating state.
| ID| Error Message| | ID| Error Message|
| ------- | -------------------------------- | | ------- | -------------------------------- |
| 16000011 | The context does not exist. | | 16000011 | The context does not exist. |
| 16000050 | Internal error. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
...@@ -2100,7 +2155,7 @@ Starts a ServiceExtensionAbility that supports modal dialog boxes. After the Ser ...@@ -2100,7 +2155,7 @@ Starts a ServiceExtensionAbility that supports modal dialog boxes. After the Ser
Observe the following when using this API: Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -2112,6 +2167,26 @@ Observe the following when using this API: ...@@ -2112,6 +2167,26 @@ Observe the following when using this API:
| want |[Want](js-apis-application-want.md) | Yes| Want information about the target ServiceExtensionAbility.| | want |[Want](js-apis-application-want.md) | Yes| Want information about the target ServiceExtensionAbility.|
| result | AsyncCallback&lt;[dialogRequest.RequestResult](js-apis-app-ability-dialogRequest.md)&gt; | Yes| Callback used to return the result.| | result | AsyncCallback&lt;[dialogRequest.RequestResult](js-apis-app-ability-dialogRequest.md)&gt; | Yes| Callback used to return the result.|
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 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. |
| 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. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
| 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
...@@ -2147,7 +2222,7 @@ Starts a ServiceExtensionAbility that supports modal dialog boxes. After the Ser ...@@ -2147,7 +2222,7 @@ Starts a ServiceExtensionAbility that supports modal dialog boxes. After the Ser
Observe the following when using this API: Observe the following when using this API:
- If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission.
- If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission.
- For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md). - For details about the startup rules for the components in the stage model, see [Component Startup Rules (Stage Model)](../../application-models/component-startup-rules.md).
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -2165,6 +2240,26 @@ Observe the following when using this API: ...@@ -2165,6 +2240,26 @@ Observe the following when using this API:
| -------- | -------- | | -------- | -------- |
| Promise&lt;[dialogRequest.RequestResult](js-apis-app-ability-dialogRequest.md)&gt; | Promise used to return the result. | Promise&lt;[dialogRequest.RequestResult](js-apis-app-ability-dialogRequest.md)&gt; | Promise used to return the result.
**Error codes**
| ID| Error Message|
| ------- | -------------------------------- |
| 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. |
| 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. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
| 16200001 | The caller has been released. |
For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
**Example** **Example**
```ts ```ts
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册