diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets index c1f8ab65e6d4d9f6028ae08d753ddfab1f86f474..34d126e6d25c77c214ef682ce2e8b2892960fa0b 100644 --- a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets +++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets @@ -322,7 +322,6 @@ export default function ApiCoverTest() { let el1 = common.AreaMode.EL1; let el2 = common.AreaMode.EL2; let eventHub: common.EventHub = context.eventHub; - let permissionRequestResult: common.PermissionRequestResult; let abilityResult: common.AbilityResult; let connectOptions: common.ConnectOptions; diff --git a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/VerificationTest.ets b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/VerificationTest.ets index 722516ad82802f1e2ff837cb2cd2840a82b3281d..34528550a633a5207507489e0d58ed6c314473aa 100644 --- a/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/VerificationTest.ets +++ b/ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/VerificationTest.ets @@ -430,64 +430,5 @@ export default function verificationTest(){ done(); } }) - - /* - * @tc.number SUB_AA_OpenHarmony_RequestPermissionsFromUser_0200 - * @tc.name Stage model is not configured with permission for authorization verification. - * @tc.desc Function test - * @tc.level 3 - */ - it('SUB_AA_OpenHarmony_RequestPermissionsFromUser_0200', 0, async function(done) { - TAG = 'SUB_AA_OpenHarmony_RequestPermissionsFromUser_0200 ==>'; - - try { - let permissionRequestResult = null - let subscriber = null - let subscribeInfo = { - events: ["Stage_MainAbility10_onCreate", "Stage_MainAbility10_onDestroy"] - } - - function SubscribeInfoCallback(err, data) { - console.info(TAG + "===SubscribeInfoCallback===" + JSON.stringify(data)) - if (data.event == "Stage_MainAbility10_onCreate") { - permissionRequestResult = data.parameters.permissionRequestResult - } - if (data.event == "Stage_MainAbility10_onDestroy") { - console.info(TAG + "===PermissionRequestResult===" + JSON.stringify(permissionRequestResult)) - expect(JSON.stringify(permissionRequestResult.permissions)) - .assertEqual(JSON.stringify(["ohos.permission.CAMERA"])); - expect(JSON.stringify(permissionRequestResult.authResults)).assertEqual(JSON.stringify([2])); - commonEvent.unsubscribe(subscriber, UnSubscribeInfoCallback) - } - } - - function UnSubscribeInfoCallback(err, data) { - console.info(TAG + "===UnSubscribeInfoCallback===") - done() - } - - commonEvent.createSubscriber(subscribeInfo, (err, data) => { - console.info(TAG + "===CreateSubscriberCallback===") - subscriber = data - commonEvent.subscribe(subscriber, SubscribeInfoCallback) - }) - - let wantNum = { - bundleName: 'ohos.acts.aafwk.test.stagesupplement', - abilityName: 'MainAbility10' - } - globalThis.abilityContext.startAbility(wantNum).then((data) => { - console.info(TAG + "startAbility data = " + JSON.stringify(data)); - }).catch((err) => { - console.info(TAG + "startAbility err = " + JSON.stringify(err)); - expect().assertFail(); - done(); - }); - } catch (err) { - console.info(TAG + "catch err = " + JSON.stringify(err)); - expect().assertFail(); - done(); - } - }) }) } diff --git a/ability/ability_runtime/apicover/stagesupplement/entry/src/main/ets/MainAbility10/MainAbility10.ts b/ability/ability_runtime/apicover/stagesupplement/entry/src/main/ets/MainAbility10/MainAbility10.ts deleted file mode 100644 index a1ce6ac23d9cd32714beb8821cffa0e3056ea928..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/apicover/stagesupplement/entry/src/main/ets/MainAbility10/MainAbility10.ts +++ /dev/null @@ -1,64 +0,0 @@ -import Ability from '@ohos.app.ability.UIAbility' -import commonEvent from '@ohos.commonEvent'; - -var printLog10 = "Stage:MainAbility10:"; -var listPush10 = "Stage_MainAbility10_"; -export default class MainAbility10 extends Ability { - onCreate(want, launchParam) { - console.info(printLog10 + "onCreate") - - let list = ["ohos.permission.CAMERA"] - this.context.requestPermissionsFromUser(list).then((permissionRequestResult) => { - console.info(printLog10 + "requestPermissionsFromUser data = " + JSON.stringify(permissionRequestResult)); - - var CommonEventPublishData = { - parameters: { - permissionRequestResult: permissionRequestResult - } - } - commonEvent.publish(listPush10 + "onCreate", CommonEventPublishData, (err) => { - console.info(printLog10 + listPush10 + "onCreate"); - }); - }).catch((err) => { - console.info(printLog10 + "requestPermissionsFromUser err = " + JSON.stringify(err)); - }); - - setTimeout(()=>{ - this.context.terminateSelf().then((data) => { - console.info(printLog10 + "terminateSelf data = " + JSON.stringify(data)); - }).catch((err) => { - console.info(printLog10 + "terminateSelf err = " + JSON.stringify(err)); - }); - }, 3000) - } - - onDestroy() { - console.info(printLog10 + "onDestroy") - - commonEvent.publish(listPush10 + "onDestroy", (err) => { - console.info(printLog10 + listPush10 + "onDestroy"); - }); - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.info(printLog10 + "onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.info(printLog10 + "onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.info(printLog10 + "onForeground") - } - - onBackground() { - // Ability has back to background - console.info(printLog10 + "onBackground") - } -}; diff --git a/ability/ability_runtime/apicover/stagesupplement/entry/src/main/module.json b/ability/ability_runtime/apicover/stagesupplement/entry/src/main/module.json index eb253a61403f14868bcdc9b0907a56e1dc9979f2..78c93758c94680bd70afcfc282a7ee5369b6ec51 100644 --- a/ability/ability_runtime/apicover/stagesupplement/entry/src/main/module.json +++ b/ability/ability_runtime/apicover/stagesupplement/entry/src/main/module.json @@ -78,17 +78,6 @@ "startWindowBackground": "$color:white", "visible": true, "launchType": "singleton" - }, - { - "name": "MainAbility10", - "srcEntrance": "./ets/MainAbility10/MainAbility10.ts", - "description": "$string:MainAbility10_desc", - "icon": "$media:icon", - "label": "$string:MainAbility10_label", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:white", - "visible": true, - "launchType": "singleton" } ], "requestPermissions": [ diff --git a/ability/ability_runtime/apicover/stagesupplement/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/apicover/stagesupplement/entry/src/main/resources/base/element/string.json index bd41aeaab1353a40f6f898358294abab211a5764..eaeeb5f2c192b3d748fa8cf50a3ccbd564725e80 100644 --- a/ability/ability_runtime/apicover/stagesupplement/entry/src/main/resources/base/element/string.json +++ b/ability/ability_runtime/apicover/stagesupplement/entry/src/main/resources/base/element/string.json @@ -43,14 +43,6 @@ { "name": "MainAbility9_label", "value": "label" - }, - { - "name": "MainAbility10_desc", - "value": "description" - }, - { - "name": "MainAbility10_label", - "value": "label" } ] } \ No newline at end of file diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstageentry/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstageentry/entry/src/main/ets/pages/index.ets index 5a73d79a4b5eb516a87da7cbb33ea051dc9ba688..a7f2e9f28bf37060e3c667b6c78295122f8ebd88 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstageentry/entry/src/main/ets/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstageentry/entry/src/main/ets/pages/index.ets @@ -65,12 +65,6 @@ struct Index { console.info('fAStartAbilityForResultPromise terminateSelfWithResult END'); } - async aboutToAppear() { - var permissions = ["ohos.permission.DISTRIBUTED_DATASYNC"]; - globalThis.abilityContext.getContext().requestPermissionsFromUser(permissions, 0, (data) => { - console.info("start requestPermissionsFromUser!!!!") - }) - } } async function routePage(page) { diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehm2/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehm2/entry/src/main/ets/pages/index.ets index 8414560d76ec652b3caaba66ebd5a895acb34966..e4d865476e477a1190448b69d44b3b07f31c04ad 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehm2/entry/src/main/ets/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehm2/entry/src/main/ets/pages/index.ets @@ -101,13 +101,6 @@ struct Index { console.info(tag + ' startAbility fAStartAbilityPromise END'); } - async aboutToAppear() { - var permissions = ["ohos.permission.DISTRIBUTED_DATASYNC"]; - globalThis.abilityContext.getContext().requestPermissionsFromUser(permissions, 0, (data) => { - console.info("start requestPermissionsFromUser!!!!") - }) - } - async terminateSelfWithResult() { console.info('fAStartAbilityForResultPromise terminateSelfWithResult START'); await globalThis.abilityContext.terminateSelfWithResult( diff --git a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehnm2/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehnm2/entry/src/main/ets/pages/index.ets index 8414560d76ec652b3caaba66ebd5a895acb34966..e4d865476e477a1190448b69d44b3b07f31c04ad 100644 --- a/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehnm2/entry/src/main/ets/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/startabilityforresultstagetest/atomizationresultstagehnm2/entry/src/main/ets/pages/index.ets @@ -101,13 +101,6 @@ struct Index { console.info(tag + ' startAbility fAStartAbilityPromise END'); } - async aboutToAppear() { - var permissions = ["ohos.permission.DISTRIBUTED_DATASYNC"]; - globalThis.abilityContext.getContext().requestPermissionsFromUser(permissions, 0, (data) => { - console.info("start requestPermissionsFromUser!!!!") - }) - } - async terminateSelfWithResult() { console.info('fAStartAbilityForResultPromise terminateSelfWithResult START'); await globalThis.abilityContext.terminateSelfWithResult( diff --git a/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstageentry/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstageentry/entry/src/main/ets/pages/index.ets index d2eddd72214a6dbef1a13f11f7d28893758a08ef..f078d84762855f4bc1be1403e74b2ecf453f91b0 100644 --- a/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstageentry/entry/src/main/ets/pages/index.ets +++ b/ability/ability_runtime/freeinstalltest/startabilitystagetest/atomizationstageentry/entry/src/main/ets/pages/index.ets @@ -30,10 +30,4 @@ struct Index { .height('100%') } - async aboutToAppear() { - var permissions = ["ohos.permission.DISTRIBUTED_DATASYNC"]; - globalThis.abilityContext.getContext().requestPermissionsFromUser(permissions, 0, (data) => { - console.info("start requestPermissionsFromUser!!!!") - }) - } } \ No newline at end of file