diff --git a/en/application-dev/reference/apis/js-apis-particleAbility.md b/en/application-dev/reference/apis/js-apis-particleAbility.md index fdeb2c639f496331410ad5c19dac882ea3ac74d4..fa68ababf9d5b4af6108f5b835a5249ad2fe59ec 100644 --- a/en/application-dev/reference/apis/js-apis-particleAbility.md +++ b/en/application-dev/reference/apis/js-apis-particleAbility.md @@ -14,7 +14,7 @@ import particleAbility from '@ohos.ability.particleAbility' startAbility(parameter: StartAbilityParameter, callback: AsyncCallback\: void -Starts a Service ability. This method uses a callback to return the result. +Starts a particle ability. This method uses a callback to return the result. **Parameters** @@ -28,6 +28,7 @@ Starts a Service ability. This method uses a callback to return the result. ```js import particleAbility from '@ohos.ability.particleAbility' +import wantConstant from '@ohos.ability.wantConstant' particleAbility.startAbility( { want: @@ -35,7 +36,7 @@ particleAbility.startAbility( action: "action.system.home", entities: ["entity.system.home"], type: "MIMETYPE", - flags: FLAG_AUTH_READ_URI_PERMISSION; + flags: wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION, deviceId: "", bundleName: "com.example.Data", abilityName: "com.example.Data.MainAbility", @@ -53,7 +54,7 @@ particleAbility.startAbility( ## particleAbility.startAbility startAbility(parameter: StartAbilityParameter): Promise\ -Starts a Service ability. This method uses a promise to return the result. +Starts a particle ability. This method uses a promise to return the result. **Parameters** @@ -70,6 +71,7 @@ Starts a Service ability. This method uses a promise to return the result. ```js import particleAbility from '@ohos.ability.particleAbility' +import wantConstant from '@ohos.ability.wantConstant' particleAbility.startAbility( { want: @@ -77,14 +79,14 @@ particleAbility.startAbility( action: "action.system.home", entities: ["entity.system.home"], type: "MIMETYPE", - flags: FLAG_AUTH_READ_URI_PERMISSION; + flags: wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION, deviceId: "", bundleName: "com.example.Data", - abilityName: "com.example.Data.MainAbility", + abilityName: "com.example. Data.MainAbility", uri:"" }, }, -).then((void) => { +).then((data) => { console.info("particleAbility startAbility"); }); ``` @@ -95,7 +97,7 @@ particleAbility.startAbility( terminateSelf(callback: AsyncCallback\): void -Terminates this Service ability. This method uses a callback to return the result. +Terminates this particle ability. This method uses a callback to return the result. **Parameters** @@ -120,7 +122,7 @@ particleAbility.terminateSelf( terminateSelf(): Promise\ -Terminates this Service ability. This method uses a promise to return the result. +Terminates this particle ability. This method uses a promise to return the result. **Return value** | Type| Description| @@ -131,7 +133,7 @@ Terminates this Service ability. This method uses a promise to return the result ```js import particleAbility from '@ohos.ability.particleAbility' -particleAbility.terminateSelf().then((void) => { +particleAbility.terminateSelf().then((data) => { console.info("particleAbility terminateSelf"); }); ``` @@ -164,148 +166,6 @@ var uri = ""; particleAbility.acquireDataAbilityHelper(uri) ``` -## particleAbility.connectAbility - -connectAbility(request: Want, options:ConnectOptions): number - -Connects this ability to a specific Service ability. This method uses a callback to return the result. - -**Parameters** - -| Name| Type| Mandatory| Description| -| ------- | -------------- | ---- | -------------------------- | -| request | [Want](#want) | Yes| Service ability to connect.| -| options | ConnectOptions | Yes| Callback used to return the result.| - -ConnectOptions - -| Name| Readable/Writable| Type| Mandatory| Description| -| ------------ | -------- | -------- | ---- | ---------------------------------- | -| onConnect | Read-only| function | Yes| Callback invoked when the connection is set up.| -| onDisconnect | Read-only| function | Yes| Callback invoked when the connection is interrupted.| -| onFailed | Read-only| function | Yes| Callback invoked when the connection fails.| - -**Return value** -| Type| Description| -| ------ | -------------------------- | -| number | Unique identifier of the connection between the client and the service side.| - -**Example** - -```javascript -import particleAbility from '@ohos.ability.particleAbility' -function onConnectCallback(element, remote){ - console.log('ConnectAbility onConnect remote is proxy:' + (remote instanceof rpc.RemoteProxy)); -} -function onDisconnectCallback(element){ - console.log('ConnectAbility onDisconnect element.deviceId : ' + element.deviceId) -} -function onFailedCallback(code){ - console.log('particleAbilityTest ConnectAbility onFailed errCode : ' + code) -} -var connId = particleAbility.connectAbility( - { - bundleName: "com.ix.ServiceAbility", - abilityName: "com.ix.ServiceAbility.ServiceAbilityA", - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - }, -); -``` - -## particleAbility.disconnectAbility - -disconnectAbility(connection: number, callback:AsyncCallback\): void - -Disconnects this ability from a specific Service ability. This method uses a callback to return the result. - -**Parameters** - -| Name| Type| Mandatory| Description| -| ---------- | ------------- | ---- | ------------------------------ | -| connection | number | Yes| ID of the Service ability to disconnect.| -| callback | AsyncCallback\ | Yes| Callback used to return the result.| - -**Example** - -```javascript -import particleAbility from '@ohos.ability.particleAbility' -function onConnectCallback(element, remote){ - console.log('ConnectAbility onConnect remote is proxy:' + (remote instanceof rpc.RemoteProxy)); -} -function onDisconnectCallback(element){ - console.log('ConnectAbility onDisconnect element.deviceId : ' + element.deviceId) -} -function onFailedCallback(code){ - console.log('particleAbilityTest ConnectAbility onFailed errCode : ' + code) -} -var connId = particleAbility.connectAbility( - { - bundleName: "com.ix.ServiceAbility", - abilityName: "com.ix.ServiceAbility.ServiceAbilityA", - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - }, -); -var result = particleAbility.disconnectAbility(connId, - (error,data) => { - console.log('particleAbilityTest DisConnectAbility result errCode : ' + error.code + " data: " + data) - }, -); -``` - -## particleAbility.disconnectAbility - -disconnectAbility(connection: number): Promise\ - -Disconnects this ability from a specific Service ability. This method uses a promise to return the result. - -**Parameters** - -| Name| Type| Mandatory| Description| -| ---------- | ------ | ---- | ------------------------------ | -| connection | number | Yes| ID of the Service ability to disconnect.| - -**Return value** -| Type| Description| -| -------------- | ------------------------- | -| Promise\ | Promise used to return the result.| - -**Example** - -```javascript -import particleAbility from '@ohos.ability.particleAbility' -function onConnectCallback(element, remote){ - console.log('ConnectAbility onConnect remote is proxy:' + (remote instanceof rpc.RemoteProxy)); -} -function onDisconnectCallback(element){ - console.log('ConnectAbility onDisconnect element.deviceId : ' + element.deviceId) -} -function onFailedCallback(code){ - console.log('particleAbilityTest ConnectAbility onFailed errCode : ' + code) -} -var connId = particleAbility.connectAbility( - { - bundleName: "com.ix.ServiceAbility", - abilityName: "com.ix.ServiceAbility.ServiceAbilityA", - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - }, -); -var result = particleAbility.disconnectAbility(connId).then((void) => { - console.info("particleAbilityTest disconnectAbility"); -}); -``` - ## StartAbilityParameter | Name| Readable/Writable| Type| Mandatory| Description| @@ -371,3 +231,170 @@ Defines the window display modes of a Page ability, for example, **featureAbilit | WINDOW_MODE_SPLIT_PRIMARY | 100 | The Page ability is displayed in the primary window when it is in split-screen mode.| | WINDOW_MODE_SPLIT_SECONDARY | 101 | The Page ability is displayed in the secondary window when it is in split-screen mode.| | WINDOW_MODE_FLOATING | 102 | The Page ability is displayed in floating window mode.| + + +## particleAbility.startBackgroundRunning + +startBackgroundRunning(id: number, request: NotificationRequest, callback: AsyncCallback<void>): void; + +Requests a continuous task from the system. This method uses an asynchronous callback to return the result. (This method is of API 7 and will be deprecated. Use the counterpart in API 8.) + +- **Parameters** + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | id | number | Yes| Notification ID of a continuous task.| + | request | NotificationRequest | Yes| Notification parameter, which is used to display information in the notification bar.| + | callback | AsyncCallback<void> | Yes| Callback used to return the execution result.| + +- **Example** +```js +import notification from '@ohos.notification'; +import particleAbility from '@ohos.ability.particleAbility'; +import wantAgent from '@ohos.wantAgent'; + +function callback(err, data) { + if (err) { + console.error("Operation failed Cause: " + err); + } else { + console.info("Operation succeeded"); + } +} + +let wantAgentInfo = { + wants: [ + { + bundleName: "com.example.myapplication", + abilityName: "com.example.myapplication.MainAbility" + } + ], + operationType: wantAgent.OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags: [wantAgent.WantAgentFlags.UPDATE_PRESET_FLAG] +}; + +wantAgent.getWantAgent(wantAgentInfo).then((wantAgentObj) => { + let basicContent = { + title: "title", + text: "text" + }; + let notificationContent = { + contentType: notification.ContentType.NOTIFICATION_CONTENT_TEXT, + normal: basicContent + }; + let request = { + content: notificatonContent, + wantAgent: wantAgentObj + }; + let id = 1; + particleAbility.startBackgroundRunning(id, request, callback); +}); + +``` + +## particleAbility.startBackgroundRunning + +startBackgroundRunning(id: number, request: NotificationRequest): Promise<void> + +Requests a continuous task from the system. This method uses a promise to return the result. (This method is of API 7 and will be deprecated. Use the counterpart in API 8.) + +**Parameters** +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| id | number | Yes| Notification ID of a continuous task.| +| request | NotificationRequest | Yes| Notification parameter, which is used to display information in the notification bar.| + +**Return value** +| Type| Description| +| -------------- | ------------------------- | +| Promise\ | Promise used to return the result.| + +- **Example** +```js +import notification from '@ohos.notification'; +import particleAbility from '@ohos.ability.particleAbility'; +import wantAgent from '@ohos.wantAgent'; + +let wantAgentInfo = { + wants: [ + { + bundleName: "com.example.myapplication", + abilityName: "com.example.myapplication.MainAbility" + } + ], + operationType: wantAgent.OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags: [wantAgent.WantAgentFlags.UPDATE_PRESET_FLAG] +}; + +wantAgent.getWantAgent(wantAgentInfo).then((wantAgentObj) => { + let basicContent = { + title: "title", + text: "text" + }; + let notificationContent = { + contentType: notification.ContentType.NOTIFICATION_CONTENT_TEXT, + normal: basicContent + }; + let request = { + content: notificatonContent, + wantAgent: wantAgentObj + }; + let id = 1; + particleAbility.startBackgroundRunning(id, request).then(() => { + console.info("Operation succeeded"); + }).catch((err) => { + console.error("Operation failed Cause: " + err); + }); +}); + +``` + +## particleAbility.cancelBackgroundRunning + +cancelBackgroundRunning(callback: AsyncCallback<void>): void; + +Requests to cancel a continuous task from the system. This method uses an asynchronous callback to return the result. (This method is of API 7 and will be deprecated. Use the counterpart in API 8.) + +- **Parameters** + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | callback | AsyncCallback<void> | Yes| Callback used to return the execution result.| + +- **Example** +```js +import particleAbility from '@ohos.ability.particleAbility'; + +function callback(err, data) { + if (err) { + console.error("Operation failed Cause: " + err); + } else { + console.info("Operation succeeded"); + } +} + +particleAbility.cancelBackgroundRunning(callback); + +``` + +## particleAbility.cancelBackgroundRunning + +cancelBackgroundRunning(): Promise<void>; + +Requests to cancel a continuous task from the system. This method uses a promise to return the result. (This method is of API 7 and will be deprecated. Use the counterpart in API 8.) + +**Return value** +| Type| Description| +| -------------- | ------------------------- | +| Promise\ | Promise used to return the result.| + +- **Example** +```js +import particleAbility from '@ohos.ability.particleAbility'; + +particleAbility.cancelBackgroundRunning().then(() => { + console.info("Operation succeeded"); +}).catch((err) => { + console.error("Operation failed Cause: " + err); +}); + +``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-dataAbilityHelper.md b/zh-cn/application-dev/reference/apis/js-apis-dataAbilityHelper.md index c26248bb238c4584237f13b0ed026d4bcd99e0e3..7eb8db1ada1db7b384e63d62407eb5fec72d5786 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-dataAbilityHelper.md +++ b/zh-cn/application-dev/reference/apis/js-apis-dataAbilityHelper.md @@ -48,6 +48,8 @@ DAHelper.openFile( openFile(uri: string, mode: string): Promise\ +在指定的远程路径中打开文件(promise形式)。 + **系统能力:** SystemCapability.Ability.AbilityRuntime.FAModel @@ -306,7 +308,7 @@ SystemCapability.Ability.AbilityRuntime.FAModel | 名称 | 类型 | 必填 | 描述 | | -------- | ---------------------- | ---- | ------------------------------------------------------------ | | uri | string | 是 | 指示要规范化的uri对象。 | -| callback | AsyncCallback\ | 是 | 回调方法。如果数据功能支持uri规范化或null,则返回规范化uri对象。 | +| callback | AsyncCallback\ | 是 | 回调方法。如果数据功能支持uri规范化,则返回规范化uri对象;否则返回null。 | **示例:** @@ -341,7 +343,7 @@ SystemCapability.Ability.AbilityRuntime.FAModel **返回值:** | 类型 | 说明 | | ---------------- | ------------------------------------------------------ | -| Promise\ | 如果数据功能支持uri规范化或null,则返回规范化uri对象。 | +| Promise\ | 如果数据功能支持uri规范化,则返回规范化uri对象;否则返回null。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-particleAbility.md b/zh-cn/application-dev/reference/apis/js-apis-particleAbility.md index 9f12115ff008d02a4c3eff94dda598f127a822bb..fd6d47391dace18c0b41e90ff8468932545ab112 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-particleAbility.md +++ b/zh-cn/application-dev/reference/apis/js-apis-particleAbility.md @@ -16,10 +16,6 @@ startAbility(parameter: StartAbilityParameter, callback: AsyncCallback\: v 使用此方法启动指定的particleAbility(callback形式)。 -**系统能力:** - -SystemCapability.Ability.AbilityRuntime.FAModel - **参数:** @@ -57,17 +53,9 @@ particleAbility.startAbility( ## particleAbility.startAbility -**系统能力:** - -SystemCapability.Ability.AbilityRuntime.FAModel - startAbility(parameter: StartAbilityParameter): Promise\ 使用此方法启动指定的particleAbility(Promise形式)。 -**系统能力:** - -SystemCapability.Ability.AbilityRuntime.FAModel - **参数:** @@ -111,10 +99,6 @@ terminateSelf(callback: AsyncCallback\): void 终止particleAbility(callback形式)。 -**系统能力:** - -SystemCapability.Ability.AbilityRuntime.FAModel - **参数:** | 名称 | 类型 | 必填 | 描述 | @@ -140,10 +124,6 @@ terminateSelf(): Promise\ 终止particleAbility(Promise形式)。 -**系统能力:** - -SystemCapability.Ability.AbilityRuntime.FAModel - **返回值:** | 类型 | 说明 | | -------------- | ------------------------- | @@ -166,10 +146,6 @@ acquireDataAbilityHelper(uri: string): DataAbilityHelper 获取dataAbilityHelper。 -**系统能力:** - -SystemCapability.Ability.AbilityRuntime.FAModel - **参数:** | 名称 | 类型 | 必填 | 描述 | @@ -194,43 +170,43 @@ particleAbility.acquireDataAbilityHelper(uri) | 名称 | 读写属性 | 类型 | 必填 | 描述 | | ------------------- | -------- | --------------------- | ---- | ------------------------------------------------------------ | -| want | 只读 | [Want](#want) | 是 | 表示需要包含有关目标启动能力的信息。
系统能力:SystemCapability.Ability.AbilityRuntime.FAModel | -| abilityStartSetting | 只读 | {[key: string]: any} | 否 | 表示能力的特殊属性,当开发者启动能力时,该属性可以作为调用中的输入参数传递。
系统能力:SystemCapability.Ability.AbilityRuntime.FAModel | +| want | 只读 | [Want](#want) | 是 | 表示需要包含有关目标启动能力的信息。 | +| abilityStartSetting | 只读 | {[key: string]: any} | 否 | 表示能力的特殊属性,当开发者启动能力时,该属性可以作为调用中的输入参数传递。 | ## Want | 名称 | 读写属性 | 类型 | 必填 | 描述 | | ----------- | -------- | -------------------- | ---- | ------------------------------------------------------------ | -| deviceId | 只读 | string | 否 | 表示运行指定Ability的设备ID。
系统能力:SystemCapability.Ability.AbilityBase | -| bundleName | 只读 | string | 否 | 表示包描述。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。
系统能力:SystemCapability.Ability.AbilityBase | -| abilityName | 只读 | string | 否 | 表示待启动的Ability名称。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。
系统能力:SystemCapability.Ability.AbilityBase | -| uri | 只读 | string | 否 | 表示Uri描述。如果在Want中指定了Uri,则Want将匹配指定的Uri信息,包括scheme, schemeSpecificPart, authority和path信息。
系统能力:SystemCapability.Ability.AbilityBase | -| type | 只读 | string | 否 | 表示MIME type类型描述,比如:"text/plain" 、 "image/*"等。
系统能力:SystemCapability.Ability.AbilityBase | -| flags | 只读 | number | 否 | 表示处理Want的方式。默认传数字,具体参考:[flags说明](#flags说明)。
系统能力:SystemCapability.Ability.AbilityBase | -| action | 只读 | string | 否 | 表示action选项描述。
系统能力:SystemCapability.Ability.AbilityBase | -| parameters | 只读 | {[key: string]: any} | 否 | 表示WantParams描述。
系统能力:SystemCapability.Ability.AbilityBase | -| entities | 只读 | Array\ | 否 | 表示entities相关描述。
系统能力:SystemCapability.Ability.AbilityBase | +| deviceId | 只读 | string | 否 | 表示运行指定Ability的设备ID。 | +| bundleName | 只读 | string | 否 | 表示包描述。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。 | +| abilityName | 只读 | string | 否 | 表示待启动的Ability名称。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。 | +| uri | 只读 | string | 否 | 表示Uri描述。如果在Want中指定了Uri,则Want将匹配指定的Uri信息,包括scheme, schemeSpecificPart, authority和path信息。 | +| type | 只读 | string | 否 | 表示MIME type类型描述,比如:"text/plain" 、 "image/*"等。 | +| flags | 只读 | number | 否 | 表示处理Want的方式。默认传数字,具体参考:[flags说明](#flags说明)。 | +| action | 只读 | string | 否 | 表示action选项描述。 | +| parameters | 只读 | {[key: string]: any} | 否 | 表示WantParams描述。 | +| entities | 只读 | Array\ | 否 | 表示entities相关描述。 | ## flags说明 | 名称 | 参数 | 描述 | | ------------------------------------ | ---------- | ------------------------------------------------------------ | -| FLAG_AUTH_READ_URI_PERMISSION | 0x00000001 | 指示对URI执行读取操作的授权
系统能力:SystemCapability.Ability.AbilityBase | -| FLAG_AUTH_WRITE_URI_PERMISSION | 0x00000002 | 指示对URI执行写入操作的授权
系统能力:SystemCapability.Ability.AbilityBase | -| FLAG_ABILITY_FORWARD_RESULT | 0x00000004 | 将结果返回给元能力
系统能力:SystemCapability.Ability.AbilityBase | -| FLAG_ABILITY_CONTINUATION | 0x00000008 | 确定是否可以将本地设备上的功能迁移到远程设备
系统能力:SystemCapability.Ability.AbilityBase | -| FLAG_NOT_OHOS_COMPONENT | 0x00000010 | 指定组件是否属于OHOS
系统能力:SystemCapability.Ability.AbilityBase | -| FLAG_ABILITY_FORM_ENABLED | 0x00000020 | 指定是否启动某个能力
系统能力:SystemCapability.Ability.AbilityBase | -| FLAG_AUTH_PERSISTABLE_URI_PERMISSION | 0x00000040 | 指示URI上可能持久化的授权
系统能力:SystemCapability.Ability.AbilityBase | -| FLAG_AUTH_PREFIX_URI_PERMISSION | 0x00000080 | 按照前缀匹配的方式验证URI权限
系统能力:SystemCapability.Ability.AbilityBase | -| FLAG_ABILITYSLICE_MULTI_DEVICE | 0x00000100 | 支持分布式调度系统中的多设备启动
系统能力:SystemCapability.Ability.AbilityBase | -| FLAG_START_FOREGROUND_ABILITY | 0x00000200 | 指示无论主机应用程序是否已启动,都将启动使用服务模板的功能
系统能力:SystemCapability.Ability.AbilityBase | -| FLAG_ABILITY_CONTINUATION_REVERSIBLE | 0x00000400 | 表示迁移是可拉回的。
系统能力:SystemCapability.Ability.AbilityBase | -| FLAG_INSTALL_ON_DEMAND | 0x00000800 | 如果未安装指定的功能,请安装该功能
系统能力:SystemCapability.Ability.AbilityBase | -| FLAG_INSTALL_WITH_BACKGROUND_MODE | 0x80000000 | 如果未安装,使用后台模式安装该功能。
系统能力:SystemCapability.Ability.AbilityBase | -| FLAG_ABILITY_CLEAR_MISSION | 0x00008000 | 指示清除其他任务的操作。可以为传递给{@link ohos.app.Context#startAbility}的{@code Want}设置此标志,并且必须与{@link flag_ABILITY_NEW_MISSION}一起使用
系统能力:SystemCapability.Ability.AbilityBase | -| FLAG_ABILITY_NEW_MISSION | 0x10000000 | 指示在历史任务堆栈上创建任务的操作。
系统能力:SystemCapability.Ability.AbilityBase | -| FLAG_ABILITY_MISSION_TOP | 0x20000000 | 指示如果启动能力的现有实例已位于任务堆栈的顶部,则将重用该实例。否则,将创建一个新的能力实例。
系统能力:SystemCapability.Ability.AbilityBase | +| FLAG_AUTH_READ_URI_PERMISSION | 0x00000001 | 指示对URI执行读取操作的授权 | +| FLAG_AUTH_WRITE_URI_PERMISSION | 0x00000002 | 指示对URI执行写入操作的授权 | +| FLAG_ABILITY_FORWARD_RESULT | 0x00000004 | 将结果返回给元能力 | +| FLAG_ABILITY_CONTINUATION | 0x00000008 | 确定是否可以将本地设备上的功能迁移到远程设备 | +| FLAG_NOT_OHOS_COMPONENT | 0x00000010 | 指定组件是否属于OHOS | +| FLAG_ABILITY_FORM_ENABLED | 0x00000020 | 指定是否启动某个能力 | +| FLAG_AUTH_PERSISTABLE_URI_PERMISSION | 0x00000040 | 指示URI上可能持久化的授权 | +| FLAG_AUTH_PREFIX_URI_PERMISSION | 0x00000080 | 按照前缀匹配的方式验证URI权限 | +| FLAG_ABILITYSLICE_MULTI_DEVICE | 0x00000100 | 支持分布式调度系统中的多设备启动 | +| FLAG_START_FOREGROUND_ABILITY | 0x00000200 | 指示无论主机应用程序是否已启动,都将启动使用服务模板的功能 | +| FLAG_ABILITY_CONTINUATION_REVERSIBLE | 0x00000400 | 表示迁移是可拉回的。 | +| FLAG_INSTALL_ON_DEMAND | 0x00000800 | 如果未安装指定的功能,请安装该功能 | +| FLAG_INSTALL_WITH_BACKGROUND_MODE | 0x80000000 | 如果未安装,使用后台模式安装该功能。 | +| FLAG_ABILITY_CLEAR_MISSION | 0x00008000 | 指示清除其他任务的操作。可以为传递给**ohos.app.Context#startAbility**的**Want**设置此标志,并且必须与**flag_ABILITY_NEW_MISSION**一起使用 | +| FLAG_ABILITY_NEW_MISSION | 0x10000000 | 指示在历史任务堆栈上创建任务的操作。 | +| FLAG_ABILITY_MISSION_TOP | 0x20000000 | 指示如果启动能力的现有实例已位于任务堆栈的顶部,则将重用该实例。否则,将创建一个新的能力实例。 | ## AbilityStartSetting @@ -240,9 +216,9 @@ abilityStartSetting属性是一个定义为[key: string]: any的对象,key对 | 名称 | 参数 | 描述 | | --------------- | --------------- | -------------------------- | -| BOUNDS_KEY | "abilityBounds" | 窗口显示大小属性的名称。
系统能力:SystemCapability.Ability.AbilityRuntime.FAModel | -| WINDOW_MODE_KEY | "windowMode" | 窗口显示模式属性的名称。
系统能力:SystemCapability.Ability.AbilityRuntime.FAModel | -| DISPLAY_ID_KEY | "displayId" | 窗口显示设备ID属性的名称。
系统能力:SystemCapability.Ability.AbilityRuntime.FAModel | +| BOUNDS_KEY | "abilityBounds" | 窗口显示大小属性的名称。 | +| WINDOW_MODE_KEY | "windowMode" | 窗口显示模式属性的名称。 | +| DISPLAY_ID_KEY | "displayId" | 窗口显示设备ID属性的名称。 | ## AbilityWindowConfiguration @@ -250,11 +226,11 @@ abilityStartSetting属性是一个定义为[key: string]: any的对象,key对 | 名称 | 参数 | 描述 | | --------------------------- | ---- | ---------- | -| WINDOW_MODE_UNDEFINED | 0 | 未定义。
系统能力:SystemCapability.Ability.AbilityRuntime.FAModel | -| WINDOW_MODE_FULLSCREEN | 1 | 全屏。
系统能力:SystemCapability.Ability.AbilityRuntime.FAModel | -| WINDOW_MODE_SPLIT_PRIMARY | 100 | 分屏主屏。
系统能力:SystemCapability.Ability.AbilityRuntime.FAModel | -| WINDOW_MODE_SPLIT_SECONDARY | 101 | 分屏次屏。
系统能力:SystemCapability.Ability.AbilityRuntime.FAModel | -| WINDOW_MODE_FLOATING | 102 | 悬浮窗。
系统能力:SystemCapability.Ability.AbilityRuntime.FAModel | +| WINDOW_MODE_UNDEFINED | 0 | 未定义。 | +| WINDOW_MODE_FULLSCREEN | 1 | 全屏。 | +| WINDOW_MODE_SPLIT_PRIMARY | 100 | 分屏主屏。 | +| WINDOW_MODE_SPLIT_SECONDARY | 101 | 分屏次屏。 | +| WINDOW_MODE_FLOATING | 102 | 悬浮窗。 | ## particleAbility.startBackgroundRunning @@ -263,10 +239,6 @@ startBackgroundRunning(id: number, request: NotificationRequest, callback: Async 向系统申请长时任务,使用callback形式返回结果。(此接口为api7接口,后续会被废弃,请使用新的api8接口) -**系统能力:** - -SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask - - **参数**: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | @@ -323,10 +295,6 @@ wantAgent.getWantAgent(wantAgentInfo).then((wantAgentObj) => { startBackgroundRunning(id: number, request: NotificationRequest): Promise<void> -**系统能力:** - -SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask - 向系统申请长时任务,使用promise形式返回结果。(此接口为api7接口,后续会被废弃,请使用新的api8接口) **参数**: @@ -387,10 +355,6 @@ cancelBackgroundRunning(callback: AsyncCallback<void>): void; 向系统申请取消长时任务,使用callback形式返回结果。(此接口为api7接口,后续会被废弃,请使用新的api8接口) -**系统能力:** - -SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask - - **参数**: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | @@ -418,10 +382,6 @@ cancelBackgroundRunning(): Promise<void>; 向系统申请取消长时任务,使用promise形式返回结果。(此接口为api7接口,后续会被废弃,请使用新的api8接口) -**系统能力:** - -SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask - **返回值** | 类型 | 说明 | | -------------- | ------------------------- |