未验证 提交 fabcffe1 编写于 作者: O openharmony_ci 提交者: Gitee

!7765 Updata 3.2-beta2 by cherry-pick of ability

Merge pull request !7765 from yuyaozhi/OpenHarmony-3.2-Beta2
...@@ -1240,8 +1240,8 @@ context.printDrawnCompleted().then((data) => { ...@@ -1240,8 +1240,8 @@ context.printDrawnCompleted().then((data) => {
**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core
| 名称 | 类型 | 可读 | 可写 | 说明 | | 名称 | 类型 | 可读 | 可写 | 说明 |
| ----------- | ------ | ---- | ---- | ------- | | ------ | ------ | ------| ------ | ------ |
| appName | string | 是 | 否 | 模块名称。 | | appName | string | 是 | 否 | 模块名称。 |
| versionCode | number | 是 | 否 | 模块描述信息。 | | versionCode | number | 是 | 否 | 模块描述信息。 |
| versionName | string | 是 | 否 | 描述信息ID。 | | versionName | string | 是 | 否 | 描述信息ID。 |
...@@ -248,7 +248,7 @@ startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncC ...@@ -248,7 +248,7 @@ startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncC
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 |
| accountId | number | 是 | 需要启动的accountId。 | | accountId | number | 是 | 系统帐号的帐号ID,详情参考[getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess)。 |
| callback | AsyncCallback\<AbilityResult\> | 是 | 启动Ability的回调函数,返回Ability结果。 | | callback | AsyncCallback\<AbilityResult\> | 是 | 启动Ability的回调函数,返回Ability结果。 |
**示例:** **示例:**
...@@ -284,7 +284,7 @@ startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOp ...@@ -284,7 +284,7 @@ startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOp
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 |
| accountId | number | 是 | 需要启动的accountId。 | | 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的回调函数。 | | callback | AsyncCallback\<void\> | 是 | 启动Ability的回调函数。 |
...@@ -323,7 +323,7 @@ startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartO ...@@ -323,7 +323,7 @@ startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartO
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 |
| accountId | number | 是 | 需要启动的accountId。 | | 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所携带的参数。 |
**返回值:** **返回值:**
...@@ -431,7 +431,7 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: ...@@ -431,7 +431,7 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 |
| accountId | number | 是 | 需要启动的accountId。 | | accountId | number | 是 | 系统帐号的帐号ID,详情参考[getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess)。 |
| callback | AsyncCallback\<void\> | 是 | 启动Ability的回调函数。 | | callback | AsyncCallback\<void\> | 是 | 启动Ability的回调函数。 |
**示例:** **示例:**
...@@ -465,7 +465,7 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\ ...@@ -465,7 +465,7 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 |
| accountId | number | 是 | 需要启动的accountId。 | | accountId | number | 是 | 系统帐号的帐号ID,详情参考[getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess)。 |
**示例:** **示例:**
...@@ -564,7 +564,7 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: ...@@ -564,7 +564,7 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 |
| accountId | number | 是 | 需要启动的accountId。 | | accountId | number | 是 | 系统帐号的帐号ID,详情参考[getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess)。 |
| callback | AsyncCallback\<void\> | 是 | 启动Ability的回调函数。 | | callback | AsyncCallback\<void\> | 是 | 启动Ability的回调函数。 |
**示例:** **示例:**
...@@ -598,7 +598,7 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\< ...@@ -598,7 +598,7 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\<
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 |
| accountId | number | 是 | 需要启动的accountId。 | | accountId | number | 是 | 系统帐号的帐号ID,详情参考[getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess)。 |
**示例:** **示例:**
...@@ -786,7 +786,7 @@ connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions ...@@ -786,7 +786,7 @@ connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 |
| accountId | number | 是 | 需要启动的accountId。 | | accountId | number | 是 | 系统帐号的帐号ID,详情参考[getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess)。 |
| options | [ConnectOptions](js-apis-featureAbility.md#connectoptions) | 否 | 远端对象实例。 | | options | [ConnectOptions](js-apis-featureAbility.md#connectoptions) | 否 | 远端对象实例。 |
**返回值:** **返回值:**
...@@ -930,7 +930,7 @@ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\< ...@@ -930,7 +930,7 @@ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\<
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 |
| accountId | number | 是 | 需要启动的accountId。 | | accountId | number | 是 | 系统帐号的帐号ID,详情参考[getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess)。 |
| callback | AsyncCallback\<void\> | 是 | 启动Ability的回调函数。 | | callback | AsyncCallback\<void\> | 是 | 启动Ability的回调函数。 |
**示例:** **示例:**
...@@ -965,7 +965,7 @@ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, ca ...@@ -965,7 +965,7 @@ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, ca
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 |
| accountId | number | 是 | 需要启动的accountId。 | | 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的回调函数。 | | callback | AsyncCallback\<void\> | 是 | 启动Ability的回调函数。 |
...@@ -1004,7 +1004,7 @@ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): ...@@ -1004,7 +1004,7 @@ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions):
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 |
| accountId | number | 是 | 需要启动的accountId。 | | 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所携带的参数。 |
**示例:** **示例:**
......
# wantConstant # wantConstant
wantConstant模块提供want中action和entity的权限列表的能力,包括系统公共事件宏,系统公共事件名称等 wantConstant模块提供want中操作want常数和解释Flags说明的能力
> **说明:** > **说明:**
> >
...@@ -20,31 +20,31 @@ want操作的常数。 ...@@ -20,31 +20,31 @@ want操作的常数。
| 名称 | 值 | 描述 | | 名称 | 值 | 描述 |
| ------------ | ------------------ | ---------------------- | | ------------ | ------------------ | ---------------------- |
| ACTION_HOME | ohos.want.action.home | 指示返回原点的操作。 | | ACTION_HOME | ohos.want.action.home | 指示返回原点的操作。 |
| ACTION_DIAL | ohos.want.action.dial | 指示启动显示小键盘的页面功能的操作 | | ACTION_DIAL | ohos.want.action.dial | 指示启动显示小键盘的页面功能的操作 |
| ACTION_SEARCH | ohos.want.action.search | 指示启动页面搜索功能的操作。 | | ACTION_SEARCH | ohos.want.action.search | 指示启动页面搜索功能的操作。 |
| ACTION_WIRELESS_SETTINGS | ohos.settings.wireless | 指示启动提供无线网络设置的页面功能的操作,例如,Wi-Fi选项。 | | ACTION_WIRELESS_SETTINGS | ohos.settings.wireless | 指示启动提供无线网络设置的页面功能的操作,例如,Wi-Fi选项。 |
| ACTION_MANAGE_APPLICATIONS_SETTINGS | ohos.settings.manage.applications | 指示启动管理已安装应用程序的页面功能的操作。 | | ACTION_MANAGE_APPLICATIONS_SETTINGS | ohos.settings.manage.applications | 指示启动管理已安装应用程序的页面功能的操作。 |
| ACTION_APPLICATION_DETAILS_SETTINGS | ohos.settings.application.details | 指示启动显示指定应用程序详细信息的页面功能的操作。 | | ACTION_APPLICATION_DETAILS_SETTINGS | ohos.settings.application.details | 指示启动显示指定应用程序详细信息的页面功能的操作。 |
| ACTION_SET_ALARM | ohos.want.action.setAlarm | 指示启动页面功能以设置闹钟的操做作。 | | ACTION_SET_ALARM | ohos.want.action.setAlarm | 指示启动页面功能以设置闹钟的操做作。 |
| ACTION_SHOW_ALARMS | ohos.want.action.showAlarms | 指示启动显示所有警报的页面功能的操作时钟。 | | ACTION_SHOW_ALARMS | ohos.want.action.showAlarms | 指示启动显示所有警报的页面功能的操作时钟。 |
| ACTION_SNOOZE_ALARM | ohos.want.action.snoozeAlarm | 指示启动用于使闹钟睡眠的页面功能的操作。 | | ACTION_SNOOZE_ALARM | ohos.want.action.snoozeAlarm | 指示启动用于使闹钟睡眠的页面功能的操作。 |
| ACTION_DISMISS_ALARM | ohos.want.action.dismissAlarm | 指示启动删除闹钟的页面功能的操作。 | | ACTION_DISMISS_ALARM | ohos.want.action.dismissAlarm | 指示启动删除闹钟的页面功能的操作。 |
| ACTION_DISMISS_TIMER | ohos.want.action.dismissTimer | 指示启动页面功能以关闭计时器的操作。 | | ACTION_DISMISS_TIMER | ohos.want.action.dismissTimer | 指示启动页面功能以关闭计时器的操作。 |
| ACTION_SEND_SMS | ohos.want.action.sendSms | 指示启动发送sms的页面功能的操作。 | | ACTION_SEND_SMS | ohos.want.action.sendSms | 指示启动发送sms的页面功能的操作。 |
| ACTION_CHOOSE | ohos.want.action.choose | 指示启动页面功能以打开联系人或图片的操作。 | | ACTION_CHOOSE | ohos.want.action.choose | 指示启动页面功能以打开联系人或图片的操作。 |
| ACTION_IMAGE_CAPTURE<sup>8+</sup> | ohos.want.action.imageCapture | 指示启动页面拍照功能的操作。 | | ACTION_IMAGE_CAPTURE<sup>8+</sup> | ohos.want.action.imageCapture | 指示启动页面拍照功能的操作。 |
| ACTION_VIDEO_CAPTURE<sup>8+</sup> | ohos.want.action.videoCapture | 指示启动页面功能以拍摄视频的操作。 | | ACTION_VIDEO_CAPTURE<sup>8+</sup> | ohos.want.action.videoCapture | 指示启动页面功能以拍摄视频的操作。 |
| ACTION_SELECT | ohos.want.action.select | 指示显示应用程序选择对话框的操作。 | | ACTION_SELECT | ohos.want.action.select | 指示显示应用程序选择对话框的操作。 |
| ACTION_SEND_DATA | ohos.want.action.sendData | 指示发送单个数据记录的操作。 | | ACTION_SEND_DATA | ohos.want.action.sendData | 指示发送单个数据记录的操作。 |
| ACTION_SEND_MULTIPLE_DATA | ohos.want.action.sendMultipleData | 指示发送多个数据记录的操作。 | | ACTION_SEND_MULTIPLE_DATA | ohos.want.action.sendMultipleData | 指示发送多个数据记录的操作。 |
| ACTION_SCAN_MEDIA_FILE | ohos.want.action.scanMediaFile | 指示请求媒体扫描仪扫描文件并将文件添加到媒体库的操作。 | | ACTION_SCAN_MEDIA_FILE | ohos.want.action.scanMediaFile | 指示请求媒体扫描仪扫描文件并将文件添加到媒体库的操作。 |
| ACTION_VIEW_DATA | ohos.want.action.viewData | 指示查看数据的操作。 | | ACTION_VIEW_DATA | ohos.want.action.viewData | 指示查看数据的操作。 |
| ACTION_EDIT_DATA | ohos.want.action.editData | 指示编辑数据的操作。 | | ACTION_EDIT_DATA | ohos.want.action.editData | 指示编辑数据的操作。 |
| INTENT_PARAMS_INTENT | ability.want.params.INTENT | 指示将使用连接选取显示的选项的操作。 | | INTENT_PARAMS_INTENT | ability.want.params.INTENT | 指示用行为选择器来展示选择的操作。 |
| INTENT_PARAMS_TITLE | ability.want.params.TITLE | 指示与连接选取显示的选项一起使用时的字符序列对话框标题。 | | INTENT_PARAMS_TITLE | ability.want.params.TITLE | 指示与行为选择器一起使用时的字符序列对话框标题。 |
| ACTION_FILE_SELECT<sup>7+</sup> | ohos.action.fileSelect | 指示选择文件的操作。 | | ACTION_FILE_SELECT<sup>7+</sup> | ohos.action.fileSelect | 指示选择文件的操作。 |
| PARAMS_STREAM<sup>7+</sup> | ability.params.stream | 指示与连接发送数据一起使用时,包含与意图相关联的数据流的URI。 | | PARAMS_STREAM<sup>7+</sup> | ability.params.stream | 指示发送数据时与目标关联的数据流的URI |
| ACTION_APP_ACCOUNT_OAUTH <sup>8+</sup> | ohos.account.appAccount.action.oauth | 指示提供oauth服务的操作。 | | ACTION_APP_ACCOUNT_OAUTH <sup>8+</sup> | ohos.account.appAccount.action.oauth | 指示提供oauth服务的操作。 |
| ACTION_MARKER_DOWNLOAD <sup>9+</sup> | ohos.want.action.marketDownload | 表示从应用程序市场下载应用程序的的操作。<br>**系统API**:该接口为系统接口,三方应用不支持调用。 | | ACTION_MARKER_DOWNLOAD <sup>9+</sup> | ohos.want.action.marketDownload | 表示从应用程序市场下载应用程序的的操作。<br>**系统API**:该接口为系统接口,三方应用不支持调用。 |
...@@ -57,11 +57,11 @@ want实体的常数。 ...@@ -57,11 +57,11 @@ want实体的常数。
| 名称 | 值 | 描述 | | 名称 | 值 | 描述 |
| ------------ | ------------------ | ---------------------- | | ------------ | ------------------ | ---------------------- |
| ENTITY_DEFAULT | entity.system.default | 指示默认实体,如果未指定该实体,则使用该实体。 | | ENTITY_DEFAULT | entity.system.default | 指示默认实体,如果未指定该实体,则使用该实体。 |
| ENTITY_HOME | entity.system.homel | 指示主屏幕实体。 | | ENTITY_HOME | entity.system.home | 指示主屏幕实体。 |
| ENTITY_VOICE | entity.system.voice | 表示语音交互实体。 | | ENTITY_VOICE | entity.system.voice | 表示语音交互实体。 |
| ENTITY_BROWSABLE | entity.system.browsable | 指示浏览器类别。 | | ENTITY_BROWSABLE | entity.system.browsable | 指示浏览器类别。 |
| ENTITY_VIDEO | entity.system.video | 指示视频类别。 | | ENTITY_VIDEO | entity.system.video | 指示视频类别。 |
## wantConstant.Flags ## wantConstant.Flags
...@@ -78,11 +78,11 @@ Flags说明。 ...@@ -78,11 +78,11 @@ Flags说明。
| FLAG_ABILITY_CONTINUATION | 0x00000008 | 确定是否可以将本地设备上的功能迁移到远程设备。 | | FLAG_ABILITY_CONTINUATION | 0x00000008 | 确定是否可以将本地设备上的功能迁移到远程设备。 |
| FLAG_NOT_OHOS_COMPONENT | 0x00000010 | 指定组件是否属于OHOS。 | | FLAG_NOT_OHOS_COMPONENT | 0x00000010 | 指定组件是否属于OHOS。 |
| FLAG_ABILITY_FORM_ENABLED | 0x00000020 | 指定是否启动某个能力。 | | FLAG_ABILITY_FORM_ENABLED | 0x00000020 | 指定是否启动某个能力。 |
| FLAG_AUTH_PERSISTABLE_URI_PERMISSION | 0x00000040 | 指示URI上可能持久化的授权。<br>**系统API**: 此接口为系统接口,三方应用不支持调用。 | | FLAG_AUTH_PERSISTABLE_URI_PERMISSION | 0x00000040 | 指示URI上可能持久化的授权。<br>**系统API**: 此接口为系统接口,三方应用不支持调用。 |
| FLAG_AUTH_PREFIX_URI_PERMISSION | 0x00000080 | 按照前缀匹配的方式验证URI权限。<br>**系统API**: 此接口为系统接口,三方应用不支持调用。 | | FLAG_AUTH_PREFIX_URI_PERMISSION | 0x00000080 | 按照前缀匹配的方式验证URI权限。<br>**系统API**: 此接口为系统接口,三方应用不支持调用。 |
| FLAG_ABILITYSLICE_MULTI_DEVICE | 0x00000100 | 支持分布式调度系统中的多设备启动。 | | FLAG_ABILITYSLICE_MULTI_DEVICE | 0x00000100 | 支持分布式调度系统中的多设备启动。 |
| FLAG_START_FOREGROUND_ABILITY | 0x00000200 | 指示无论主机应用程序是否已启动,都将启动使用服务模板的功能。 | | FLAG_START_FOREGROUND_ABILITY | 0x00000200 | 指示无论主机应用程序是否已启动,都将启动使用服务模板的功能。 |
| FLAG_ABILITY_CONTINUATION_REVERSIBLE | 0x00000400 | 表示迁移是可拉回的。<br>**系统API**: 此接口为系统接口,三方应用不支持调用。 | | FLAG_ABILITY_CONTINUATION_REVERSIBLE | 0x00000400 | 表示迁移是可拉回的。<br>**系统API**: 此接口为系统接口,三方应用不支持调用。 |
| FLAG_INSTALL_ON_DEMAND | 0x00000800 | 如果未安装指定的功能,请安装该功能。 | | FLAG_INSTALL_ON_DEMAND | 0x00000800 | 如果未安装指定的功能,请安装该功能。 |
| FLAG_INSTALL_WITH_BACKGROUND_MODE | 0x80000000 | 如果未安装,使用后台模式安装该功能。 | | FLAG_INSTALL_WITH_BACKGROUND_MODE | 0x80000000 | 如果未安装,使用后台模式安装该功能。 |
| FLAG_ABILITY_CLEAR_MISSION | 0x00008000 | 指示清除其他任务的操作。可以为传递给 **[ohos.app.Context](js-apis-ability-context.md)****startAbility**方法的**Want**设置此标志,并且必须与**flag_ABILITY_NEW_MISSION**一起使用。 | | FLAG_ABILITY_CLEAR_MISSION | 0x00008000 | 指示清除其他任务的操作。可以为传递给 **[ohos.app.Context](js-apis-ability-context.md)****startAbility**方法的**Want**设置此标志,并且必须与**flag_ABILITY_NEW_MISSION**一起使用。 |
......
...@@ -393,7 +393,7 @@ killProcessWithAccount(bundleName: string, accountId: number): Promise\<void\> ...@@ -393,7 +393,7 @@ killProcessWithAccount(bundleName: string, accountId: number): Promise\<void\>
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| bundleName | string | 是 | 应用包名。 | | bundleName | string | 是 | 应用包名。 |
| accountId | number | 是 | account的Id。 | | accountId | number | 是 | 系统帐号的帐号ID,详情参考[getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess)。 |
**示例:** **示例:**
...@@ -427,7 +427,7 @@ killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCal ...@@ -427,7 +427,7 @@ killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCal
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| bundleName | string | 是 | 应用包名。 | | bundleName | string | 是 | 应用包名。 |
| accountId | number | 是 | account的Id。 | | accountId | number | 是 | 系统帐号的帐号ID,详情参考[getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess)。 |
| callback | AsyncCallback\<void\> | 是 | 切断account进程的回调函数。 | | callback | AsyncCallback\<void\> | 是 | 切断account进程的回调函数。 |
**示例:** **示例:**
......
...@@ -28,14 +28,18 @@ registerErrorObserver(observer: ErrorObserver): number; ...@@ -28,14 +28,18 @@ registerErrorObserver(observer: ErrorObserver): number;
**示例:** **示例:**
```js ```js
var observer = "12345"; var observer = {
onUnhandledException(errorMsg) {
console.log('onUnhandledException, errorMsg: ', errorMsg)
}
}
errorManager.registerErrorObserver(observer) errorManager.registerErrorObserver(observer)
.then((data) => { .then((data) => {
console.log('----------- registerErrorObserver success ----------', data); console.log('----------- registerErrorObserver success ----------', data);
}) })
.catch((err) => { .catch((err) => {
console.log('----------- registerErrorObserver fail ----------', err); console.log('----------- registerErrorObserver fail ----------', err);
}) })
``` ```
...@@ -59,7 +63,7 @@ unregisterErrorObserver(observerId: number, callback: AsyncCallback\<void>): vo ...@@ -59,7 +63,7 @@ unregisterErrorObserver(observerId: number, callback: AsyncCallback\<void>): vo
```js ```js
var observerId = 100; var observerId = 100;
function unregisterErrorObserver(err) { function unregisterErrorObserverCallback(err) {
if (err) { if (err) {
console.log('------------ unregisterErrorObserverCallback ------------', err); console.log('------------ unregisterErrorObserverCallback ------------', err);
} }
...@@ -119,9 +123,17 @@ onUnhandledException(errMsg: string): void; ...@@ -119,9 +123,17 @@ onUnhandledException(errMsg: string): void;
**示例:** **示例:**
```js ```js
var errMsg = "12345"; var observer = {
errorManager.onUnhandledException(errMsg, (error) => { onUnhandledException(errorMsg) {
console.log("error.code = " + error.code) console.log('onUnhandledException, errorMsg: ', errorMsg)
}) }
}
errorManager.registerErrorObserver(observer)
.then((data) => {
console.log('----------- registerErrorObserver success ----------', data);
})
.catch((err) => {
console.log('----------- registerErrorObserver fail ----------', err);
})
``` ```
\ No newline at end of file
...@@ -11,7 +11,22 @@ FormExtensionContext模块提供FormExtension具有的接口和能力。 ...@@ -11,7 +11,22 @@ FormExtensionContext模块提供FormExtension具有的接口和能力。
## 使用说明 ## 使用说明
FormExtensionContext模块是FormExtension的上下文环境,继承自ExtensionContext。 在使用FormExtensionContext的功能前,需要通过FormExtension获取。
```js
import FormExtension from '@ohos.application.FormExtension';
import formBindingData from '@ohos.application.formBindingData'
export default class MyFormExtension extends FormExtension {
onCreate() {
let dataObj1 = {
temperature:"11c",
"time":"11:00"
};
let obj1 = formBindingData.createFormBindingData(dataObj1);
return obj1;
}
}
```
## FormExtensionContext.startAbility ## FormExtensionContext.startAbility
...@@ -52,6 +67,8 @@ this.context.startAbility(want, function(err) { ...@@ -52,6 +67,8 @@ this.context.startAbility(want, function(err) {
startAbility(want: Want): Promise&lt;void&gt; startAbility(want: Want): Promise&lt;void&gt;
拉起一个卡片所属应用的Ability。
**系统能力**:SystemCapability.Ability.Form **系统能力**:SystemCapability.Ability.Form
**系统API**: 此接口为系统接口,三方应用不支持调用。 **系统API**: 此接口为系统接口,三方应用不支持调用。
......
...@@ -137,7 +137,7 @@ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\< ...@@ -137,7 +137,7 @@ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\<
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 |
| accountId | number | 是 | 需要启动的accountId。 | | accountId | number | 是 | 系统帐号的帐号ID,详情参考[getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess)。 |
| callback | AsyncCallback\<void\> | 是 | 启动Ability的回调函数。 | | callback | AsyncCallback\<void\> | 是 | 启动Ability的回调函数。 |
**示例:** **示例:**
...@@ -170,7 +170,7 @@ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, ca ...@@ -170,7 +170,7 @@ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, ca
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 |
| accountId | number | 是 | 需要启动的accountId。 | | 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的回调函数。 | | callback | AsyncCallback\<void\> | 是 | 启动Ability的回调函数。 |
...@@ -207,7 +207,7 @@ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): ...@@ -207,7 +207,7 @@ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions):
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 |
| accountId | number | 是 | 需要启动的accountId。 | | 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所携带的参数。 |
**示例:** **示例:**
...@@ -311,7 +311,7 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: ...@@ -311,7 +311,7 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 |
| accountId | number | 是 | 需要启动的accountId。 | | accountId | number | 是 | 系统帐号的帐号ID,详情参考[getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess)。 |
| callback | AsyncCallback\<void\> | 是 | 启动Ability的回调函数。 | | callback | AsyncCallback\<void\> | 是 | 启动Ability的回调函数。 |
**示例:** **示例:**
...@@ -345,7 +345,7 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\ ...@@ -345,7 +345,7 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 |
| accountId | number | 是 | 需要启动的accountId。 | | accountId | number | 是 | 系统帐号的帐号ID,详情参考[getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess)。 |
**示例:** **示例:**
...@@ -444,9 +444,9 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: ...@@ -444,9 +444,9 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | | want | [Want](js-apis-application-Want.md) | 是 | 停止Ability的want信息。 |
| accountId | number | 是 | 需要启动的accountId。 | | accountId | number | 是 | 需要停止的系统帐号的帐号ID,详情参考[getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess)。 |
| callback | AsyncCallback\<void\> | 是 | 启动Ability的回调函数。 | | callback | AsyncCallback\<void\> | 是 | 停止Ability的回调函数。 |
**示例:** **示例:**
...@@ -478,8 +478,14 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\< ...@@ -478,8 +478,14 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\<
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | | want | [Want](js-apis-application-Want.md) | 是 | 停止Ability的want信息。 |
| accountId | number | 是 | 需要启动的accountId。 | | accountId | number | 是 | 需要停止的系统帐号的帐号ID,详情参考[getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess)。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Promise&lt;void&gt; | 返回一个Promise,包含接口的结果。 |
**示例:** **示例:**
...@@ -602,7 +608,7 @@ connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions ...@@ -602,7 +608,7 @@ connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 |
| accountId | number | 是 | 需要启动的accountId。 | | accountId | number | 是 | 系统帐号的帐号ID,详情参考[getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess)。 |
| options | ConnectOptions | 否 | 远端对象实例。 | | options | ConnectOptions | 否 | 远端对象实例。 |
**返回值:** **返回值:**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册