提交 f158e85b 编写于 作者: Y yuyaozhi

Fix error of ability

Signed-off-by: Nyuyaozhi <yuyaozhi@huawei.com>
上级 3cb4b67a
......@@ -46,7 +46,7 @@ want操作的常数。用于表示要执行的通用操作。
| ACTION_FILE_SELECT<sup>7+</sup> | ohos.action.fileSelect | 指示选择文件的操作。 |
| PARAMS_STREAM<sup>7+</sup> | ability.params.stream | 指示发送数据时与目标关联的数据流的URI。对应的value必须是string类型的数组。 |
| ACTION_APP_ACCOUNT_OAUTH <sup>8+</sup> | ohos.account.appAccount.action.oauth | 指示提供oauth服务的操作。 |
| DLP_PARAMS_INDEX<sup>9+</sup> |ohos.dlp.params.index |指示DLP索引参数的操作。 <br>**系统API**:该接口为系统接口,三方应用不支持调用。 |
## wantConstant.Entity
......
......@@ -64,7 +64,7 @@ Ability上次退出原因,该类型为枚举,可配合[Ability](js-apis-app-
| 名称 | 值 | 说明 |
| ----------------------------- | ---- | ------------------------------------------------------------ |
| UNKNOWN | 0 | 未知原因。 |
| ABILITY_NOT_RESPONDING<sup>deprecated</sup> | 1 | ability未响应。从API version 9 开始支持,从API version 10 开始废弃,建议使用APP_FREEZE替代。 |
| ABILITY_NOT_RESPONDING | 1 | ability未响应。从API version 9 开始支持,从API version 10 开始废弃,建议使用APP_FREEZE替代。 |
| NORMAL | 2 | 用户主动关闭,应用程序正常退出。 |
| CPP_CRASH<sup>10+</sup> | 3 | 本机异常信号,导致应用程序退出。 |
| JS_ERROR<sup>10+</sup> | 4 | 当应用存在JS语法错误并未被开发者捕获时,触发JS_ERROR故障,导致应用程序退出。 |
......
......@@ -22,9 +22,9 @@ static isRunningInStabilityTest(callback: AsyncCallback&lt;boolean&gt;): void
**参数:**
| 类型| 说明 |
| -------- | -------- |
|AsyncCallback&lt;boolean&gt; |以回调方式返回接口运行结果及当前是否处于稳定性测试场景,可进行错误处理或其他自定义处理。true: 处于稳定性测试场景,false:处于非稳定性测试场景。 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;boolean&gt; | 是 |以回调方式返回接口运行结果及当前是否处于稳定性测试场景,可进行错误处理或其他自定义处理。true: 处于稳定性测试场景,false:处于非稳定性测试场景。 |
**错误码**
......@@ -128,9 +128,9 @@ isRamConstrainedDevice(callback: AsyncCallback\<boolean>): void;
**参数:**
| 类型 | 说明 |
| -------- | -------- |
| AsyncCallback&lt;boolean&gt; |以回调方式返回接口运行结果及当前设备是否为ram受限设备,可进行错误处理或其他自定义处理。true:当前设备为ram受限设备,false:当前设备为非ram受限设备。 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;boolean&gt; | 是 |以回调方式返回接口运行结果及当前设备是否为ram受限设备,可进行错误处理或其他自定义处理。true:当前设备为ram受限设备,false:当前设备为非ram受限设备。 |
**错误码**
......@@ -198,9 +198,9 @@ getAppMemorySize(callback: AsyncCallback\<number>): void;
**参数:**
| 类型 | 说明 |
| -------- | -------- |
|AsyncCallback&lt;number&gt; |以回调方式返回接口运行结果及应用程序内存大小,可进行错误处理或其他自定义处理。 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;number&gt; | 是 |以回调方式返回接口运行结果及应用程序内存大小,可进行错误处理或其他自定义处理。 |
**错误码**
......@@ -272,9 +272,9 @@ getRunningProcessInformation(callback: AsyncCallback\<Array\<ProcessInformation>
**参数:**
| 类型 | 说明 |
| -------- | -------- |
|AsyncCallback\<Array\<[ProcessInformation](js-apis-inner-application-processInformation.md)>> | 以回调方式返回接口运行结果及有关运行进程的信息,可进行错误处理或其他自定义处理。 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback\<Array\<[ProcessInformation](js-apis-inner-application-processInformation.md)>> | 是 |以回调方式返回接口运行结果及有关运行进程的信息,可进行错误处理或其他自定义处理。 |
**错误码**
......@@ -762,7 +762,7 @@ killProcessWithAccount(bundleName: string, accountId: number): Promise\<void\>
>
> 当accountId为当前用户时,不需要校验ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS权限。
**需要权限**:ohos.permission.CLEAN_BACKGROUND_PROCESSES, ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**需要权限**:ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS, ohos.permission.CLEAN_BACKGROUND_PROCESSES
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......@@ -812,7 +812,7 @@ killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCal
>
> 当accountId为当前用户时,不需要校验ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS权限。
**需要权限**:ohos.permission.CLEAN_BACKGROUND_PROCESSES, ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**需要权限**:ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS, ohos.permission.CLEAN_BACKGROUND_PROCESSES
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......
......@@ -262,7 +262,8 @@ getRequestCallback(want: Want): RequestCallback
console.info(TAG, `onRequest, want: ${want.abilityName}`);
try {
var requestInfo = dialogRequest.getRequestInfo(want);
window.bindDialogTarget(requestInfo, () => {
let windowClass = null;
windowClass.bindDialogTarget(requestInfo, () => {
console.info('Dialog Window Need Destroy.');
}, (err) => {
if (err.code) {
......
......@@ -257,7 +257,7 @@ revokeQuickFix(bundleName: string, callback: AsyncCallback\<void>): void;
撤销快速修复的接口,使用callback方式返回结果。
**需要权限**:ohos.permission.INSTALL_BUNDLE, ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
**需要权限**:ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.INSTALL_BUNDLE
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.QuickFix
......@@ -302,7 +302,7 @@ revokeQuickFix(bundleName: string): Promise\<void>;
撤销快速修复的接口,使用Promise方式返回结果。
**需要权限**:ohos.permission.INSTALL_BUNDLE, ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
**需要权限**:ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.INSTALL_BUNDLE
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.QuickFix
......
......@@ -362,7 +362,7 @@ UIAbility生命周期回调,当系统预关闭开关打开后(配置系统
onPrepareToTermiante() {
// 开发者定义预关闭动作
// 例如拉起另一个ability,根据ability处理结果执行异步关闭
let want:Want = {
let want = {
bundleName: "com.example.myapplication",
moduleName: "entry",
abilityName: "SecondAbility"
......
......@@ -31,7 +31,7 @@ getWantAgent(info: WantAgentInfo, callback: AsyncCallback\<WantAgent\>): void
| 错误码ID | 错误信息 |
|-----------|--------------------|
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry.|
| 16000007 | Service busy, there are concurrent tasks, waiting for retry.|
| 16000151 | Invalid wantagent object.|
错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
......@@ -110,7 +110,7 @@ getWantAgent(info: WantAgentInfo): Promise\<WantAgent\>
| 错误码ID | 错误信息 |
|-----------|--------------------|
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry.|
| 16000007 | Service busy, there are concurrent tasks, waiting for retry.|
| 16000151 | Invalid wantagent object.|
错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
......@@ -179,7 +179,7 @@ getBundleName(agent: WantAgent, callback: AsyncCallback\<string\>): void
| 错误码ID | 错误信息 |
|-----------|--------------------|
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry.|
| 16000007 | Service busy, there are concurrent tasks, waiting for retry.|
| 16000151 | Invalid wantagent object.|
错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
......@@ -271,7 +271,7 @@ getBundleName(agent: WantAgent): Promise\<string\>
| 错误码ID | 错误信息 |
|-----------|--------------------|
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry.|
| 16000007 | Service busy, there are concurrent tasks, waiting for retry.|
| 16000151 | Invalid wantagent object.|
错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
......@@ -354,7 +354,7 @@ getUid(agent: WantAgent, callback: AsyncCallback\<number\>): void
| 错误码ID | 错误信息 |
|-----------|--------------------|
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry.|
| 16000007 | Service busy, there are concurrent tasks, waiting for retry.|
| 16000151 | Invalid wantagent object.|
错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
......@@ -447,7 +447,7 @@ getUid(agent: WantAgent): Promise\<number\>
| 错误码ID | 错误信息 |
|-----------|--------------------|
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry.|
| 16000007 | Service busy, there are concurrent tasks, waiting for retry.|
| 16000151 | Invalid wantagent object.|
错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
......@@ -531,7 +531,7 @@ getWant(agent: WantAgent, callback: AsyncCallback\<Want\>): void
| 错误码ID | 错误信息 |
|-----------|--------------------|
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry.|
| 16000007 | Service busy, there are concurrent tasks, waiting for retry.|
| 16000015 | Service timeout.|
| 16000151 | Invalid wantagent object.|
......@@ -626,7 +626,7 @@ getWant(agent: WantAgent): Promise\<Want\>
| 错误码ID | 错误信息 |
|-----------|--------------------|
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry.|
| 16000007 | Service busy, there are concurrent tasks, waiting for retry.|
| 16000015 | Service timeout.|
| 16000151 | Invalid wantagent object.|
......@@ -710,7 +710,7 @@ cancel(agent: WantAgent, callback: AsyncCallback\<void\>): void
| 错误码ID | 错误信息 |
|-----------|--------------------|
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry.|
| 16000007 | Service busy, there are concurrent tasks, waiting for retry.|
| 16000151 | Invalid wantagent object.|
错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
......@@ -802,7 +802,7 @@ cancel(agent: WantAgent): Promise\<void\>
| 错误码ID | 错误信息 |
|-----------|--------------------|
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry.|
| 16000007 | Service busy, there are concurrent tasks, waiting for retry.|
| 16000151 | Invalid wantagent object.|
错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
......@@ -1127,7 +1127,7 @@ getOperationType(agent: WantAgent, callback: AsyncCallback\<number>): void;
| 错误码ID | 错误信息 |
|-----------|--------------------|
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry.|
| 16000007 | Service busy, there are concurrent tasks, waiting for retry.|
| 16000015 | Service timeout.|
| 16000151 | Invalid wantagent object.|
......@@ -1218,7 +1218,7 @@ getOperationType(agent: WantAgent): Promise\<number>;
| 错误码ID | 错误信息 |
|-----------|--------------------|
| 16000007 | Service busyness. There are concurrent tasks, waiting for retry.|
| 16000007 | Service busy, there are concurrent tasks, waiting for retry.|
| 16000015 | Service timeout.|
| 16000151 | Invalid wantagent object.|
......
......@@ -21,8 +21,8 @@ import formBindingData from '@ohos.app.form.formBindingData';
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| key | string | 是 | 卡片代理刷新的订阅标识,与数据发布者保持一致。|
| subscriberId | string | 否 | 卡片代理刷新的订阅条件,默认值为当前卡片的formId。|
| key<sup>10+</sup> | string | 是 | 卡片代理刷新的订阅标识,与数据发布者保持一致。|
| subscriberId<sup>10+</sup> | string | 否 | 卡片代理刷新的订阅条件,默认值为当前卡片的formId。|
## FormBindingData
......
......@@ -1682,7 +1682,7 @@ formHost.on('formRemove', callback, bundleName);
## off('formRemove')<sup>10+</sup>
off(type: "formRemove", observerCallback?: Callback&lt;formInfo.RunningFormInfo&gt;, bundleName?: string): void
off(type: "formRemove", observerCallback?: Callback&lt;formInfo.RunningFormInfo&gt;, bundleName?: string): void
取消订阅卡片删除事件。使用callback异步回调,返回当前删除卡片的[RunningFormInfo](js-apis-app-form-formInfo.md)
......@@ -2333,7 +2333,7 @@ try {
## getRunningFormInfoById<sup>10+</sup>
function getRunningFormInfoById(formId: string): Promise&lt;formInfo.RunningFormInfo&gt;
getRunningFormInfoById(formId: string): Promise&lt;formInfo.RunningFormInfo&gt;
根据formId查询卡片已有的使用方列表信息。使用Promise异步回调。
......
......@@ -25,7 +25,7 @@ import formInfo from '@ohos.app.form.formInfo';
| abilityName | string | 是 | 否 | 卡片所属的Ability名称。 |
| name | string | 是 | 否 | 卡片名称。 |
| description | string | 是 | 否 | 卡片描述。 |
| descriptionId | number | 是 | 否 | 卡片描述id。 |
| descriptionId<sup>10+</sup> | number | 是 | 否 | 卡片描述id。 |
| type | [FormType](#formtype) | 是 | 否 | 卡片类型。当前支持JS卡片。 |
| jsComponentName | string | 是 | 否 | js卡片的组件名。 |
| colorMode | [ColorMode](#colormode) | 是 | 否 | 卡片颜色模式。 |
......@@ -154,12 +154,12 @@ import formInfo from '@ohos.app.form.formInfo';
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ----------- | -------- | -------- | -------------------- | ------------------------------------------------------------ |
| formId | string | 是 | 否 | 卡片标识。 |
| bundleName | string | 是 | 否 | 提供方卡片所属包的Bundle名称。 |
| bundleName<sup>10+</sup> | string | 是 | 否 | 提供方卡片所属包的Bundle名称。 |
| hostBundleName | string | 是 | 否 | 使用方卡片所属包的Bundle名称。 |
| visibilityType | [VisibilityType](#visibilitytype) | 是 | 否 | 卡片当前可见类型枚举。 |
| moduleName | string | 是 | 否 | 卡片所属模块的模块名称。 |
| abilityName | string | 是 | 否 | 卡片所属的Ability名称。 |
| formName | string | 是 | 否 | 卡片名称。 |
| moduleName<sup>10+</sup> | string | 是 | 否 | 卡片所属模块的模块名称。 |
| abilityName<sup>10+</sup> | string | 是 | 否 | 卡片所属的Ability名称。 |
| formName<sup>10+</sup> | string | 是 | 否 | 卡片名称。 |
| dimension | number | 是 | 否 | 卡片规格。 |
## formProviderFilter<sup>10+</sup>
......
......@@ -37,6 +37,8 @@ startAbility(want: Want, callback: AsyncCallback&lt;void&gt;): void;
- 调用方应用位于后台时,使用该接口启动Ability需申请`ohos.permission.START_ABILITIES_FROM_BACKGROUND`权限
- 跨应用场景下,目标Ability的visible属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
**需要权限**:ohos.permission.CLEAN_BACKGROUND_PROCESSES
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统API**:该接口为系统接口,三方应用不支持调用。
......@@ -104,6 +106,8 @@ startAbility(want: Want): Promise&lt;void&gt;;
- 调用方应用位于后台时,使用该接口启动Ability需申请`ohos.permission.START_ABILITIES_FROM_BACKGROUND`权限
- 跨应用场景下,目标Ability的visible属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
**需要权限**:ohos.permission.CLEAN_BACKGROUND_PROCESSES
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统API**:该接口为系统接口,三方应用不支持调用。
......
......@@ -10,7 +10,7 @@
## 导入模块
```ts
import Configuration from '@ohos.app.application.Configuration';
import Configuration from '@ohos.application.Configuration';
```
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase
......
......@@ -275,18 +275,17 @@ let DDL_TBL_CREATE = 'CREATE TABLE IF NOT EXISTS '
let rdbStore;
export default class DataShareExtAbility extends DataShareExtensionAbility {
batchInsert(uri, valueBuckets, callback) {
if (valueBuckets === null || valueBuckets.length === undefined) {
console.error('invalid valueBuckets');
return;
}
rdbStore.batchInsert(TBL_NAME, valueBuckets, function (err, ret) {
if (callback !== undefined) {
callback(err, ret);
}
});
});
batchInsert(uri, valueBuckets, callback) {
if (valueBuckets === null || valueBuckets.length === undefined) {
console.error('invalid valueBuckets');
return;
}
rdbStore.batchInsert(TBL_NAME, valueBuckets, function (err, ret) {
if (callback !== undefined) {
callback(err, ret);
}
});
};
};
```
......
......@@ -31,8 +31,6 @@ setFormNextRefreshTime(formId: string, minute: number, callback: AsyncCallback&l
**示例:**
```ts
import formProvider from '@ohos.app.form.formProvider';
let formId = '12400633174999288';
formProvider.setFormNextRefreshTime(formId, 5, (error, data) => {
if (error.code) {
......@@ -65,8 +63,6 @@ setFormNextRefreshTime(formId: string, minute: number): Promise&lt;void&gt;
**示例:**
```ts
import formProvider from '@ohos.app.form.formProvider';
let formId = '12400633174999288';
formProvider.setFormNextRefreshTime(formId, 5).then(() => {
console.log('formProvider setFormNextRefreshTime success');
......@@ -95,7 +91,6 @@ updateForm(formId: string, formBindingData: formBindingData.FormBindingData,call
```ts
import formBindingData from '@ohos.app.form.formBindingData';
import formProvider from '@ohos.app.form.formProvider';
let formId = '12400633174999288';
let obj = formBindingData.createFormBindingData({temperature:'22c', time:'22:00'});
......@@ -131,7 +126,6 @@ updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Pr
```ts
import formBindingData from '@ohos.application.formBindingData';
import formProvider from '@ohos.app.form.formProvider';
let formId = '12400633174999288';
let obj = formBindingData.createFormBindingData({temperature:'22c', time:'22:00'});
......
......@@ -1366,17 +1366,17 @@ context.printDrawnCompleted().then((data) => {
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 读写属性 | 类型 | 必填 | 说明 |
| ---- | ---- | ------ | ---- | ----- |
| pid | 只读 | number | 否 | 进程id。 |
| uid | 只读 | number | 否 | 用户id。 |
| 名称 | 类型 | 必填 | 说明 |
| ---- | ------ | ---- | ----- |
| pid |number | 否 | 进程id。 |
| uid |number | 否 | 用户id。 |
## PermissionRequestResult<sup>7+</sup>
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 读写属性 | 类型 | 必填 | 说明 |
| ----------- | ---- | -------------- | ---- | ---------- |
| requestCode | 只读 | number | 是 | 用户传入的请求代码。 |
| permissions | 只读 | Array\<string> | 是 | 用户传入的权限。 |
| authResults | 只读 | Array\<number> | 是 | 请求权限的结果。 |
\ No newline at end of file
| 名称 | 类型 | 必填 | 说明 |
| ----------- |-------------- | ---- | ---------- |
| requestCode | number | 是 | 用户传入的请求代码。 |
| permissions | Array\<string> | 是 | 用户传入的权限。 |
| authResults | Array\<number> | 是 | 请求权限的结果。 |
\ No newline at end of file
......@@ -27,7 +27,7 @@ addAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\<void>): void
添加AbilityMonitor实例(callback形式)
**系统能力:**SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -70,7 +70,7 @@ addAbilityMonitor(monitor: AbilityMonitor): Promise\<void>;
添加AbilityMonitor实例(promise形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -118,7 +118,7 @@ removeAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\<void>): v
删除已经添加的AbilityMonitor实例(callback形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -161,7 +161,7 @@ removeAbilityMonitor(monitor: AbilityMonitor): Promise\<void>;
删除已经添加的AbilityMonitor实例(promise形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -209,7 +209,7 @@ waitAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\<UIAbility>)
等待与AbilityMonitor实例匹配的ability到达OnCreate生命周期,并返回ability实例(callback形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -256,14 +256,14 @@ waitAbilityMonitor(monitor: AbilityMonitor, timeout: number, callback: AsyncCall
设置等待时间,等待与AbilityMonitor实例匹配的ability到达OnCreate生命周期,并返回ability实例(callback形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| monitor | [AbilityMonitor](js-apis-inner-application-abilityMonitor.md#AbilityMonitor) | 是 | [AbilityMonitor](js-apis-inner-application-abilityMonitor.md#AbilityMonitor)实例 |
| timeout | number | | 最大等待时间,单位毫秒(ms) |
| timeout | number | | 最大等待时间,单位毫秒(ms) |
| callback | AsyncCallback\<[UIAbility](js-apis-app-ability-uiAbility.md)> | 是 | 表示指定的回调方法 |
**错误码**
......@@ -307,7 +307,7 @@ waitAbilityMonitor(monitor: AbilityMonitor, timeout?: number): Promise\<UIAbilit
设置等待时间,等待与AbilityMonitor实例匹配的ability到达OnCreate生命周期,并返回ability实例(promise形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -356,7 +356,7 @@ getAppContext(): Context;
获取应用Context
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**返回值:**
......@@ -379,7 +379,7 @@ getAbilityState(ability: UIAbility): number;
获取指定ability的生命周期状态
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -414,7 +414,7 @@ getCurrentTopAbility(callback: AsyncCallback\<UIAbility>): void;
获取当前应用顶部ability(callback形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -449,7 +449,7 @@ getCurrentTopAbility(): Promise\<UIAbility>;
获取当前应用顶部ability(promise形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**返回值:**
......@@ -484,7 +484,7 @@ startAbility(want: Want, callback: AsyncCallback\<void>): void;
启动指定ability(callback形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -506,6 +506,8 @@ startAbility(want: Want, callback: AsyncCallback\<void>): void;
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -534,7 +536,7 @@ startAbility(want: Want): Promise\<void>;
启动指定ability(promise形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -561,6 +563,8 @@ startAbility(want: Want): Promise\<void>;
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -589,7 +593,7 @@ doAbilityForeground(ability: UIAbility, callback: AsyncCallback\<void>): void;
调度指定ability生命周期状态到Foreground状态(callback形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -628,7 +632,7 @@ doAbilityForeground(ability: UIAbility): Promise\<void>;
调度指定ability生命周期状态到Foreground状态(promise形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -672,7 +676,7 @@ doAbilityBackground(ability: UIAbility, callback: AsyncCallback\<void>): void;
调度指定ability生命周期状态到Background状态(callback形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -711,7 +715,7 @@ doAbilityBackground(ability: UIAbility): Promise\<void>;
调度指定ability生命周期状态到Background状态(promise形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -755,7 +759,7 @@ printSync(msg: string): void;
打印日志信息到单元测试终端控制台
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -779,7 +783,7 @@ print(msg: string, callback: AsyncCallback\<void>): void;
打印日志信息到单元测试终端控制台(callback形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -806,7 +810,7 @@ print(msg: string): Promise\<void>;
打印日志信息到单元测试终端控制台(promise形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -838,7 +842,7 @@ executeShellCommand(cmd: string, callback: AsyncCallback\<ShellCmdResult>): void
执行指定的shell命令(callback形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -865,14 +869,14 @@ executeShellCommand(cmd: string, timeoutSecs: number, callback: AsyncCallback\<S
指定超时时间,并执行指定的shell命令(callback形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ----------- | ------------------------------------------------------------ | ---- | ----------------------------- |
| cmd | string | 是 | shell命令字符串 |
| timeoutSecs | number | | 设定命令超时时间,单位秒(s) |
| timeoutSecs | number | | 设定命令超时时间,单位秒(s) |
| callback | AsyncCallback\<[ShellCmdResult](js-apis-inner-application-shellCmdResult.md#ShellCmdResult)> | 是 | 表示指定的回调方法 |
**示例:**
......@@ -894,7 +898,7 @@ executeShellCommand(cmd: string, timeoutSecs?: number): Promise\<ShellCmdResult>
指定超时时间,并执行指定的shell命令(promise形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -928,7 +932,7 @@ finishTest(msg: string, code: number, callback: AsyncCallback\<void>): void;
结束测试并打印日志信息到单元测试终端控制台(callback形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -964,7 +968,7 @@ finishTest(msg: string, code: number): Promise\<void>;
结束测试并打印日志信息到单元测试终端控制台(promise形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -1005,7 +1009,7 @@ addAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback\<vo
添加一个AbilityStageMonitor对象,用于监视指定abilityStage的生命周期状态更改。(callback形式)
**系统能力:**SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -1044,7 +1048,7 @@ addAbilityStageMonitor(monitor: AbilityStageMonitor): Promise\<void>;
添加一个AbilityStageMonitor对象,用于监视指定abilityStage的生命周期状态更改。(promise形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -1088,7 +1092,7 @@ removeAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback\
从应用程序内存中删除指定的AbilityStageMonitor对象。(callback形式)
**系统能力:**SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -1127,7 +1131,7 @@ removeAbilityStageMonitor(monitor: AbilityStageMonitor): Promise\<void>;
从应用程序内存中删除指定的AbilityStageMonitor对象。(promise形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -1171,7 +1175,7 @@ waitAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback\<A
等待并返回与给定AbilityStageMonitor中设置的条件匹配的AbilityStage对象。(callback形式)
**系统能力:**SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -1214,7 +1218,7 @@ waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout?: number): Promise
等待并返回与给定AbilityStageMonitor中设置的条件匹配的AbilityStage对象。(promise形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -1263,7 +1267,7 @@ waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout: number, callback:
等待并返回与给定AbilityStageMonitor中设置的条件匹配的AbilityStage对象。(callback形式)
**系统能力:** SystemCapability.Ability.AbilityRuntime.Core
**系统能力**SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......
......@@ -2,6 +2,10 @@
定义应用状态信息,可以通过[getForegroundApplications](js-apis-app-ability-appManager.md#appmanagergetforegroundapplications)获取当前应用的相关信息。
> **说明:**
>
> 本模块首批接口从API version 8 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
## 导入模块
```ts
......
......@@ -134,7 +134,7 @@ export default class EntryAbility extends UIAbility {
## ApplicationContext.off(type: 'abilityLifecycle', callbackId: number)
off(type: 'abilityLifecycle', callbackId: **number**): **void**;
off(type: 'abilityLifecycle', callbackId: number): Promise\<void>;
取消监听应用内生命周期
......@@ -285,12 +285,8 @@ getRunningProcessInformation(): Promise\<Array\<ProcessInformation>>;
获取有关运行进程的信息。
**需要权限**:ohos.permission.GET_RUNNING_INFO
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统API**: 此接口为系统接口,三方应用不支持调用。
**返回值:**
| 类型 | 说明 |
......@@ -322,12 +318,8 @@ getRunningProcessInformation(callback: AsyncCallback\<Array\<ProcessInformation>
获取有关运行进程的信息。
**需要权限**:ohos.permission.GET_RUNNING_INFO
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统API**: 此接口为系统接口,三方应用不支持调用。
**返回值:**
| 类型 | 说明 |
......
......@@ -45,7 +45,7 @@ createBundleContext(bundleName: string): Context;
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | ------------- |
| bundleName | string | 是 | Bundle名称。 |
......@@ -76,7 +76,7 @@ createModuleContext(moduleName: string): Context;
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | ------------- |
| moduleName | string | 是 | 模块名。 |
......@@ -109,7 +109,7 @@ createModuleContext(bundleName: string, moduleName: string): Context;
**参数:**
| 名称 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | ------------- |
| bundleName | string | 是 | Bundle名称。 |
| moduleName | string | 是 | 模块名。 |
......
......@@ -24,7 +24,7 @@ onUnhandledException(errMsg: string): void;
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| errMsg | string | | 有关异常的消息和错误堆栈跟踪。 |
| errMsg | string | | 有关异常的消息和错误堆栈跟踪。 |
**示例:**
......
......@@ -124,7 +124,7 @@ emit(event: string, ...args: Object[]): void;
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| event | string | 是 | 事件名称。 |
| ...args | Object[] | | 可变参数,事件触发时,传递给回调函数的参数。 |
| ...args | Object[] | | 可变参数,事件触发时,传递给回调函数的参数。 |
**示例:**
......
......@@ -21,6 +21,8 @@ import abilityManager from '@ohos.app.ability.abilityManager';
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
**系统API**:以下各项对应的接口均为系统接口,三方应用不支持调用。
| 名称 | 类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- |
| extension | [ElementName](js-apis-bundleManager-elementName.md) | 是 | 否 | Extension信息。 |
......
......@@ -15,28 +15,6 @@ FormExtensionContext模块提供FormExtensionAbility具有的接口和能力。
import common from '@ohos.app.ability.common';
```
## 使用说明
在使用FormExtensionContext的功能前,需要通过FormExtensionAbility获取。
```ts
import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility';
import formBindingData from '@ohos.app.form.formBindingData';
export default class MyFormExtensionAbility extends FormExtensionAbility {
onAddForm(want) {
let formContext = this.context; // 获取FormExtensionContext
// ...
let dataObj1 = {
temperature: '11c',
'time': '11:00'
};
let obj1 = formBindingData.createFormBindingData(dataObj1);
return obj1;
}
};
```
## startAbility
startAbility(want: Want, callback: AsyncCallback&lt;void&gt;): void
......@@ -57,7 +35,8 @@ startAbility(want: Want, callback: AsyncCallback&lt;void&gt;): void
| 16500100 | Failed to obtain the configuration information. |
| 16500101 | The application is not a system application. |
| 16501000 | An internal functional error occurred. |
|以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。||
以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)
**参数:**
......@@ -126,7 +105,8 @@ startAbility(want: Want): Promise&lt;void&gt;
| 16500100 | Failed to obtain the configuration information. |
| 16500101 | The application is not a system application. |
| 16501000 | An internal functional error occurred. |
|以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。||
以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)
**示例:**
......
......@@ -46,7 +46,7 @@ startAbility(want: Want, callback: AsyncCallback&lt;void&gt;): void;
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | 是 | Want类型参数,传入需要启动的ability的信息,如Ability名称,Bundle名称等。 |
| callback | AsyncCallback&lt;void&gt; | | 回调函数,返回接口调用是否成功的结果。 |
| callback | AsyncCallback&lt;void&gt; | | 回调函数,返回接口调用是否成功的结果。 |
**错误码:**
......@@ -61,6 +61,8 @@ startAbility(want: Want, callback: AsyncCallback&lt;void&gt;): void;
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -107,7 +109,7 @@ startAbility(want: Want, options?: StartOptions): Promise\<void>;
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | 是 | Want类型参数,传入需要启动的ability的信息,如Ability名称,Bundle名称等。 |
| options | [StartOptions](js-apis-app-ability-startOptions.md) | | 启动Ability所携带的参数。 |
| options | [StartOptions](js-apis-app-ability-startOptions.md) | | 启动Ability所携带的参数。 |
**返回值:**
......@@ -128,6 +130,8 @@ startAbility(want: Want, options?: StartOptions): Promise\<void>;
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -193,6 +197,8 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback&lt;void&
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -239,6 +245,8 @@ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\<
- 跨应用场景下,目标Ability的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
- 组件启动规则详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md)
**需要权限**:ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统API**: 此接口为系统接口,三方应用不支持调用。
......@@ -264,6 +272,8 @@ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\<
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -308,6 +318,8 @@ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, ca
- 跨应用场景下,目标Ability的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
- 组件启动规则详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md)
**需要权限**:ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统API**: 此接口为系统接口,三方应用不支持调用。
......@@ -318,7 +330,7 @@ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, ca
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | 是 | 启动Ability的want信息。 |
| accountId | number | 是 | 系统帐号的帐号ID,详情参考[getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess)。 |
| options | [StartOptions](js-apis-app-ability-startOptions.md) | | 启动Ability所携带的参数。 |
| options | [StartOptions](js-apis-app-ability-startOptions.md) | | 启动Ability所携带的参数。 |
| callback | AsyncCallback\<void\> | 是 | 启动Ability的回调函数。 |
**错误码:**
......@@ -334,6 +346,8 @@ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, ca
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -382,6 +396,8 @@ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions):
- 跨应用场景下,目标Ability的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
- 组件启动规则详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md)
**需要权限**:ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统API**: 此接口为系统接口,三方应用不支持调用。
......@@ -413,6 +429,8 @@ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions):
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -472,10 +490,13 @@ startServiceExtensionAbility(want: Want, callback: AsyncCallback\<void>): void;
| ------- | -------------------------------- |
| 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. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16200001 | The caller has been released. |
......@@ -534,10 +555,13 @@ startServiceExtensionAbility(want: Want): Promise\<void>;
| ------- | -------------------------------- |
| 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. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16200001 | The caller has been released. |
......@@ -574,7 +598,11 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
启动一个新的ServiceExtensionAbility(callback形式)。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS,当accountId为当前用户时,不需要校验该权限。
> **说明:**
>
> 当accountId为当前用户时,不需要校验该权限。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......@@ -594,10 +622,13 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
| ------- | -------------------------------- |
| 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. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16200001 | The caller has been released. |
......@@ -636,7 +667,11 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\
启动一个新的ServiceExtensionAbility(Promise形式)。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS,当accountId为当前用户时,不需要校验该权限。
> **说明:**
>
> 当accountId为当前用户时,不需要校验该权限。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......@@ -661,10 +696,13 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\
| ------- | -------------------------------- |
| 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. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16200001 | The caller has been released. |
......@@ -719,6 +757,7 @@ stopServiceExtensionAbility(want: Want, callback: AsyncCallback\<void>): void;
| ------- | -------------------------------- |
| 16000001 | The specified ability does not exist. |
| 16000002 | Incorrect ability type. |
| 16000004 | Can not start invisible component. |
| 16000005 | The specified process does not have the permission. |
| 16000006 | Cross-user operations are not allowed. |
| 16000011 | The context does not exist. |
......@@ -780,6 +819,7 @@ stopServiceExtensionAbility(want: Want): Promise\<void>;
| ------- | -------------------------------- |
| 16000001 | The specified ability does not exist. |
| 16000002 | Incorrect ability type. |
| 16000004 | Can not start invisible component. |
| 16000005 | The specified process does not have the permission. |
| 16000006 | Cross-user operations are not allowed. |
| 16000011 | The context does not exist. |
......@@ -819,7 +859,11 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
使用帐户停止同一应用程序内的服务(callback形式)。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS,当accountId为当前用户时,不需要校验该权限。
> **说明:**
>
> 当accountId为当前用户时,不需要校验该权限。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......@@ -839,6 +883,7 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
| ------- | -------------------------------- |
| 16000001 | The specified ability does not exist. |
| 16000002 | Incorrect ability type. |
| 16000004 | Can not start invisible component. |
| 16000005 | The specified process does not have the permission. |
| 16000006 | Cross-user operations are not allowed. |
| 16000011 | The context does not exist. |
......@@ -879,7 +924,11 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\<
使用帐户停止同一应用程序内的服务(Promise形式)。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS,当accountId为当前用户时,不需要校验该权限。
> **说明:**
>
> 当accountId为当前用户时,不需要校验该权限。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......@@ -904,6 +953,7 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\<
| ------- | -------------------------------- |
| 16000001 | The specified ability does not exist. |
| 16000002 | Incorrect ability type. |
| 16000004 | Can not start invisible component. |
| 16000005 | The specified process does not have the permission. |
| 16000006 | Cross-user operations are not allowed. |
| 16000011 | The context does not exist. |
......@@ -952,7 +1002,7 @@ terminateSelf(callback: AsyncCallback&lt;void&gt;): void;
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;void&gt; | | 回调函数,返回接口调用是否成功的结果。 |
| callback | AsyncCallback&lt;void&gt; | | 回调函数,返回接口调用是否成功的结果。 |
**错误码:**
......@@ -1049,10 +1099,15 @@ connectServiceExtensionAbility(want: Want, options: ConnectOptions): number;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 16000001 | Input error. The specified ability name does not exist. |
| 16000005 | The specified process does not have the permission. |
| 16000001 | The specified ability does not exist. |
| 16000002 | Incorrect ability type. |
| 16000004 | Can not start invisible component. |
| 16000006 | Cross-user operations are not allowed. |
| 16000008 | The crowdtesting application expires. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
| 16000011 | The context does not exist. |
| 16000050 | Internal Error. |
| 16000050 | Internal error. |
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
......@@ -1087,6 +1142,8 @@ connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options
使用AbilityInfo.AbilityType.SERVICE模板和account将当前能力连接到一个能力。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统API**: 此接口为系统接口,三方应用不支持调用。
......@@ -1097,7 +1154,7 @@ connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | 是 | 启动Ability的want信息。 |
| accountId | number | 是 | 系统帐号的帐号ID,详情参考[getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess)。 |
| options | ConnectOptions | | 远端对象实例。 |
| options | ConnectOptions | | 远端对象实例。 |
**返回值:**
......@@ -1109,10 +1166,15 @@ connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 16000001 | Input error. The specified ability name does not exist. |
| 16000005 | The specified process does not have the permission. |
| 16000001 | The specified ability does not exist. |
| 16000002 | Incorrect ability type. |
| 16000004 | Can not start invisible component. |
| 16000006 | Cross-user operations are not allowed. |
| 16000008 | The crowdtesting application expires. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
| 16000011 | The context does not exist. |
| 16000050 | Internal Error. |
| 16000050 | Internal error. |
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
......@@ -1158,14 +1220,14 @@ disconnectServiceExtensionAbility(connection: number, callback:AsyncCallback&lt;
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| connection | number | 是 | 在connectServiceExtensionAbility中返回的number。 |
| callback | AsyncCallback&lt;void&gt; | | 回调函数,返回接口调用是否成功的结果。 |
| callback | AsyncCallback&lt;void&gt; | | 回调函数,返回接口调用是否成功的结果。 |
**错误码:**
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 16000011 | The context does not exist. |
| 16000050 | Internal Error. |
| 16000050 | Internal error. |
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
......@@ -1220,7 +1282,7 @@ disconnectServiceExtensionAbility(connection: number): Promise&lt;void&gt;;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 16000011 | The context does not exist. |
| 16000050 | Internal Error. |
| 16000050 | Internal error. |
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
......@@ -1260,6 +1322,8 @@ startAbilityByCall(want: Want): Promise&lt;Caller&gt;;
- 跨应用场景下,目标Ability的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
- 同设备与跨设备场景下,该接口的使用规则存在差异,详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md)
**需要权限**: ohos.permission.ABILITY_BACKGROUND_COMMUNICATION
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统API**:此接口为系统接口,三方应用不支持调用。
......@@ -1280,14 +1344,14 @@ startAbilityByCall(want: Want): Promise&lt;Caller&gt;;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 16000001 | Input error. The specified ability name does not exist. |
| 16000001 | The specified ability does not exist. |
| 16000002 | Incorrect ability type. |
| 16000004 | Visibility verification failed. |
| 16000004 | Can not start invisible component. |
| 16000005 | Static permission denied. The specified process does not have the permission. |
| 16000006 | Cross-user operations are not allowed. |
| 16000008 | Crowdtest App Expiration. |
| 16000008 | The crowdtesting application expires. |
| 16000011 | The context does not exist. |
| 16000050 | Internal Error. |
| 16000050 | Internal error. |
| 16200001 | The caller has been released. |
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
......@@ -1356,7 +1420,7 @@ startAbilityByCall(want: Want): Promise&lt;Caller&gt;;
```
## UIAbilityContext.startRecentAbility
startRecentAbility(want: Want, callback: AsyncCallback&lt;void&lt;): void;
startRecentAbility(want: Want, callback: AsyncCallback\<void>): void;
启动一个指定的Ability,如果这个Ability有多个实例,将拉起最近启动的那个实例。启动结果以callback的形式返回开发者。
......@@ -1421,7 +1485,7 @@ try {
```
## UIAbilityContext.startRecentAbility
startRecentAbility(want: Want, options: StartOptions, callback: AsyncCallback&lt;void&lt;): void;
startRecentAbility(want: Want, options: StartOptions, callback: AsyncCallback\<void>): void;
启动一个指定的Ability,如果这个Ability有多个实例,将拉起最近启动的那个实例。启动结果以callback的形式返回开发者。
当开发者需要携带启动参数时可以选择此API。
......@@ -1492,7 +1556,7 @@ try {
```
## UIAbilityContext.startRecentAbility
startRecentAbility(want: Want, options?: StartOptions): Promise&lt;void&lt;;
startRecentAbility(want: Want, options?: StartOptions): Promise\<void>;
启动一个指定的Ability,如果这个Ability有多个实例,将拉起最近启动的那个实例。
当开发者期望启动结果以Promise形式返回时可以选择此API。
......@@ -1572,6 +1636,8 @@ startAbilityByCallWithAccount(want: Want, accountId: number): Promise&lt;Caller&
- 跨应用场景下,目标Ability的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
- 同设备与跨设备场景下,该接口的使用规则存在差异,详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md)
**需要权限**: ohos.permission.ABILITY_BACKGROUND_COMMUNICATION, ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统API**:此接口为系统接口,三方应用不支持调用。
......@@ -1595,14 +1661,16 @@ startAbilityByCallWithAccount(want: Want, accountId: number): Promise&lt;Caller&
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 16000001 | Input error. The specified ability name does not exist. |
| 16000001 | The specified ability does not exist. |
| 16000002 | Incorrect ability type. |
| 16000004 | Visibility verification failed. |
| 16000004 | Can not start invisible component. |
| 16000005 | Static permission denied. The specified process does not have the permission. |
| 16000006 | Cross-user operations are not allowed. |
| 16000008 | Crowdtest App Expiration. |
| 16000008 | The crowdtesting application expires. |
| 16000011 | The context does not exist. |
| 16000050 | Internal Error. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16200001 | The caller has been released. |
**示例:**
......
......@@ -58,8 +58,10 @@ startAbility(want: Want, callback: AsyncCallback&lt;void&gt;): void;
| 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. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -114,6 +116,7 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback&lt;void&
**错误码:**
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 16000001 | The specified ability does not exist. |
......@@ -123,8 +126,10 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback&lt;void&
| 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. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -197,8 +202,10 @@ startAbility(want: Want, options?: StartOptions): Promise&lt;void&gt;;
| 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. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -462,7 +469,11 @@ startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncC
- 跨应用场景下,目标Ability的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
- 组件启动规则详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md)
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS,当accountId为当前用户时,不需要校验该权限。
> **说明:**
>
> 当accountId为当前用户时,不需要校验该权限。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......@@ -489,6 +500,8 @@ startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncC
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -534,7 +547,11 @@ startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOp
- 跨应用场景下,目标Ability的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
- 组件启动规则详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md)
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS,当accountId为当前用户时,不需要校验该权限。
> **说明:**
>
> 当accountId为当前用户时,不需要校验该权限。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......@@ -562,6 +579,8 @@ startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOp
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -610,7 +629,11 @@ startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartO
- 跨应用场景下,目标Ability的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
- 组件启动规则详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md)
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS,当accountId为当前用户时,不需要校验该权限。
> **说明:**
>
> 当accountId为当前用户时,不需要校验该权限。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......@@ -643,6 +666,8 @@ startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartO
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -701,10 +726,13 @@ startServiceExtensionAbility(want: Want, callback: AsyncCallback\<void>): void;
| ------- | -------------------------------- |
| 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. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16200001 | The caller has been released. |
......@@ -757,10 +785,13 @@ startServiceExtensionAbility(want: Want): Promise\<void>;
| ------- | -------------------------------- |
| 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. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16200001 | The caller has been released. |
......@@ -797,7 +828,11 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
启动一个新的ServiceExtensionAbility(callback形式)。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS,当accountId为当前用户时,不需要校验该权限。
> **说明:**
>
> 当accountId为当前用户时,不需要校验该权限。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......@@ -817,10 +852,13 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
| ------- | -------------------------------- |
| 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. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16200001 | The caller has been released. |
......@@ -858,7 +896,11 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\
启动一个新的ServiceExtensionAbility(Promise形式)。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS,当accountId为当前用户时,不需要校验该权限。
> **说明:**
>
> 当accountId为当前用户时,不需要校验该权限。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......@@ -877,10 +919,13 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\
| ------- | -------------------------------- |
| 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. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16200001 | The caller has been released. |
......@@ -937,6 +982,8 @@ stopServiceExtensionAbility(want: Want, callback: AsyncCallback\<void>): void;
| 16000005 | The specified process does not have the permission. |
| 16000006 | Cross-user operations are not allowed. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16200001 | The caller has been released. |
......@@ -989,9 +1036,12 @@ stopServiceExtensionAbility(want: Want): Promise\<void>;
| ------- | -------------------------------- |
| 16000001 | The specified ability does not exist. |
| 16000002 | Incorrect ability type. |
| 16000004 | Can not start invisible component. |
| 16000005 | The specified process does not have the permission. |
| 16000006 | Cross-user operations are not allowed. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16200001 | The caller has been released. |
......@@ -1028,7 +1078,11 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
停止同一应用程序内指定账户的服务(callback形式)。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS,当accountId为当前用户时,不需要校验该权限。
> **说明:**
>
> 当accountId为当前用户时,不需要校验该权限。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......@@ -1048,6 +1102,7 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
| ------- | -------------------------------- |
| 16000001 | The specified ability does not exist. |
| 16000002 | Incorrect ability type. |
| 16000004 | Can not start invisible component. |
| 16000005 | The specified process does not have the permission. |
| 16000006 | Cross-user operations are not allowed. |
| 16000011 | The context does not exist. |
......@@ -1088,7 +1143,11 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\<
停止同一应用程序内指定账户的服务(Promise形式)。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS,当accountId为当前用户时,不需要校验该权限。
> **说明:**
>
> 当accountId为当前用户时,不需要校验该权限。
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......@@ -1107,6 +1166,7 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\<
| ------- | -------------------------------- |
| 16000001 | The specified ability does not exist. |
| 16000002 | Incorrect ability type. |
| 16000004 | Can not start invisible component. |
| 16000005 | The specified process does not have the permission. |
| 16000006 | Cross-user operations are not allowed. |
| 16000011 | The context does not exist. |
......@@ -1383,8 +1443,13 @@ connectServiceExtensionAbility(want: Want, options: ConnectOptions): number;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 16000001 | The specified ability does not exist. |
| 16000005 | The specified process does not have the permission. |
| 16000011 | The context does not exist. |
| 16000002 | Incorrect ability type. |
| 16000004 | Can not start invisible component. |
| 16000006 | Cross-user operations are not allowed. |
| 16000008 | The crowdtesting application expires. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
| 16000011 | The context does not exist. |
| 16000050 | Internal error. |
错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
......@@ -1427,7 +1492,11 @@ connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options
将当前Ability连接到一个使用AbilityInfo.AbilityType.SERVICE模板的指定account的Ability。
**需要权限:** ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS,当accountId为当前用户时,不需要校验该权限。
> **说明:**
>
> 当accountId为当前用户时,不需要校验该权限。
**需要权限:** ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......@@ -1452,8 +1521,13 @@ connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 16000001 | The specified ability does not exist. |
| 16000005 | The specified process does not have the permission. |
| 16000011 | The context does not exist. |
| 16000002 | Incorrect ability type. |
| 16000004 | Can not start invisible component. |
| 16000006 | Cross-user operations are not allowed. |
| 16000008 | The crowdtesting application expires. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
| 16000011 | The context does not exist. |
| 16000050 | Internal error. |
错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
......@@ -1621,6 +1695,8 @@ startAbilityByCall(want: Want): Promise&lt;Caller&gt;;
- 跨应用场景下,目标Ability的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
- 同设备与跨设备场景下,该接口的使用规则存在差异,详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md)
**需要权限:** ohos.permission.ABILITY_BACKGROUND_COMMUNICATION
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**参数:**
......@@ -1646,6 +1722,8 @@ startAbilityByCall(want: Want): Promise&lt;Caller&gt;;
| 16000006 | Cross-user operations are not allowed. |
| 16000008 | The crowdtesting application expires. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16200001 | The caller has been released. |
......@@ -1725,7 +1803,11 @@ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\<
- 跨应用场景下,目标Ability的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
- 组件启动规则详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md)
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS,当accountId为当前用户时,不需要校验该权限。
> **说明:**
>
> 当accountId为当前用户时,不需要校验该权限。
**需要权限:** ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......@@ -1752,6 +1834,8 @@ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\<
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -1797,7 +1881,11 @@ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, ca
- 跨应用场景下,目标Ability的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
- 组件启动规则详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md)
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS,当accountId为当前用户时,不需要校验该权限。
> **说明:**
>
> 当accountId为当前用户时,不需要校验该权限。
**需要权限:** ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......@@ -1825,6 +1913,8 @@ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, ca
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -1873,7 +1963,11 @@ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions):
- 跨应用场景下,目标Ability的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
- 组件启动规则详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md)
**需要权限**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS,当accountId为当前用户时,不需要校验该权限。
> **说明:**
>
> 当accountId为当前用户时,不需要校验该权限。
**需要权限:** ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
......@@ -1900,6 +1994,8 @@ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions):
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -2129,7 +2225,7 @@ restoreWindowStage(localStorage: LocalStorage) : void;
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| localStorage | image.LocalStorage | 是 | 用于恢复window stage的存储数据。 |
| localStorage | LocalStorage | 是 | 用于恢复window stage的存储数据。 |
**错误码:**
......@@ -2209,6 +2305,8 @@ requestDialogService(want: Want, result: AsyncCallback&lt;dialogRequest.RequestR
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -2282,6 +2380,8 @@ requestDialogService(want: Want): Promise&lt;dialogRequest.RequestResult&gt;;
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -2316,7 +2416,7 @@ try {
```
## UIAbilityContext.startRecentAbility
startRecentAbility(want: Want, callback: AsyncCallback&lt;void&lt;): void;
startRecentAbility(want: Want, callback: AsyncCallback&lt;void&gt;): void;
启动一个指定的Ability,如果这个Ability有多个实例,将拉起最近启动的那个实例。启动结果以callback的形式返回开发者。
......@@ -2351,6 +2451,8 @@ startRecentAbility(want: Want, callback: AsyncCallback&lt;void&lt;): void;
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -2381,7 +2483,7 @@ try {
```
## UIAbilityContext.startRecentAbility
startRecentAbility(want: Want, options: StartOptions, callback: AsyncCallback&lt;void&lt;): void;
startRecentAbility(want: Want, options: StartOptions, callback: AsyncCallback&lt;void&gt;): void;
启动一个指定的Ability,如果这个Ability有多个实例,将拉起最近启动的那个实例。启动结果以callback的形式返回开发者。
当开发者需要携带启动参数时可以选择此API。
......@@ -2418,6 +2520,8 @@ startRecentAbility(want: Want, options: StartOptions, callback: AsyncCallback&lt
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -2452,7 +2556,7 @@ try {
```
## UIAbilityContext.startRecentAbility
startRecentAbility(want: Want, options?: StartOptions): Promise&lt;void&lt;;
startRecentAbility(want: Want, options?: StartOptions): Promise&lt;void&gt;;
启动一个指定的Ability,如果这个Ability有多个实例,将拉起最近启动的那个实例。
当开发者期望启动结果以Promise形式返回时可以选择此API。
......@@ -2488,6 +2592,8 @@ startRecentAbility(want: Want, options?: StartOptions): Promise&lt;void&lt;;
| 16000009 | An ability cannot be started or stopped in Wukong mode. |
| 16000010 | The call with the continuation flag is forbidden. |
| 16000011 | The context does not exist. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16000053 | The ability is not on the top of the UI. |
| 16000055 | Installation-free timed out. |
......@@ -2520,7 +2626,7 @@ try {
}
```
## UIAbilityContext.startAbilityByCallWithAccount
## UIAbilityContext.startAbilityByCallWithAccount<sup>10+</sup>
startAbilityByCallWithAccount(want: Want, accountId: number): Promise&lt;Caller&gt;;
......@@ -2532,6 +2638,8 @@ startAbilityByCallWithAccount(want: Want, accountId: number): Promise&lt;Caller&
- 跨应用场景下,目标Ability的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限
- 同设备与跨设备场景下,该接口的使用规则存在差异,详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md)
**需要权限**: ohos.permission.ABILITY_BACKGROUND_COMMUNICATION, ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统API**:此接口为系统接口,三方应用不支持调用。
......@@ -2553,14 +2661,16 @@ startAbilityByCallWithAccount(want: Want, accountId: number): Promise&lt;Caller&
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 16000001 | Input error. The specified ability name does not exist. |
| 16000001 | The specified ability does not exist. |
| 16000002 | Incorrect ability type. |
| 16000004 | Visibility verification failed. |
| 16000004 | Can not start invisible component. |
| 16000005 | Static permission denied. The specified process does not have the permission. |
| 16000006 | Cross-user operations are not allowed. |
| 16000008 | Crowdtest App Expiration. |
| 16000008 | The crowdtesting application expires. |
| 16000011 | The context does not exist. |
| 16000050 | Internal Error. |
| 16000012 | The application is controlled. |
| 16000013 | The application is controlled by EDM. |
| 16000050 | Internal error. |
| 16200001 | The caller has been released. |
以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册