提交 185f58d4 编写于 作者: D donglin

ability

Signed-off-by: Ndonglin <donglin9@huawei.com>
Change-Id: I476f087bc0940427b27e694128831665a2e90aaa
上级 0963cc44
......@@ -53,7 +53,7 @@ startAbility(want: Want, callback: AsyncCallback&lt;void&gt;): void;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -103,7 +103,7 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback&lt;void&
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -161,7 +161,7 @@ startAbility(want: Want, options?: StartOptions): Promise&lt;void&gt;;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -213,7 +213,7 @@ startAbilityForResult(want: Want, callback: AsyncCallback&lt;AbilityResult&gt;):
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -264,7 +264,7 @@ startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -325,7 +325,7 @@ startAbilityForResult(want: Want, options?: StartOptions): Promise&lt;AbilityRes
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -381,7 +381,7 @@ startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncC
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -439,7 +439,7 @@ startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOp
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -505,7 +505,7 @@ startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartO
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -560,7 +560,7 @@ startServiceExtensionAbility(want: Want, callback: AsyncCallback\<void>): void;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -610,7 +610,7 @@ startServiceExtensionAbility(want: Want): Promise\<void>;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -664,7 +664,7 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -718,7 +718,7 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -769,7 +769,7 @@ stopServiceExtensionAbility(want: Want, callback: AsyncCallback\<void>): void;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -819,7 +819,7 @@ stopServiceExtensionAbility(want: Want): Promise\<void>;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -873,7 +873,7 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -927,7 +927,7 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\<
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -976,7 +976,7 @@ terminateSelf(callback: AsyncCallback&lt;void&gt;): void;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -1013,7 +1013,7 @@ terminateSelf(): Promise&lt;void&gt;;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -1049,7 +1049,7 @@ terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback&lt;voi
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -1109,7 +1109,7 @@ terminateSelfWithResult(parameter: AbilityResult): Promise&lt;void&gt;;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
......@@ -1160,7 +1160,7 @@ connectServiceExtensionAbility(want: Want, options: ConnectOptions): number;
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-want.md) | 是 | 启动Ability的want信息。 |
| options | [ConnectOptions](js-apis-inner-ability-connectOptions.md) | | 远端对象实例。 |
| options | [ConnectOptions](js-apis-inner-ability-connectOptions.md) | | 远端对象实例。 |
**返回值:**
......@@ -1172,7 +1172,7 @@ connectServiceExtensionAbility(want: Want, options: ConnectOptions): number;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -1218,7 +1218,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](js-apis-inner-ability-connectOptions.md) | | 远端对象实例。 |
| options | [ConnectOptions](js-apis-inner-ability-connectOptions.md) | | 远端对象实例。 |
**返回值:**
......@@ -1230,7 +1230,7 @@ connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -1266,8 +1266,6 @@ disconnectServiceExtensionAbility(connection: number): Promise\<void>;
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统API**: 此接口为系统接口,三方应用不支持调用。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1284,7 +1282,7 @@ disconnectServiceExtensionAbility(connection: number): Promise\<void>;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -1319,8 +1317,6 @@ disconnectServiceExtensionAbility(connection: number, callback:AsyncCallback\<vo
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统API**: 此接口为系统接口,三方应用不支持调用。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1332,7 +1328,7 @@ disconnectServiceExtensionAbility(connection: number, callback:AsyncCallback\<vo
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -1367,6 +1363,8 @@ startAbilityByCall(want: Want): Promise&lt;Caller&gt;;
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统API**: 此接口为系统接口,三方应用不支持调用。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -1470,7 +1468,7 @@ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\<
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -1520,14 +1518,14 @@ 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-application-startOptions.md) | | 启动Ability所携带的参数。 |
| options | [StartOptions](js-apis-application-startOptions.md) | | 启动Ability所携带的参数。 |
| callback | AsyncCallback\<void\> | 是 | 启动Ability的回调函数。 |
**错误码:**
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -1586,7 +1584,7 @@ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions):
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
| 401 | Invalid input parameter. |
| 401 | If the input parameter is not valid parameter. |
其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md)
**示例:**
......@@ -1835,7 +1833,7 @@ restoreWindowStage(localStorage: LocalStorage) : void;
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| localStorage | image.LocalStorage | 是 | 用于恢复window stage的存储数据。 |
| localStorage | LocalStorage | 是 | 用于恢复window stage的存储数据。 |
**示例:**
......
......@@ -15,7 +15,7 @@ import Ability from '@ohos.app.ability.Ability';
## Ability.onConfigurationUpdate
onConfigurationUpdate(config: Configuration): void;
onConfigurationUpdate(newConfig: Configuration): void;
当系统配置更新时调用。
......@@ -25,7 +25,7 @@ onConfigurationUpdate(config: Configuration): void;
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| config | [Configuration](js-apis-app-ability-configuration.md) | 是 | 表示需要更新的配置信息。 |
| newConfig | [Configuration](js-apis-app-ability-configuration.md) | 是 | 表示需要更新的配置信息。 |
**示例:**
......
......@@ -155,64 +155,6 @@ getAppMemorySize(callback: AsyncCallback\<number>): void;
console.log('startAbility result success:' + JSON.stringify(data));
})
```
## appManager.getProcessRunningInfos<sup>(deprecated)</sup>
getProcessRunningInfos(): Promise\<Array\<ProcessRunningInfo>>;
获取有关运行进程的信息。
> 从 API Version 9 开始废弃,建议使用[appManager.getProcessRunningInformation<sup>9+</sup>](#appmanagergetprocessrunninginformation9)替代。
**需要权限**:ohos.permission.GET_RUNNING_INFO
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统API**: 此接口为系统接口,三方应用不支持调用。
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Promise\<Array\<ProcessRunningInfo>> | 获取有关运行进程的信息。 |
**示例:**
```ts
app.getProcessRunningInfos().then((data) => {
console.log('success:' + JSON.stringify(data));
}).catch((error) => {
console.log('failed:' + JSON.stringify(error));
});
```
## appManager.getProcessRunningInfos<sup>(deprecated)</sup>
getProcessRunningInfos(callback: AsyncCallback\<Array\<ProcessRunningInfo>>): void;
获取有关运行进程的信息。
> 从 API Version 9 开始废弃,建议使用[appManager.getProcessRunningInformation<sup>9+</sup>](#appmanagergetprocessrunninginformation9-1)替代。
**需要权限**:ohos.permission.GET_RUNNING_INFO
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统API**: 此接口为系统接口,三方应用不支持调用。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback\<Array\<ProcessRunningInfo>> | 否 | 获取有关运行进程的信息。 |
**示例:**
```ts
app.getProcessRunningInfos((err, data) => {
console.log('startAbility result failed :' + JSON.stringify(err));
console.log('startAbility result success:' + JSON.stringify(data));
})
```
## appManager.getProcessRunningInformation<sup>9+</sup>
......@@ -252,6 +194,8 @@ getProcessRunningInformation(callback: AsyncCallback\<Array\<ProcessRunningInfor
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统API**: 此接口为系统接口,三方应用不支持调用。
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
......@@ -418,7 +362,7 @@ off(type: "applicationState", observerId: number): Promise\<void>;
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| type | string | 是 | 调用接口类型 |
| observerId | number | | 表示观察者的编号代码。 |
| observerId | number | | 表示观察者的编号代码。 |
**返回值:**
......
......@@ -169,7 +169,7 @@ getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback&lt;M
| -------- | -------- | -------- | -------- |
| deviceId | string | 是 | 设备ID,本机默认为空字符串。 |
| missionId | number | 是 | 任务ID。 |
| callback | AsyncCallback&lt;[MissionInfo](#missioninfo)&gt; | 是 | 执行结果回调函数,返回任务信息。 |
| callback | AsyncCallback&lt;[MissionInfo](./js-apis-inner-application-missionInfo.md))&gt; | 是 | 执行结果回调函数,返回任务信息。 |
**示例:**
......@@ -216,7 +216,7 @@ getMissionInfo(deviceId: string, missionId: number): Promise&lt;MissionInfo&gt;;
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;[MissionInfo](#missioninfo)&gt; | 任务信息。 |
| Promise&lt;[MissionInfo](./js-apis-inner-application-missionInfo.md)&gt; | 任务信息。 |
**示例:**
......@@ -251,7 +251,7 @@ getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback&lt;Arr
| -------- | -------- | -------- | -------- |
| deviceId | string | 是 | 设备ID,本机默认为空字符串。 |
| numMax | number | 是 | 任务信息数量上限。 |
| callback | AsyncCallback&lt;Array&lt;[MissionInfo](#missioninfo)&gt;&gt; | 是 | 执行结果回调函数,返回任务信息数组。 |
| callback | AsyncCallback&lt;Array&lt;[MissionInfo](./js-apis-inner-application-missionInfo.md)&gt;&gt; | 是 | 执行结果回调函数,返回任务信息数组。 |
**示例:**
......@@ -293,7 +293,7 @@ getMissionInfos(deviceId: string, numMax: number): Promise&lt;Array&lt;MissionIn
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;Array&lt;[MissionInfo](#missioninfo)&gt;&gt; | 任务信息数组。 |
| Promise&lt;Array&lt;[MissionInfo](./js-apis-inner-application-missionInfo.md)&gt;&gt; | 任务信息数组。 |
**示例:**
......@@ -938,22 +938,3 @@ moveMissionToFront(missionId: number, options?: StartOptions): Promise&lt;void&g
console.log("error: " + paramError.code + ", " + paramError.message);
}
```
## MissionInfo
表示Ability对应任务信息的枚举。
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Mission
**系统API**: 此接口为系统接口,三方应用不支持调用。
| 名称 | 类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- |
| missionId | number | 是 | 是 | 表示任务ID。|
| runningState | number | 是 | 是 | 表示运行状态。 |
| lockedState | boolean | 是 | 是 | 表示锁定状态。 |
| timestamp | string | 是 | 是 | 表示任务的最近创建或更新时间。 |
| want | [Want](js-apis-application-want.md) | 是 | 是 | 表示任务的Want信息。 |
| label | string | 是 | 是 | 表示任务的标签。 |
| iconPath | string | 是 | 是 | 表示任务的图标路径。 |
| continuable | boolean | 是 | 是 | 表示任务是否可以迁移。 |
......@@ -200,7 +200,7 @@ onReconnect(want: Want): void;
## ServiceExtensionAbility.onConfigurationUpdate
onConfigurationUpdate(config: Configuration): void;
onConfigurationUpdate(newConfig: Configuration): void;
当Extension更新配置信息时调用。
......@@ -212,7 +212,7 @@ onConfigurationUpdate(config: Configuration): void;
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| config | [Configuration](js-apis-app-ability-configuration.md) | 是 | 表示需要更新的配置信息。 |
| newConfig | [Configuration](js-apis-app-ability-configuration.md) | 是 | 表示需要更新的配置信息。 |
**示例:**
......@@ -230,7 +230,7 @@ onDump(params: Array\<string>): Array\<string>;
转储客户端信息时调用。
**系统能力**:SystemCapability.Ability.AbilityRuntime.AbilityCore
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**系统API**: 此接口为系统接口,三方应用不支持调用。
......
......@@ -515,6 +515,48 @@ release(): void;
}
```
## Caller.onRelease
onRelease(callback: OnReleaseCallBack): void;
注册通用组件服务端Stub(桩)断开监听通知。
**系统能力**:SystemCapability.Ability.AbilityRuntime.AbilityCore
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| callback | OnReleaseCallBack | 是 | 返回onRelease回调结果。 |
**示例:**
```ts
import Ability from '@ohos.application.Ability';
var caller;
export default class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
this.context.startAbilityByCall({
bundleName: "com.example.myservice",
abilityName: "MainAbility",
deviceId: ""
}).then((obj) => {
caller = obj;
try {
caller.onRelease((str) => {
console.log(' Caller OnRelease CallBack is called ' + str);
});
} catch (error) {
console.log('Caller.on catch error, error.code: ' + JSON.stringify(error.code) +
' error.message: ' + JSON.stringify(error.message));
}
}).catch((err) => {
console.log('Caller GetCaller error, error.code: ' + JSON.stringify(err.code) +
' error.message: ' + JSON.stringify(err.message));
});
}
}
```
## Caller.on
......@@ -529,7 +571,7 @@ release(): void;
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| type | string | 是 | 监听releaseCall事件,固定为'release'。 |
| callback | OnReleaseCallBack | 是 | 返回onRelease回调结果。 |
| callback | OnReleaseCallback | 是 | 返回onRelease回调结果。 |
**错误码:**
......
......@@ -1110,22 +1110,6 @@ try {
}
```
## WantAgentInfo
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 类型 | 必填 | 说明 |
| -------------- | ------------------------------- | ---- | ---------------------- |
| wants | Array\<Want\> | 是 | 将被执行的动作列表。 |
| operationType | wantAgent.OperationType | 是 | 动作类型。 |
| requestCode | number | 是 | 使用者定义的一个私有值。 |
| wantAgentFlags | Array<wantAgent.WantAgentFlags> | 否 | 动作执行属性。 |
| extraInfo | {[key: string]: any} | 否 | 额外数据。 |
## WantAgentFlags
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
......@@ -1171,15 +1155,3 @@ try {
| finalData | string | 否 | 公共事件收集的最终数据。 |
| extraInfo | {[key: string]: any} | 否 | 额外数据。 |
## TriggerInfo
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 类型 | 必填 | 说明 |
| ---------- | -------------------- | ---- | ----------- |
| code | number | 是 | result code。 |
| want | Want | 否 | Want。 |
| permission | string | 否 | 权限定义。 |
| extraInfo | {[key: string]: any} | 否 | 额外数据。 |
\ No newline at end of file
......@@ -240,6 +240,30 @@ onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void;
}
```
## Ability.onConfigurationUpdated
onConfigurationUpdated(config: Configuration): void;
环境变化通知接口,发生全局配置变更时回调。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| config | [Configuration](js-apis-application-configuration.md) | 是 | 发生全局配置变更时触发回调,当前全局配置包括系统语言、深浅色模式。 |
**示例:**
```ts
class myAbility extends Ability {
onConfigurationUpdated(config) {
console.log('onConfigurationUpdated, language:' + config.language);
}
}
```
## Ability.dump
dump(params: Array\<string>): Array\<string>;
......@@ -265,6 +289,29 @@ dump(params: Array\<string>): Array\<string>;
}
```
## Ability.onMemoryLevel
onMemoryLevel(level: AbilityConstant.MemoryLevel): void;
当系统已决定调整内存时调用。例如,当该功能在后台运行时,没有足够的内存来运行尽可能多的后台进程时可以使用。
**系统能力**:SystemCapability.Ability.AbilityRuntime.AbilityCore
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| level | [AbilityConstant.MemoryLevel](js-apis-application-abilityConstant.md#abilityconstantmemorylevel) | 是 | 回调返回内存微调级别,显示当前内存使用状态。|
**示例:**
```ts
class myAbility extends Ability {
onMemoryLevel(level) {
console.log('onMemoryLevel, level:' + JSON.stringify(level));
}
}
```
## Ability.onSaveState
......
......@@ -1049,17 +1049,6 @@ WantAgent.getOperationType(wantAgent).then((OperationType) => {
})
```
## WantAgentInfo
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 类型 | 必填 | 说明 |
| -------------- | ------------------------------- | ---- | ---------------------- |
| wants | Array\<Want\> | 是 | 将被执行的动作列表。 |
| operationType | wantAgent.OperationType | 是 | 动作类型。 |
| requestCode | number | 是 | 使用者定义的一个私有值。 |
| wantAgentFlags | Array<wantAgent.WantAgentFlags> | 否 | 动作执行属性。 |
| extraInfo | {[key: string]: any} | 否 | 额外数据。 |
## WantAgentFlags
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册