diff --git a/zh-cn/application-dev/reference/apis/js-apis-ability-ability.md b/zh-cn/application-dev/reference/apis/js-apis-ability-ability.md index 8e87141a86ae135fd6ea581b8666a2433caf3bf7..648a68b075820e6959991f119c481be24c1ff8da 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-ability-ability.md +++ b/zh-cn/application-dev/reference/apis/js-apis-ability-ability.md @@ -13,6 +13,8 @@ Ability模块将二级模块API组织在一起方便开发者进行导出。 import ability from '@ohos.ability.ability'; ``` +## 属性 + **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase | 名称 | 类型 | 描述 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-common.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-common.md index b9fa6aa45bdda2596691cc3fd04785c3b5a7ad72..5a2f72d2684e110b1d351e14f32f4a2cbce6f40f 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-common.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-common.md @@ -14,7 +14,7 @@ import common from '@ohos.app.ability.common'; ``` ## 属性 -**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase +**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core | 名称 | 类型 | 说明 | | ----------- | -------------------- | ------------------------------------------------------------ | diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-quickFixManager.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-quickFixManager.md index ca3ff9a9cff8dc76eec343e60244e105a566ae21..7b01e5e25d1e8938c40cc268a9c671fc44ee30f1 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-quickFixManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-quickFixManager.md @@ -64,21 +64,13 @@ applyQuickFix(hapModuleQuickFixFiles: Array\, callback: AsyncCallback\ 说明:调用applyQuickFix接口时,补丁文件所在路径为应用沙箱路径。沙箱路径的获取参考[获取应用的沙箱路径](js-apis-bundle-BundleInstaller.md#获取应用的沙箱路径),映射到设备上的路径为/proc/<应用进程Id>/root/沙箱路径。 @@ -126,21 +118,13 @@ applyQuickFix(hapModuleQuickFixFiles: Array\): Promise\; **错误码**: +在打补丁过程中发生的错误,其错误码及错误信息通过公共事件[COMMON_EVENT_QUICK_FIX_APPLY_RESULT](commonEvent-definitions.md#common_event_quick_fix_apply_result9)的参数返回给应用开发者。 + | 错误码ID | 错误信息 | | ------- | -------- | | 18500002 | The specified quick fix is invalid. It may not exist or inaccessible. | | 18500008 | Internal error. | -在打补丁过程中发生的错误,其错误码及错误信息通过公共事件[COMMON_EVENT_QUICK_FIX_APPLY_RESULT](commonEvent-definitions.md#common_event_quick_fix_apply_result9)的参数返回给应用开发者。这部分错误码及错误信息如下: - -| 错误码ID | 错误信息 | -| ------- | -------- | -| 18500003 | Deploy hqf failed. | -| 18500004 | Switch hqf failed. | -| 18500005 | Delete hqf failed. | -| 18500006 | Load patch failed. | -| 18500007 | Unload patch failed. | - 以上错误码详细介绍请参考[errcode-ability](../errorcodes/errorcode-ability.md)。 **示例:** @@ -279,13 +263,7 @@ revokeQuickFix(bundleName: string, callback: AsyncCallback\): void; | 18500001 | The bundle is not exist or no patch has applied. | | 18500009 | The application has a apply quick fix task that is being processed. | -在撤销补丁过程中发生的错误,其错误码及错误信息通过公共事件[COMMON_EVENT_QUICK_FIX_REVOKE_RESULT](./common_event/commonEvent-ability.md#common_event_quick_fix_revoke_result10)的参数返回给应用开发者。这部分错误码及错误信息如下: - -| 错误码ID | 错误信息 | -| ------- | -------- | -| 18500004 | Switch hqf failed. | -| 18500005 | Delete hqf failed. | -| 18500007 | Unload patch failed. | +在撤销补丁过程中发生的错误,其错误码及错误信息通过公共事件[COMMON_EVENT_QUICK_FIX_REVOKE_RESULT](./common_event/commonEvent-ability.md#common_event_quick_fix_revoke_result10)的参数返回给应用开发者。 **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-want.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-want.md index c756196f8dc975d89fb667796b21ecad2543940f..73e32a8b62d7b41e62963755e2ed04eec5387705 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-want.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-want.md @@ -171,6 +171,7 @@ import Want from '@ohos.app.ability.Want'; ```ts // (1) UIAbility1启动一个ServiceExtension + import common from '@ohos.app.ability.common'; let context = getContext(this) as common.UIAbilityContext; // UIAbilityContext let want = { bundleName: 'com.example.myapplication1', diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-form-formBindingData.md b/zh-cn/application-dev/reference/apis/js-apis-app-form-formBindingData.md index 9b749fb072d60557e8e313303372ec12318c79c5..77de24d3196af0cdfb6e0a2b1b07636c701d8c71 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-form-formBindingData.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-form-formBindingData.md @@ -74,15 +74,4 @@ try { } catch (error) { console.error(`catch error, code: ${error.code}, message: ${error.message}`); } -``` - -## ProxyData - -定义表单代理数据。 - -**系统能力**:SystemCapability.Ability.Form - -| 名称 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| key | string | 是 | 代理的密钥。值取决于数据发布者。| -| subscriberId | string | 否 | 订阅者ID。值取决于数据发布者。默认值为当前卡片ID。| \ No newline at end of file +``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-form-formInfo.md b/zh-cn/application-dev/reference/apis/js-apis-app-form-formInfo.md index e60d7e4a11f74dd9aec3c31e6366a9327b276a8d..174f08a62948e142389f9d4ca11379b90b51bb63 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-form-formInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-form-formInfo.md @@ -169,6 +169,8 @@ import formInfo from '@ohos.app.form.formInfo'; **系统能力**:SystemCapability.Ability.Form +**系统API**: 此接口为系统接口,三方应用不支持调用。 + | 名称 | 类型 | 可读 | 可写 | 说明 | | ----------- | -------- | -------- | -------------------- | ------------------------------------------------------------ | | bundleName | string | 是 | 否 | 提供方卡片所属包的Bundle名称。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-StaticSubscriberExtensionContext.md b/zh-cn/application-dev/reference/apis/js-apis-application-StaticSubscriberExtensionContext.md index 5beca5d80eaa2dd4531dcfe124b1dc4b672bfc47..90a11780c424866b4b75aa924f9c905ffb3e89c7 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-StaticSubscriberExtensionContext.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-StaticSubscriberExtensionContext.md @@ -37,7 +37,7 @@ startAbility(want: Want, callback: AsyncCallback<void>): void; - 调用方应用位于后台时,使用该接口启动Ability需申请`ohos.permission.START_ABILITIES_FROM_BACKGROUND`权限 - 跨应用场景下,目标Ability的visible属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限 -**需要权限**:ohos.permission.CLEAN_BACKGROUND_PROCESSES +**需要权限**:ohos.permission.START_ABILITIES_FROM_BACKGROUND **系统能力**:SystemCapability.Ability.AbilityRuntime.Core @@ -106,7 +106,7 @@ startAbility(want: Want): Promise<void>; - 调用方应用位于后台时,使用该接口启动Ability需申请`ohos.permission.START_ABILITIES_FROM_BACKGROUND`权限 - 跨应用场景下,目标Ability的visible属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限 -**需要权限**:ohos.permission.CLEAN_BACKGROUND_PROCESSES +**需要权限**:ohos.permission.START_ABILITIES_FROM_BACKGROUND **系统能力**:SystemCapability.Ability.AbilityRuntime.Core diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-appManager.md b/zh-cn/application-dev/reference/apis/js-apis-application-appManager.md index ad08eabc900935bf050d5f897fcd89e18145d17b..b8e5b98293ecc4f6c7d96f0eb872f1365644abfb 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-appManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-appManager.md @@ -404,7 +404,7 @@ killProcessWithAccount(bundleName: string, accountId: number): Promise\ > > 当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 @@ -446,7 +446,7 @@ killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCal **系统API**: 此接口为系统接口,三方应用不支持调用。 -**需要权限**:ohos.permission.CLEAN_BACKGROUND_PROCESSES, ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS +**需要权限**:ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS, ohos.permission.CLEAN_BACKGROUND_PROCESSES **参数:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-businessAbilityRouter.md b/zh-cn/application-dev/reference/apis/js-apis-businessAbilityRouter.md index 8c8c93208dcc8591aee29c546ff197522670a78d..b2cfd51dd134b9cec1cfbea1184f75ab93e1f366 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-businessAbilityRouter.md +++ b/zh-cn/application-dev/reference/apis/js-apis-businessAbilityRouter.md @@ -26,7 +26,7 @@ import businessAbilityRouter from '@ohos.app.businessAbilityRouter'; 此枚举值用于标识过滤条件类型。 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework.Core +**系统能力:** 以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core **系统API:** 此接口为系统接口。 @@ -39,7 +39,7 @@ import businessAbilityRouter from '@ohos.app.businessAbilityRouter'; 此过滤值用于过滤查询的ability类型。 -**系统能力:** SystemCapability.BundleManager.BundleFramework.Core +**系统能力:** SystemCapability.Ability.AbilityRuntime.Core **系统API:** 此接口为系统接口。 @@ -57,7 +57,7 @@ queryBusinessAbilityInfo(filter: BusinessAbilityFilter, callback: AsyncCallback\ **需要权限:** ohos.permission.GET_BUNDLE_INFO_PRIVILEGED -**系统能力:** SystemCapability.BundleManager.BundleFramework.Core +**系统能力:** SystemCapability.Ability.AbilityRuntime.Core **系统API:** 此接口为系统接口。 @@ -94,7 +94,7 @@ queryBusinessAbilityInfo(filter: BusinessAbilityFilter): Promise\7+ | function | 是 | 建立连接时的回调函数。 | | onDisconnect7+ | function | 是 | 断开连接时的回调函数。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-ability-want.md b/zh-cn/application-dev/reference/apis/js-apis-inner-ability-want.md index 5fc5be2faf9a75b3e4f5773982fd7c67d09f5900..ed1b7034a08d789913d3abb9656d11c218142b9c 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-ability-want.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-ability-want.md @@ -27,7 +27,7 @@ import Want from '@ohos.app.ability.Want'; | action | string | 否 | 表示要执行的通用操作(如:查看、分享、应用详情)。在隐式Want中,您可以定义该字段,配合uri或parameters来表示对数据要执行的操作。具体参考:[action说明](js-apis-ability-wantConstant.md#wantconstantaction)。隐式Want定义及匹配规则参考:[显式Want与隐式Want匹配规则](../../application-models/explicit-implicit-want-mappings.md)。 | | parameters | {[key: string]: Object} | 否 | 表示WantParams,由开发者自行决定传入的键值对。默认会携带以下key值:
ohos.aafwk.callerPid 表示拉起方的pid。
ohos.aafwk.param.callerToken 表示拉起方的token。
ohos.aafwk.param.callerUid 表示[bundleInfo](js-apis-bundle-BundleInfo.md#bundleinfo)中的uid,应用包里应用程序的uid。
- component.startup.newRules:表示是否启用新的管控规则。
- moduleName:表示拉起方的模块名,该字段的值即使定义成其他字符串,在传递到另一端时会被修改为正确的值。
- ohos.dlp.params.sandbox:表示dlp文件才会有。 | | entities | Array\ | 否 | 表示目标Ability额外的类别信息(如:浏览器、视频播放器),在隐式Want中是对action字段的补充。在隐式Want中,您可以定义该字段,来过滤匹配Ability类型。具体参考:[entity说明](js-apis-app-ability-wantConstant.md#wantconstantentity)。 | -| moduleName9+ | string | 否 | 表示待启动的Ability所属的模块(module)。 | +| moduleName10+ | string | 否 | 表示待启动的Ability所属的模块(module)。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityDelegator.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityDelegator.md index 960feb5beac10ddfd2f5161b666ad47750881282..5b6a53f1434d60a7dc658f62f893d13d9f6d7683 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityDelegator.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityDelegator.md @@ -1231,7 +1231,7 @@ waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout?: number): Promise | 参数名 | 类型 | 必填 | 说明 | | ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | monitor | [AbilityStageMonitor](js-apis-inner-application-abilityStageMonitor.md) | 是 | [AbilityStageMonitor](js-apis-inner-application-abilityStageMonitor.md) 实例 | -| timeout | number | 否 | 超时最大等待时间,以毫秒为单位。 | +| timeout | number | 是 | 超时最大等待时间,以毫秒为单位。 | **返回值:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityStateData.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityStateData.md index 99e7167bf66f965b2f852a16bdc4e054ca151e20..4c2c93b6f5ee9f279419b0f35fe64eb0cf77428a 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityStateData.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-abilityStateData.md @@ -16,6 +16,8 @@ import appManager from '@ohos.application.appManager'; **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core +**系统API**: 此接口为系统接口,三方应用不支持调用。 + | 名称 | 类型 | 可读 | 可写 | 说明 | | ----------------------- | ---------| ---- | ---- | ------------------------- | | pid | number | 是 | 否 | 进程ID。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-appStateData.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-appStateData.md index c7dd5d6afbdb9f6b4a331ce59bb05483ffc01ac2..7ba5469663f0dcd5f0b3ef83526bc5de7fad3e3b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-appStateData.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-appStateData.md @@ -12,6 +12,8 @@ import appManager from '@ohos.app.ability.appManager'; ``` +## 属性 + **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core **系统API**:本模块被标记为@systemapi,对三方应用隐藏 diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-applicationContext.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-applicationContext.md index a51cce8a141c4788192680ad0c88ab9888f77180..bbaed20f5590d419c0fbe8c738799524f643e7e1 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-applicationContext.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-applicationContext.md @@ -359,7 +359,7 @@ export default class EntryAbility extends UIAbility { ## ApplicationContext.off(type: 'applicationStateChange')10+ -off(type: 'applicationStateChange'): **void**; +off(type: 'applicationStateChange', callback?: ApplicationStateChangeCallback): **void**; 取消当前应用注册的前后台变化的全部监听。 @@ -370,6 +370,7 @@ off(type: 'applicationStateChange'): **void**; | 参数名 | 类型 | 必填 | 说明 | | ------ | ------------- | ---- | -------------------- | | type | string | 是 | 取消监听事件的类型,必须为'applicationStateChange'。 | +| callback | [ApplicationStateChangeCallback](#js-apis-app-ability-applicationStateChangeCallback.md) | 否 | 对于该事件监听的回调方法,可以对应用从后台切换到前台,以及前台切换到后台分别定义回调。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-applicationStateObserver.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-applicationStateObserver.md index dc49d568e50613a19cf36428932e51871a9fde1a..12ae5dc96eadab1e23ca826de4733256b52c82f7 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-applicationStateObserver.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-applicationStateObserver.md @@ -12,6 +12,8 @@ import appManager from '@ohos.app.ability.appManager'; ``` +## 属性 + **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core **系统API**:该接口为系统接口,三方应用不支持调用。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-context.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-context.md index 77bde4703d26251db28d5b4e492df629fb5b4020..7f819d1cc5957a87bed64fe5330b830dd1db1a5f 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-context.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-context.md @@ -158,7 +158,7 @@ try { ## Context.getGroupDir10+ -getGroupDir(groupId: string): Promise\; +getGroupDir(dataGroupID: string): Promise\; 通过使用元服务应用中的Group ID获取对应的共享目录,使用Promise异步回调。 @@ -166,9 +166,9 @@ getGroupDir(groupId: string): Promise\; **参数:** -| 名称 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------- | ---- | ------------- | -| groupId | string | 是 | 元服务应用项目创建时,系统会指定分配唯一Group ID。 | +| dataGroupID | string | 是 | 元服务应用项目创建时,系统会指定分配唯一Group ID。 | **返回值:** @@ -188,16 +188,19 @@ getGroupDir(groupId: string): Promise\; ```ts let groupId = "1"; -context.getGroupDir(groupId).then(data => { +let getGroupDirContext: common.Context; +try { + getGroupDirContext.getGroupDir(groupId).then(data => { console.log("getGroupDir result:" + data); -}).catch((err) => { - console.error('error: ${JSON.stringify(err)}'); -}); + }) +} catch (error) { + console.error('getGroupDirContext failed, error.code: ${error.code}, error.message: ${error.message}'); +} ``` ## Context.getGroupDir10+ -getGroupDir(groupId: string, callback: AsyncCallback\); +getGroupDir(dataGroupID: string, callback: AsyncCallback\); 通过使用元服务应用中的Group ID获取对应的共享目录,使用callback异步回调。 @@ -205,9 +208,9 @@ getGroupDir(groupId: string, callback: AsyncCallback\); **参数:** -| 名称 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------- | ---- | ------------- | -| groupId | string | 是 | 元服务应用项目创建时,系统会指定分配唯一Group ID。 | +| dataGroupID | string | 是 | 元服务应用项目创建时,系统会指定分配唯一Group ID。 | | callback | AsyncCallback\ | 是 | 以callback方式返回对应的共享目录。如果不存在则返回为空,仅支持应用el2加密级别。| **错误码**: @@ -221,12 +224,14 @@ getGroupDir(groupId: string, callback: AsyncCallback\); **示例:** ```ts -context.getGroupDir("1", (err, data) => { - if (err) { - console.error('getGroupDir faile, err: ${JSON.stringify(err)}'); - } else { - console.log('getGroupDir result is: ${JSON.stringify(data)}'); - } +let getGroupDirContext: common.Context; + +getGroupDirContext.getGroupDir("1", (err, data) => { + if (err) { + console.error('getGroupDir faile, err: ${JSON.stringify(err)}'); + } else { + console.log('getGroupDir result is: ${JSON.stringify(data)}'); + } }); ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-continueDeviceInfo.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-continueDeviceInfo.md index 3be9c897b9a8656b3896c8ab1fadf56a106b6883..55f071816dd5699c96533c14a0b1c841cc333c25 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-continueDeviceInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-continueDeviceInfo.md @@ -10,6 +10,8 @@ **系统能力**:SystemCapability.Ability.AbilityRuntime.Mission +**系统API**: 此接口为系统接口,三方应用不支持调用。 + | 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | ------ | ---- | ---- | ------- | | srcDeviceId | string | 是 | 是 | 表示任务迁移源设备ID。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-continueMissionInfo.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-continueMissionInfo.md index 6e2b501ac4e576db7dcc5097c68f453f3c930056..453cbb1039e5d0743f81a3550c67c64df1d5d562 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-continueMissionInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-continueMissionInfo.md @@ -13,6 +13,8 @@ import distributedMissionManager from '@ohos.distributedMissionManager'; ``` +## 属性 + **系统能力**:SystemCapability.Ability.AbilityRuntime.Mission | 名称 | 类型 | 可读 | 可写 | 说明 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionInfo.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionInfo.md index 862f497eae6e40ea6b10259252304c00cba00c81..c32c64357750d3c6d7e859d0d05cc8aafe0c674d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionInfo.md @@ -28,6 +28,7 @@ import missionManager from '@ohos.app.ability.missionManager'; | label | string | 是 | 是 | 表示任务的标签。 | | iconPath | string | 是 | 是 | 表示任务的图标路径。 | | continuable | boolean | 是 | 是 | 表示任务是否可以迁移。 | +| abilityState | number | 是 | 是 | 表示此任务的能力状态。 | | unclearable10+ | boolean | 是 | 是 | 表示任务是否可以被用户手动删除。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionListener.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionListener.md index 757c6029a084b70efd438f7cd921aab0864b6a9c..05060ef4fd317efa7f623683e57db35bc77fb8a2 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionListener.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionListener.md @@ -16,6 +16,8 @@ import missionManager from '@ohos.app.ability.missionManager'; **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Mission +**系统API**: 此接口为系统接口,三方应用不支持调用。 + | 名称 | 类型 | 必填 | 说明 | | ----------- | -------- | ---- | ------------------------------------------------------------ | | onMissionCreated | function | 否 | 表示当系统创建任务时回调执行。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-serviceExtensionContext.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-serviceExtensionContext.md index 11b8b8ee2eb4074a6f23eccc26f1b46dc6ff1631..c00b39e2c60fe5edf6631160dff33c4fba0f2074 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-serviceExtensionContext.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-serviceExtensionContext.md @@ -1102,6 +1102,7 @@ connectServiceExtensionAbility(want: Want, options: ConnectOptions): number; | 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. | | 16000053 | The ability is not on the top of the UI. | @@ -1169,6 +1170,7 @@ connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options | 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. | | 16000053 | The ability is not on the top of the UI. | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md index effa7580c6b49a927596bb511d854d10cb1f9740..fc9ceea38bfdf45ad4ed37ed3714e92c515a908e 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md @@ -116,7 +116,6 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void& **错误码:** -| 错误码ID | 错误信息 | | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 16000001 | The specified ability does not exist. | @@ -276,6 +275,8 @@ startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>): | 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. | @@ -345,6 +346,8 @@ startAbilityForResult(want: Want, options: StartOptions, 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. | @@ -424,6 +427,8 @@ startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityRes | 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. | @@ -979,6 +984,7 @@ stopServiceExtensionAbility(want: Want, callback: AsyncCallback\): 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. | @@ -1040,8 +1046,6 @@ stopServiceExtensionAbility(want: Want): Promise\; | 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. | @@ -1445,6 +1449,7 @@ connectServiceExtensionAbility(want: Want, options: ConnectOptions): number; | 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. | | 16000053 | The ability is not on the top of the UI. | @@ -2226,7 +2231,7 @@ setMissionContinueState(state: AbilityConstant.ContinueState, callback:AsyncCall | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| state | [ContinueState](js-apis-app-ability-abilityConstant.md#abilityconstantcontinuestate10) | 是 | 流转状态。 | +| state | [AbilityConstant.ContinueState](js-apis-app-ability-abilityConstant.md#abilityconstantcontinuestate10) | 是 | 流转状态。 | | callback | AsyncCallback<void> | 是 | 回调函数,返回接口调用是否成功的结果。 | **错误码:** @@ -2260,7 +2265,7 @@ setMissionContinueState(state: AbilityConstant.ContinueState): Promise<void&g | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| state | [ContinueState](js-apis-app-ability-abilityConstant.md#abilityconstantcontinuestate10) | 是 | 流转状态。 | +| state | [AbilityConstant.ContinueState](js-apis-app-ability-abilityConstant.md#abilityconstantcontinuestate10) | 是 | 流转状态。 | **返回值:** @@ -2787,9 +2792,9 @@ startAbilityByCallWithAccount(want: Want, accountId: number): Promise<Caller& } ``` -## UIAbilityContext.reportDrawnCompleted +## UIAbilityContext.reportDrawnCompleted10+ -reportDrawnCompleted(callback: AsyncCallback): void; +reportDrawnCompleted(callback: AsyncCallback\): void; 当页面加载完成(loadContent成功)时,为开发者提供打点功能(callback形式)。 **系统能力**:SystemCapability.Ability.AbilityRuntime.Core @@ -2812,26 +2817,31 @@ reportDrawnCompleted(callback: AsyncCallback): void; **示例:** ```ts -onWindowStageCreate(windowStage: Window.WindowStage) { +import UIAbility from '@ohos.app.ability.UIAbility'; +import window from '@ohos.window'; + +export default class EntryAbility extends UIAbility { + onWindowStageCreate(windowStage: window.WindowStage) { windowStage.loadContent('pages/Index', (err, data) => { - if (err.code) { - return; - } - try { - this.context.reportDrawnCompleted((err) => { - if (err.code) { - // 处理业务逻辑错误 - console.error(`reportDrawnCompleted failed, code is ${err.code}, message is ${err.message}`); - return; - } - // 执行正常业务 - console.info('reportDrawnCompleted succeed'); - }); - } catch (err) { - // 捕获同步的参数错误 + if (err.code) { + return; + } + try { + this.context.reportDrawnCompleted((err) => { + if (err.code) { + // 处理业务逻辑错误 console.error(`reportDrawnCompleted failed, code is ${err.code}, message is ${err.message}`); - } + return; + } + // 执行正常业务 + console.info('reportDrawnCompleted succeed'); + }); + } catch (err) { + // 捕获同步的参数错误 + console.error(`reportDrawnCompleted failed, code is ${err.code}, message is ${err.message}`); + } }); console.log("MainAbility onWindowStageCreate") -} + } +}; ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-uripermissionmanager.md b/zh-cn/application-dev/reference/apis/js-apis-uripermissionmanager.md index 46c82059765f6c2e16c820b067f1fcd03859ec7c..8e8763d79912e309935cd141ec5599284e3bdca0 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-uripermissionmanager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-uripermissionmanager.md @@ -57,18 +57,18 @@ grantUriPermission(uri: string, flag: wantConstant.Flags, targetBundleName: stri import fileUri from '@ohos.file.fileuri'; let targetBundleName = 'com.example.test_case1' - let path = this.context.filesDir + '/newDir'; - await fileio.mkdir(path, function (err) { + let path = "file://com.example.test_case1/data/storage/el2/base/haps/entry_test/files/newDir"; + fileio.mkdir(path, function (err) { if (err) { - hilog.info(0x0000, 'testTag', "mkdir error"+err.message); + console.log("mkdir error"+err.message) } else { - hilog.info(0x0000, 'testTag', "mkdir succeed"); + console.log("mkdir succeed") } }); let uri = fileUri.getUriFromPath(path); uriPermissionManager.grantUriPermission(uri, WantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION, targetBundleName, (result) => { - console.log("result.code = " + result.code) - }) + console.log("result.code = " + result.code) + }) ``` @@ -119,20 +119,21 @@ grantUriPermission(uri: string, flag: wantConstant.Flags, targetBundleName: stri import fileUri from '@ohos.file.fileuri'; let targetBundleName = 'com.example.test_case1' - let path = this.context.filesDir + '/newDir'; - await fileio.mkdir(path, function (err) { + let path = "file://com.example.test_case1/data/storage/el2/base/haps/entry_test/files/newDir"; + + fileio.mkdir(path, function (err) { if (err) { - hilog.info(0x0000, 'testTag', "mkdir error"+err.message); + console.log("mkdir error"+err.message) } else { - hilog.info(0x0000, 'testTag', "mkdir succeed"); + console.log("mkdir succeed") } }); let uri = fileUri.getUriFromPath(path); - uriPermissionManager.grantUriPermission(uri, wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION, targetBundleName) - .then((data) => { + uriPermissionManager.grantUriPermission(uri, WantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION, targetBundleName) + .then((data) => { console.log('Verification succeeded.' + data) - }).catch((error) => { - console.log('Verification failed.'); + }).catch((error) => { + console.log('Verification failed.'); }) ``` ## uriPermissionManager.revokeUriPermission