diff --git a/zh-cn/application-dev/reference/apis/js-apis-Context.md b/zh-cn/application-dev/reference/apis/js-apis-Context.md index 5ded8f0e02c5a92ec5b41166e485988e3e72b60d..2ccf9e4c98ba7f899666940f3205f20594f5d032 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-Context.md +++ b/zh-cn/application-dev/reference/apis/js-apis-Context.md @@ -6,7 +6,7 @@ ## 导入模块 ```js -import Context from "@ohos.app.context"; +import featureAbility from '@ohos.ability.featureAbility' ``` ## 使用说明 diff --git a/zh-cn/application-dev/reference/apis/js-apis-DataUriUtils.md b/zh-cn/application-dev/reference/apis/js-apis-DataUriUtils.md index 8cda4890e6647418ad4c5682ee534e42bdbac53c..99b4d04db0b9a976e8e1411facc2a6ed61307d89 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-DataUriUtils.md +++ b/zh-cn/application-dev/reference/apis/js-apis-DataUriUtils.md @@ -32,7 +32,7 @@ getId(uri: string): number **示例:** ```js -dataUriUtils.getIdSync("com.example.dataUriUtils/1221") +dataUriUtils.getId("com.example.dataUriUtils/1221") ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-ability-context.md b/zh-cn/application-dev/reference/apis/js-apis-ability-context.md index 81e4dacaf4e484d2f7a3822ffabed8d635932b54..1a802a0ce12547e1f2910a2ac518396a6ae5931b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-ability-context.md +++ b/zh-cn/application-dev/reference/apis/js-apis-ability-context.md @@ -8,7 +8,7 @@ Ability的上下文环境,继承自Context。 ## 导入模块 ```js -import AbilityContext from '@ohos.application.abilityContext' +import Ability from '@ohos.application.Ability' ``` ## 使用说明 diff --git a/zh-cn/application-dev/reference/apis/js-apis-abilityAccessCtrl.md b/zh-cn/application-dev/reference/apis/js-apis-abilityAccessCtrl.md index 2b0205042dcd4bafeb3412b085fa62c24ff3a0a0..90c88415497524469a931f21e13b23bb6abb36b8 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-abilityAccessCtrl.md +++ b/zh-cn/application-dev/reference/apis/js-apis-abilityAccessCtrl.md @@ -95,7 +95,8 @@ grantUserGrantedPermission(tokenID: number, permissionName: string, permissionFl ```js var AtManager = abilityAccessCtrl.createAtManager(); let tokenID = 0; -let promise = AtManager.grantUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS"); +let permissionFlag = 1; +let promise = AtManager.grantUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",permissionFlag); promise.then(data => { console.log(`promise: data->${JSON.stringify(data)}`); }); @@ -193,6 +194,7 @@ revokeUserGrantedPermission(tokenID: number, permissionName: string, permissionF ```js var AtManager = abilityAccessCtrl.createAtManager(); let tokenID = 0; +let permissionFlag = 1; AtManager.revokeUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS",permissionFlag, data => { console.log(`callback: data->${JSON.stringify(data)}`); }); diff --git a/zh-cn/application-dev/reference/apis/js-apis-abilityrunninginfo.md b/zh-cn/application-dev/reference/apis/js-apis-abilityrunninginfo.md index a3dd7c921e7dba9e0f6db1a618b0bcedfa9f6246..aeb9fb4a2da1743891aa6b3c9f4c14b9a68b4b42 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-abilityrunninginfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-abilityrunninginfo.md @@ -9,7 +9,7 @@ Ability运行相关信息。 ## 导入模块 ```js -import AbilityRunningInfo from '@ohos.application.abilityRunningInfo'; +import abilitymanager from '@ohos.application.abilityManager'; ``` ## 使用说明 diff --git a/zh-cn/application-dev/reference/apis/js-apis-abilitystagecontext.md b/zh-cn/application-dev/reference/apis/js-apis-abilitystagecontext.md index 9542eaf22ac2587ec2c80f616ad77d985680df84..47d67dbb9075f9bb5ea25b84898100be737a67a4 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-abilitystagecontext.md +++ b/zh-cn/application-dev/reference/apis/js-apis-abilitystagecontext.md @@ -9,7 +9,7 @@ AbilityStage的上下文环境,继承自[Context](js-apis-application-context. ## 导入模块 ```js -import AbilityStageContext from '@ohos.application.abilityStageContext'; +import AbilityStage from '@ohos.application.AbilityStage'; ``` ## 使用说明 diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-MissionSnapshot.md b/zh-cn/application-dev/reference/apis/js-apis-application-MissionSnapshot.md index 52d7863e98bd03e9962f1479a7cbc70763433e56..df9742d8c341c88732c73b18d0c833ff381ad1f5 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-application-MissionSnapshot.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-MissionSnapshot.md @@ -11,7 +11,7 @@ ## 导入模块 ``` -import MissionSnapshot from "@ohos.application.missionSnapshot"; +import abilitymanager from '@ohos.application.abilityManager'; ``` ## 使用说明 diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegator.md b/zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegator.md index cfaa22a541b3c3500bc43f6b5d06ffb7ede7bf0a..f59b58116e9da466a7553faf09736e832300a116 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegator.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegator.md @@ -7,7 +7,7 @@ ## 导入模块 ```js -import AbilityDelegator from '@ohos.application.abilityDelegator' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegatorArgs.md b/zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegatorArgs.md index b1b16092e204fce1382d373dfe07a89d9b88efb5..2fb204540b33ab4c510a21145a89474c02145eaa 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegatorArgs.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegatorArgs.md @@ -7,7 +7,7 @@ ## 导入模块 ```js -import AbilityDelegatorArgs from '@ohos.application.abilityDelegatorArgs' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-context.md b/zh-cn/application-dev/reference/apis/js-apis-application-context.md index 98fabaea000ed1a0d8fcef18651beb1bf4d0d8cf..5aec0d2417ee41692b6b249f17bcdca5c4369412 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-context.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-context.md @@ -6,11 +6,7 @@ 提供开发者运行代码的上下文环境,包括应用信息、ResourceManager等信息。 -## 导入模块 -```js -import Context from "@ohos.application.context"; -``` ## 使用说明 diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-shellCmdResult.md b/zh-cn/application-dev/reference/apis/js-apis-application-shellCmdResult.md index f5b4604103f502c2578e66ec0a3c8f246f39bc6a..7d6fc93ecf7416cfc0ae381f7276b2e70d08d776 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-shellCmdResult.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-shellCmdResult.md @@ -7,7 +7,7 @@ ## 导入模块 ```js -import ShellCmdResult from '@ohos.application.shellCmdResult' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-appmanager.md b/zh-cn/application-dev/reference/apis/js-apis-appmanager.md index c5f31e58aad9e6e7fc8a63dea9d94f732a64c801..21a29f7dceabf75959d1d6d8bdbf48545b07b5f4 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-appmanager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-appmanager.md @@ -34,7 +34,7 @@ static isRunningInStabilityTest(callback: AsyncCallback<boolean>): void ```js import app from '@ohos.application.appManager'; app.isRunningInStabilityTest((err, flag) => { - console.log('startAbility result:' + JSON.stringfy(err)); + console.log('startAbility result:' + JSON.stringify(err)); }) ``` @@ -58,9 +58,9 @@ static isRunningInStabilityTest(): Promise<boolean> ```js import app from '@ohos.application.appManager'; app.isRunningInStabilityTest().then((flag) => { - console.log('success:' + JSON.stringfy(flag)); + console.log('success:' + JSON.stringify(flag)); }).catch((error) => { - console.log('failed:' + JSON.stringfy(error)); + console.log('failed:' + JSON.stringify(error)); }); ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-eventhub.md b/zh-cn/application-dev/reference/apis/js-apis-eventhub.md index a32d3f6625b57589b433450879bf404327416ee3..98fd882fb0d5c9ac4a36ea5d43dbbd440bf79804 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-eventhub.md +++ b/zh-cn/application-dev/reference/apis/js-apis-eventhub.md @@ -9,7 +9,7 @@ ## 导入模块 ```js -import EventHub from "@ohos.application.eventHub"; +import Ability from '@ohos.application.Ability' ``` ## 使用说明 diff --git a/zh-cn/application-dev/reference/apis/js-apis-extension-context.md b/zh-cn/application-dev/reference/apis/js-apis-extension-context.md index 30f71ae5d6c6c6d0608948f8dbb845422ec072ff..fda3140d98b3e0d2e482664e61e8b731de60220a 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-extension-context.md +++ b/zh-cn/application-dev/reference/apis/js-apis-extension-context.md @@ -3,14 +3,13 @@ > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 +```js +import DataShareExtensionAbility from '@ohos.application.DataShareExtensionAbility'; +``` -Extension的上下文环境,继承自Context。 -## 导入模块 +Extension的上下文环境,继承自Context。 -```js -import ExtensionContext from "@ohos.application.extensionContext"; -``` ## 属性 diff --git a/zh-cn/application-dev/reference/apis/js-apis-extensionrunninginfo.md b/zh-cn/application-dev/reference/apis/js-apis-extensionrunninginfo.md index 60d27d15d902696233afdfb8688426b31d615f7b..775f9501e052b5851b02cf3572eb52aee63b2227 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-extensionrunninginfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-extensionrunninginfo.md @@ -9,7 +9,7 @@ Extension运行相关信息。 ## 导入模块 ```js -import ExtensionRunningInfo from "@ohos.application.extensionRunningInfo"; +import abilitymanager from '@ohos.application.abilityManager'; ``` ## 使用说明 diff --git a/zh-cn/application-dev/reference/apis/js-apis-formextensioncontext.md b/zh-cn/application-dev/reference/apis/js-apis-formextensioncontext.md index 4d9c8bf0ee8dce537fd92f5843141723ca4645bb..c586a6dbfeca358248842dd71ceb0215ac522ccf 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-formextensioncontext.md +++ b/zh-cn/application-dev/reference/apis/js-apis-formextensioncontext.md @@ -8,7 +8,7 @@ FormExtension的上下文环境,提供FormExtension具有的能力和接口, ## 导入模块 ```js -import FormExtensionContext from '@ohos.application.formExtensionContext'; +import FormExtension from '@ohos.application.FormExtension'; ``` ## FormExtensionContext.updateForm diff --git a/zh-cn/application-dev/reference/apis/js-apis-missionManager.md b/zh-cn/application-dev/reference/apis/js-apis-missionManager.md index e7f9e4bf1efe1aa4e5ecafb980260d884814fe54..8ef19669cd05d4340b9cb51911b8fed0c78c03cf 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-missionManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-missionManager.md @@ -15,6 +15,9 @@ missionManager模块提供系统任务管理能力,开发者可以对系统任 import missionManager from '@ohos.application.missionManager' ``` +## 权限列表 + +ohos.permission.MANAGE_MISSIONS ## missionManager.registerMissionListener @@ -143,6 +146,7 @@ getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback<M ```js import missionManager from '@ohos.application.missionManager' + var allMissions=missionManager.getMissionInfos("",10).catch(function(err){console.log(err);}); missionManager.getMissionInfo("", allMissions[0].missionId, (error, mission) => { console.log("getMissionInfo is called, error.code = " + error.code) console.log("mission.missionId = " + mission.missionId); @@ -181,7 +185,7 @@ getMissionInfo(deviceId: string, missionId: number): Promise<MissionInfo>; ```js import missionManager from '@ohos.application.missionManager' - var mission = missionManager.getMissionInfo("", id).catch(function (err){ + var mission = missionManager.getMissionInfo("", 10).catch(function (err){ console.log(err); }); ``` 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 25eb1e8ed5b5461ea11daa7feb11549226282422..8883e2a391e21cbd4b8f861b02d0421e27c7c1e2 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-particleAbility.md +++ b/zh-cn/application-dev/reference/apis/js-apis-particleAbility.md @@ -226,7 +226,7 @@ let wantAgentInfo = { ], operationType: wantAgent.OperationType.START_ABILITY, requestCode: 0, - wantAgentFlags: [wantAgent.WantAgentFlags.UPDATE_PRESET_FLAG] + wantAgentFlags: [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] }; wantAgent.getWantAgent(wantAgentInfo).then((wantAgentObj) => { @@ -235,11 +235,11 @@ wantAgent.getWantAgent(wantAgentInfo).then((wantAgentObj) => { text: "text" }; let notificationContent = { - contentType: notification.ContentType.NOTIFICATION_CONTENT_TEXT, + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: basicContent }; let request = { - content: notificatonContent, + content: notificationContent, wantAgent: wantAgentObj }; let id = 1; @@ -287,7 +287,7 @@ let wantAgentInfo = { ], operationType: wantAgent.OperationType.START_ABILITY, requestCode: 0, - wantAgentFlags: [wantAgent.WantAgentFlags.UPDATE_PRESET_FLAG] + wantAgentFlags: [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] }; wantAgent.getWantAgent(wantAgentInfo).then((wantAgentObj) => { @@ -296,11 +296,11 @@ wantAgent.getWantAgent(wantAgentInfo).then((wantAgentObj) => { text: "text" }; let notificationContent = { - contentType: notification.ContentType.NOTIFICATION_CONTENT_TEXT, + contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, normal: basicContent }; let request = { - content: notificatonContent, + content: notificationContent, wantAgent: wantAgentObj }; let id = 1; diff --git a/zh-cn/application-dev/reference/apis/js-apis-permissionrequestresult.md b/zh-cn/application-dev/reference/apis/js-apis-permissionrequestresult.md index 5bafa546eaa15a896cb7826891d41ba5eb9174d4..e855a31a8af4458f6209d265a1d202188a759148 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-permissionrequestresult.md +++ b/zh-cn/application-dev/reference/apis/js-apis-permissionrequestresult.md @@ -9,7 +9,7 @@ ## 导入模块 ```js -import PermissionRequestResult from '@ohos.application.permissionRequestResult' +import Ability from '@ohos.application.Ability' ``` ## 属性 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 81ef347078ea19d4c2585031a3abccd7ccd84e72..28bed3403c54000fdcd22fe8c355b790f5fc727f 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-uripermissionmanager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-uripermissionmanager.md @@ -11,7 +11,7 @@ Uri权限管理。 ``` -import uriPermissionManager from '@ohos.application.uriPermissionManager'; +import UriPermissionManager from '@ohos.application.uriPermissionManager'; ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md b/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md index f4ca3e8db00705f877ed54a4ccfc212f2f7d7c78..3f8658349c28669eb9a247f95d60a9cf0ee5b706 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md @@ -919,7 +919,7 @@ WantAgent.equal(wantAgent1, wantAgent2).then((data) => { getOperationType(agent: WantAgent, callback: AsyncCallback\): void; -获取WantAgent的操作类型(callback形式)。 +获取一个WantAgent的OperationType信息(callback形式)。 **系统能力**:SystemCapability.Ability.AbilityRuntime.Core @@ -928,19 +928,59 @@ getOperationType(agent: WantAgent, callback: AsyncCallback\): void; | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | ---------- | --- | ---- | ------------------------ | ---- | --------------------------------------- | | agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | -| callback | 是 | 否 | AsyncCallback\ | 是 | 获取WantAgent的操作类型。 | +| callback | 是 | 否 | AsyncCallback\ | 是 | 获取一个WantAgent的OperationType信息的回调方法。 | **示例:** ```js +import WantAgent from '@ohos.wantAgent'; + +//wantAgent对象 +var wantAgent; + +//WantAgentInfo对象 +var wantAgentInfo = { + wants: [ + { + deviceId: "deviceId", + bundleName: "com.neu.setResultOnAbilityResultTest1", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + } + ], + operationType: OperationType.START_ABILITIES, + requestCode: 0, + wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] +} + +WantAgent.getWantAgent(wantAgentInfo).then((data) => { + console.info("==========================>getWantAgentCallback=======================>"); + wantAgent = data; +}); +WantAgent.getOperationType(wantAgent, (OperationType) => { + console.log('----------- getOperationType ----------, OperationType: ' + OperationType); +}) ``` ## WantAgent.getOperationType getOperationType(agent: WantAgent): Promise\; -获取WantAgent的操作类型(Promise形式)。 +获取一个WantAgent的OperationType信息(Promise形式)。 **系统能力**:SystemCapability.Ability.AbilityRuntime.Core @@ -954,12 +994,54 @@ getOperationType(agent: WantAgent): Promise\; | 类型 | 说明 | | ----------------------------------------------------------- | ------------------------------------------------------------ | -| Promise\ | 以Promise形式返回获取WantAgent的操作类型。 | +| Promise\ | 以Promise形式返回获取optionType的结果。 | **示例:** ```js +import WantAgent from '@ohos.wantAgent'; + +//wantAgent对象 +var wantAgent; + +//WantAgentInfo对象 +var wantAgentInfo = { + wants: [ + { + deviceId: "deviceId", + bundleName: "com.neu.setResultOnAbilityResultTest1", + abilityName: "com.example.test.MainAbility", + action: "action1", + entities: ["entity1"], + type: "MIMETYPE", + uri: "key={true,true,false}", + parameters: + { + mykey0: 2222, + mykey1: [1, 2, 3], + mykey2: "[1, 2, 3]", + mykey3: "ssssssssssssssssssssssssss", + mykey4: [false, true, false], + mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], + mykey6: true, + } + } + ], + operationType: OperationType.START_ABILITIES, + requestCode: 0, + wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] +} + +WantAgent.getWantAgent(wantAgentInfo).then((data) => { + console.info("==========================>getWantAgentCallback=======================>"); + wantAgent = data; +}); +WantAgent.getOperationType(wantAgent).then((OperationType) => { + console.log('getOperationType success, OperationType: ' + OperationType); +}).catch((err) => { + console.log('getOperationType fail, err: ' + err); +}) ```