提交 34bd918e 编写于 作者: G Gloria

Update docs against 16809+16909+17385+17418

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 b5f13e6c
...@@ -18,118 +18,145 @@ import Want from '@ohos.app.ability.Want'; ...@@ -18,118 +18,145 @@ import Want from '@ohos.app.ability.Want';
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | -------------------- | ---- | ------------------------------------------------------------ | | ----------- | -------------------- | ---- | ------------------------------------------------------------ |
| deviceId | string | No | ID of the device running the ability. | | deviceId | string | No | ID of the device running the ability. If this field is unspecified, the local device is used. |
| bundleName | string | No | Bundle name of the ability. If both **bundleName** and **abilityName** are specified in a **Want** object, the **Want** object can match a specific ability. | | bundleName | string | No | Bundle name of the ability.|
| moduleName | string | No| Name of the module to which the ability belongs.|
| 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| If **uri** is specified in a **Want**, the **Want** will match the specified URI information, including **scheme**, **schemeSpecificPart**, **authority**, and **path** components.| | 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 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). |
| 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, a number is passed in. For details, see [flags](js-apis-app-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. |
| 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. |
| 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.|
| moduleName | string | 否 | Module to which the ability belongs. | | 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.|
| 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.|
**Example** **Example**
- Basic usage - 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 want = { let context = ...; // UIAbilityContext
'deviceId': '', // An empty deviceId indicates the local device. let want = {
'bundleName': 'com.extreme.test', 'deviceId': '', // An empty deviceId indicates the local device.
'abilityName': 'MainAbility', 'bundleName': 'com.example.myapplication',
'moduleName': 'entry' // moduleName is optional 'abilityName': 'FuncAbility',
}; 'moduleName': 'entry' // moduleName is optional.
this.context.startAbility(want, (error) => { };
// Start an ability explicitly. The bundleName, abilityName, and moduleName parameters work together to uniquely identify an ability.
console.log('error.code = ' + error.code); context.startAbility(want, (err) => {
}) // Start an ability explicitly. The bundleName, abilityName, and moduleName parameters work together to uniquely identify an ability.
console.error(`Failed to startAbility. Code: ${err.code}, message: ${err.message}`);
});
``` ```
- Data is transferred through user-defined fields. The following data types are supported: - 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.demo', bundleName: 'com.example.myapplication',
abilityName: 'com.example.demo.MainAbility', abilityName: 'FuncAbility',
parameters: { parameters: {
keyForString: 'str', keyForString: 'str',
}, },
}; };
context.startAbility(want, (err) => {
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.demo', bundleName: 'com.example.myapplication',
abilityName: 'com.example.demo.MainAbility', abilityName: 'FuncAbility',
parameters: { parameters: {
keyForInt: 100, keyForInt: 100,
keyForDouble: 99.99, keyForDouble: 99.99,
}, },
}; };
context.startAbility(want, (err) => {
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.demo', bundleName: 'com.example.myapplication',
abilityName: 'com.example.demo.MainAbility', abilityName: 'FuncAbility',
parameters: { parameters: {
keyForBool: true, keyForBool: true,
}, },
}; };
context.startAbility(want, (err) => {
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.demo', bundleName: 'com.example.myapplication',
abilityName: 'com.example.demo.MainAbility', abilityName: 'FuncAbility',
parameters: { parameters: {
keyForObject: { keyForObject: {
keyForObjectString: 'str', keyForObjectString: 'str',
keyForObjectInt: -200, keyForObjectInt: -200,
keyForObjectDouble: 35.5, keyForObjectDouble: 35.5,
keyForObjectBool: false, keyForObjectBool: false,
},
}, },
},
}; };
context.startAbility(want, (err) => {
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.demo', bundleName: 'com.example.myapplication',
abilityName: 'com.example.demo.MainAbility', abilityName: 'FuncAbility',
parameters: { parameters: {
keyForArrayString: ['str1', 'str2', 'str3'], keyForArrayString: ['str1', 'str2', 'str3'],
keyForArrayInt: [100, 200, 300, 400], keyForArrayInt: [100, 200, 300, 400],
keyForArrayDouble: [0.1, 0.2], keyForArrayDouble: [0.1, 0.2],
keyForArrayObject: [{obj1: 'aaa'}, {obj2: 100}], keyForArrayObject: [{ obj1: 'aaa' }, { obj2: 100 }],
}, },
}; };
context.startAbility(want, (err) => {
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 fd;
try { let context = ...; // UIAbilityContext
fd = fileio.openSync('/data/storage/el2/base/haps/pic.png');
} catch(e) { let fd;
console.log('openSync fail:' + JSON.stringify(e)); try {
} fd = fs.openSync('/data/storage/el2/base/haps/pic.png').fd;
let want = { } catch(err) {
'deviceId': '', // An empty deviceId indicates the local device. console.error(`Failed to openSync. Code: ${err.code}, message: ${err.message}`);
'bundleName': 'com.extreme.test', }
'abilityName': 'MainAbility', let want = {
'moduleName': 'entry', // moduleName is optional. 'deviceId': '', // An empty deviceId indicates the local device.
'parameters': { 'bundleName': 'com.example.myapplication',
'keyFd':{'type':'FD', 'value':fd} // {'type':'FD', 'value':fd} is a fixed usage, indicating that the data is a file descriptor. 'abilityName': 'FuncAbility',
} 'moduleName': 'entry', // moduleName is optional.
}; 'parameters': {
this.context.startAbility(want, (error) => { 'keyFd': { 'type': 'FD', 'value': fd } // {'type':'FD', 'value':fd} is a fixed usage, indicating that the data is a file descriptor.
// Start an ability explicitly. The bundleName, abilityName, and moduleName parameters work together to uniquely identify an ability. }
console.log('error.code = ' + error.code); };
});
context.startAbility(want, (err) => {
console.error(`Failed to startAbility. Code: ${err.code}, message: ${err.message}`);
});
``` ```
...@@ -19,7 +19,7 @@ import Want from '@ohos.application.Want'; ...@@ -19,7 +19,7 @@ import Want from '@ohos.application.Want';
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | -------------------- | ---- | ------------------------------------------------------------ | | ----------- | -------------------- | ---- | ------------------------------------------------------------ |
| deviceId | string | No | ID of the device running the ability. | | deviceId | string | No | ID of the device running the ability. |
| bundleName | string | No | Bundle name. If both **bundleName** and **abilityName** are specified in a bWantb, the **Want** can directly match the specified ability.| | bundleName | string | No | Bundle name. If both **bundleName** and **abilityName** are specified in a **Want**, the **Want** can directly match the specified ability.|
| 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 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. |
...@@ -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.log('openSync fail:' + JSON.stringify(e)); console.log('openSync fail:' + JSON.stringify(e));
} }
......
...@@ -15,9 +15,9 @@ Want is a carrier for information transfer between objects (application componen ...@@ -15,9 +15,9 @@ 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-app-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. | | 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. |
| 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-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]: 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-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. |
| 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. | | 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. |
| moduleName<sup>9+</sup> | string | No | Module to which the ability belongs.| | moduleName<sup>9+</sup> | string | No | Module to which the ability belongs.|
...@@ -52,8 +52,8 @@ Want is a carrier for information transfer between objects (application componen ...@@ -52,8 +52,8 @@ Want is a carrier for information transfer between objects (application componen
} }
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.extreme.test',
'abilityName': 'EntryAbility', 'abilityName': 'MainAbility',
'moduleName': 'entry', // moduleName is optional. 'moduleName': 'entry', // moduleName is optional.
'parameters': { 'parameters': {
'keyFd':{'type':'FD', 'value':fd} 'keyFd':{'type':'FD', 'value':fd}
...@@ -66,5 +66,5 @@ Want is a carrier for information transfer between objects (application componen ...@@ -66,5 +66,5 @@ Want is a carrier for information transfer between objects (application componen
// ... // ...
``` ```
- For more details and examples, see [Want](../../application-models/application-model-composition.md). - For more details and examples, see [Want](../../application-models/want-overview.md).
...@@ -45,25 +45,21 @@ Starts an ability. This API uses an asynchronous callback to return the result. ...@@ -45,25 +45,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. |
| 16000051 | Network error. The network is abnormal. | | 16000053 | The ability is not on the top of the UI. |
| 16000052 | Free install not support. The application does not support freeinstall | | 16000055 | Installation-free timed out. |
| 16000053 | Not top ability. The application is not top ability. | | 16200001 | The caller has been released. |
| 16000054 | Free install busyness. There are concurrent tasks, waiting for retry. |
| 16000055 | Free install timeout. | For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
| 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,25 +114,21 @@ Starts an ability. This API uses a promise to return the result. ...@@ -118,25 +114,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. |
| 16000051 | Network error. The network is abnormal. | | 16000053 | The ability is not on the top of the UI. |
| 16000052 | Free install not support. The application does not support freeinstall | | 16000055 | Installation-free timed out. |
| 16000053 | Not top ability. The application is not top ability. | | 16200001 | The caller has been released. |
| 16000054 | Free install busyness. There are concurrent tasks, waiting for retry. |
| 16000055 | Free install timeout. | For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
| 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**
...@@ -189,25 +181,21 @@ Starts an ability with the start options specified. This API uses an asynchronou ...@@ -189,25 +181,21 @@ Starts an ability with the start options specified. This API uses an asynchronou
| 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. |
| 16000051 | Network error. The network is abnormal. | | 16000053 | The ability is not on the top of the UI. |
| 16000052 | Free install not support. The application does not support freeinstall | | 16000055 | Installation-free timed out. |
| 16000053 | Not top ability. The application is not top ability. | | 16200001 | The caller has been released. |
| 16000054 | Free install busyness. There are concurrent tasks, waiting for retry. |
| 16000055 | Free install timeout. | For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md).
| 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**
...@@ -266,26 +254,21 @@ Observe the following when using this API: ...@@ -266,26 +254,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. |
| 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**
...@@ -343,26 +326,21 @@ Observe the following when using this API: ...@@ -343,26 +326,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. |
| 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**
...@@ -429,26 +407,21 @@ Observe the following when using this API: ...@@ -429,26 +407,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. |
| 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**
...@@ -502,18 +475,16 @@ Starts a new ServiceExtensionAbility. This API uses an asynchronous callback to ...@@ -502,18 +475,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**
...@@ -568,18 +539,16 @@ Starts a new ServiceExtensionAbility. This API uses a promise to return the resu ...@@ -568,18 +539,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**
...@@ -632,20 +601,16 @@ Starts a new ServiceExtensionAbility with the account ID specified. This API use ...@@ -632,20 +601,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. |
| 16000011 | Context does not exist. |
| 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**
...@@ -704,19 +669,16 @@ Starts a new ServiceExtensionAbility with the account ID specified. This API use ...@@ -704,19 +669,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**
...@@ -767,15 +729,15 @@ Stops a ServiceExtensionAbility in the same application. This API uses an asynch ...@@ -767,15 +729,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**
...@@ -830,15 +792,15 @@ Stops a ServiceExtensionAbility in the same application. This API uses a promise ...@@ -830,15 +792,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**
...@@ -891,16 +853,15 @@ Stops a ServiceExtensionAbility in the same application with the account ID spec ...@@ -891,16 +853,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**
...@@ -959,16 +920,15 @@ Stops a ServiceExtensionAbility in the same application with the account ID spec ...@@ -959,16 +920,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**
...@@ -1018,12 +978,14 @@ Terminates this ability. This API uses an asynchronous callback to return the re ...@@ -1018,12 +978,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**
...@@ -1060,12 +1022,14 @@ Terminates this ability. This API uses a promise to return the result. ...@@ -1060,12 +1022,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,7 +1048,7 @@ Terminates this ability. This API uses a promise to return the result. ...@@ -1084,7 +1048,7 @@ Terminates this ability. This API uses a promise to return the result.
connectServiceExtensionAbility(want: Want, options: ConnectOptions): number; connectServiceExtensionAbility(want: Want, options: ConnectOptions): number;
Connects this ability to a ServiceAbility. Connects this ability to a ServiceExtensionAbility.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -1107,14 +1071,13 @@ Connects this ability to a ServiceAbility. ...@@ -1107,14 +1071,13 @@ Connects this ability to a ServiceAbility.
| 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
...@@ -1166,15 +1129,13 @@ Uses the **AbilityInfo.AbilityType.SERVICE** template and account ID to connect ...@@ -1166,15 +1129,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
...@@ -1204,7 +1165,7 @@ Uses the **AbilityInfo.AbilityType.SERVICE** template and account ID to connect ...@@ -1204,7 +1165,7 @@ Uses the **AbilityInfo.AbilityType.SERVICE** template and account ID to connect
disconnectServiceExtensionAbility(connection: number, callback:AsyncCallback&lt;void&gt;): void; disconnectServiceExtensionAbility(connection: number, callback:AsyncCallback&lt;void&gt;): void;
Disconnects this ability from the ServiceAbility. This API uses an asynchronous callback to return the result. Disconnects this ability from the ServiceExtensionAbility. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -1221,13 +1182,11 @@ Disconnects this ability from the ServiceAbility. This API uses an asynchronous ...@@ -1221,13 +1182,11 @@ Disconnects this ability from the ServiceAbility. This API uses an asynchronous
| 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
...@@ -1256,7 +1215,7 @@ Disconnects this ability from the ServiceAbility. This API uses an asynchronous ...@@ -1256,7 +1215,7 @@ Disconnects this ability from the ServiceAbility. This API uses an asynchronous
disconnectServiceExtensionAbility(connection: number): Promise&lt;void&gt;; disconnectServiceExtensionAbility(connection: number): Promise&lt;void&gt;;
Disconnects this ability from the ServiceAbility. This API uses a promise to return the result. Disconnects this ability from the ServiceExtensionAbility. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core **System capability**: SystemCapability.Ability.AbilityRuntime.Core
...@@ -1278,13 +1237,11 @@ Disconnects this ability from the ServiceAbility. This API uses a promise to ret ...@@ -1278,13 +1237,11 @@ Disconnects this ability from the ServiceAbility. This API uses a promise to ret
| 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
...@@ -1340,15 +1297,17 @@ Observe the following when using this API: ...@@ -1340,15 +1297,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. |
| 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**
......
...@@ -27,7 +27,7 @@ Starts an ability. This API uses an asynchronous callback to return the result. ...@@ -27,7 +27,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**, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false**, 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
...@@ -52,12 +52,13 @@ Observe the following when using this API: ...@@ -52,12 +52,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
...@@ -93,7 +94,7 @@ Starts an ability with the start options specified. This API uses an asynchronou ...@@ -93,7 +94,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**, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false**, 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
...@@ -119,12 +120,13 @@ Observe the following when using this API: ...@@ -119,12 +120,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
...@@ -163,7 +165,7 @@ Starts an ability. This API uses a promise to return the result. ...@@ -163,7 +165,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**, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false**, 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
...@@ -194,12 +196,13 @@ Observe the following when using this API: ...@@ -194,12 +196,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
...@@ -241,7 +244,7 @@ Starts an ability. This API uses an asynchronous callback to return the result w ...@@ -241,7 +244,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**, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false**, 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
...@@ -266,12 +269,13 @@ Observe the following when using this API: ...@@ -266,12 +269,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
...@@ -311,7 +315,7 @@ Starts an ability with the start options specified. This API uses an asynchronou ...@@ -311,7 +315,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**, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false**, 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
...@@ -337,12 +341,13 @@ Observe the following when using this API: ...@@ -337,12 +341,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
...@@ -386,7 +391,7 @@ Starts an ability. This API uses a promise to return the result when the ability ...@@ -386,7 +391,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**, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false**, 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
...@@ -418,12 +423,13 @@ Observe the following when using this API: ...@@ -418,12 +423,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
...@@ -486,12 +492,13 @@ Starts an ability with the account ID specified. This API uses an asynchronous c ...@@ -486,12 +492,13 @@ Starts an ability with the account ID specified. This API uses an asynchronous c
| 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
...@@ -556,12 +563,13 @@ Starts an ability with the start options and account ID specified. This API uses ...@@ -556,12 +563,13 @@ Starts an ability with the start options and account ID specified. This API uses
| 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
...@@ -634,12 +642,13 @@ Starts an ability with the account ID specified. This API uses a promise to retu ...@@ -634,12 +642,13 @@ Starts an ability with the account ID specified. This API uses a promise to retu
| 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
...@@ -701,6 +710,8 @@ Starts a ServiceExtensionAbility. This API uses an asynchronous callback to retu ...@@ -701,6 +710,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
...@@ -757,6 +768,8 @@ Starts a ServiceExtensionAbility. This API uses a promise to return the result. ...@@ -757,6 +768,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
...@@ -817,6 +830,8 @@ Starts a ServiceExtensionAbility with the account ID specified. This API uses an ...@@ -817,6 +830,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
...@@ -877,6 +892,8 @@ Starts a ServiceExtensionAbility with the account ID specified. This API uses a ...@@ -877,6 +892,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
...@@ -933,6 +950,8 @@ Stops a ServiceExtensionAbility in the same application. This API uses an asynch ...@@ -933,6 +950,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
...@@ -988,6 +1007,8 @@ Stops a ServiceExtensionAbility in the same application. This API uses a promise ...@@ -988,6 +1007,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
...@@ -1047,6 +1068,8 @@ Stops a ServiceExtensionAbility with the account ID specified in the same applic ...@@ -1047,6 +1068,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
...@@ -1106,6 +1129,8 @@ Stops a ServiceExtensionAbility with the account ID specified in the same applic ...@@ -1106,6 +1129,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
...@@ -1159,6 +1184,8 @@ Terminates this ability. This API uses an asynchronous callback to return the re ...@@ -1159,6 +1184,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
...@@ -1200,6 +1227,8 @@ Terminates this ability. This API uses a promise to return the result. ...@@ -1200,6 +1227,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
...@@ -1240,6 +1269,8 @@ Terminates this ability. If the ability is started by calling [startAbilityForRe ...@@ -1240,6 +1269,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
...@@ -1304,6 +1335,8 @@ Terminates this ability. If the ability is started by calling [startAbilityForRe ...@@ -1304,6 +1335,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
...@@ -1366,6 +1399,8 @@ Connects this ability to an ability that uses the **AbilityInfo.AbilityType.SERV ...@@ -1366,6 +1399,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
...@@ -1426,6 +1461,8 @@ Connects this ability to an ability that uses the **AbilityInfo.AbilityType.SERV ...@@ -1426,6 +1461,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
...@@ -1475,11 +1512,11 @@ Disconnects a connection. This API uses a promise to return the result. ...@@ -1475,11 +1512,11 @@ Disconnects a connection. This API uses a promise to return the result.
| 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
...@@ -1523,11 +1560,11 @@ Disconnects a connection. This API uses an asynchronous callback to return the r ...@@ -1523,11 +1560,11 @@ Disconnects a connection. This API uses an asynchronous callback to return the r
| 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
...@@ -1560,7 +1597,7 @@ Starts an ability in the foreground or background and obtains the caller object ...@@ -1560,7 +1597,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**, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. - If **exported** of the target ability is **false**, 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
...@@ -1589,15 +1626,12 @@ Observe the following when using this API: ...@@ -1589,15 +1626,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.
...@@ -1698,12 +1732,13 @@ Starts an ability with the account ID specified. This API uses an asynchronous c ...@@ -1698,12 +1732,13 @@ Starts an ability with the account ID specified. This API uses an asynchronous c
| 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
...@@ -1767,12 +1802,13 @@ Starts an ability with the account ID specified. This API uses an asynchronous c ...@@ -1767,12 +1802,13 @@ Starts an ability with the account ID specified. This API uses an asynchronous c
| 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
...@@ -1838,12 +1874,13 @@ Starts an ability with the account ID specified. This API uses a promise to retu ...@@ -1838,12 +1874,13 @@ Starts an ability with the account ID specified. This API uses a promise to retu
| 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
...@@ -1949,6 +1986,15 @@ Sets a label for this ability in the mission. This API uses an asynchronous call ...@@ -1949,6 +1986,15 @@ Sets a label for this ability in the mission. This API uses an asynchronous call
| 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
...@@ -1985,6 +2031,8 @@ Sets a label for this ability in the mission. This API uses a promise to return ...@@ -1985,6 +2031,8 @@ Sets a label 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
...@@ -2018,6 +2066,8 @@ Sets an icon for this ability in the mission. This API uses an asynchronous call ...@@ -2018,6 +2066,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
...@@ -2072,6 +2122,8 @@ Sets an icon for this ability in the mission. This API uses a promise to return ...@@ -2072,6 +2122,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
...@@ -2120,6 +2172,8 @@ Restores the window stage data for this ability. ...@@ -2120,6 +2172,8 @@ Restores the window stage data for this ability.
| 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
...@@ -2148,6 +2202,8 @@ Checks whether this ability is in the terminating state. ...@@ -2148,6 +2202,8 @@ Checks whether this ability is in the terminating state.
| 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
......
...@@ -186,6 +186,24 @@ The context passed in the API does not exist. ...@@ -186,6 +186,24 @@ The context passed in the API does not exist.
Use the correct context. Use the correct context.
## 16000017 Waiting for the Previous Abilities to Finish Startup
**Error Message**
The previous ability is starting, wait start later.
**Description**
Too many abilities need to be started. Due to the limited processing capability of the system, the requests are cached in the queue and processed in sequence.
**Possible Causes**
The system has a large number of concurrent requests.
**Solution**
No action is required. Wait for the previous abilities to finish startup.
## 100001 Internal Error ## 100001 Internal Error
**Error Message** **Error Message**
...@@ -706,7 +724,7 @@ Internal error. ...@@ -706,7 +724,7 @@ Internal error.
**Description** **Description**
This error code is returned when an error occurs during internal processing, such as memory application or multi-thread processing. This error code is reported when an error occurs during internal processing, such as memory application or multi-thread processing.
**Possible Causes** **Possible Causes**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册