diff --git a/validator/acts_validator/src/main/ets/MainAbility/MainAbility.ts b/validator/acts_validator/src/main/ets/MainAbility/MainAbility.ts index aa2cf44bd25401258bb5a8561fbefa682e858ff4..98a7fc7fbdde7da93dd175ae0555f1b5fed654b1 100644 --- a/validator/acts_validator/src/main/ets/MainAbility/MainAbility.ts +++ b/validator/acts_validator/src/main/ets/MainAbility/MainAbility.ts @@ -1,13 +1,8 @@ import Ability from '@ohos.app.ability.UIAbility' - -const PERMISSIONS: Array = [ - 'ohos.permission.READ_MEDIA', - 'ohos.permission.WRITE_MEDIA', - 'ohos.permission.CAPTURE_SCREEN'] +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; export default class MainAbility extends Ability { onCreate(want, launchParam) { - this.context.requestPermissionsFromUser(PERMISSIONS) globalThis.dir=this.context.filesDir; console.log("[Demo] MainAbility onCreate") globalThis.abilityWant = want; @@ -18,8 +13,11 @@ export default class MainAbility extends Ability { } onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability + console.log("[Demo] MainAbility onWindowStageCreate") + let AtManager = abilityAccessCtrl.createAtManager(); + AtManager.requestPermissionsFromUser(this.context,["ohos.permission.READ_MEDIA","ohos.permission.WRITE_MEDIA", + "ohos.permission.CAPTURE_SCREEN"]).then(() => {}) windowStage.loadContent("pages/index", (err, data) => { if (err.code) { diff --git a/validator/acts_validator/src/main/ets/pages/ArkUI/TouchMoveTest.ets b/validator/acts_validator/src/main/ets/pages/ArkUI/TouchMoveTest.ets index 0b4514beb3b524b32d025cf6ec3928f9dbe1e83b..583ae581717626d1b2a2cd095377f4b2227bdf44 100644 --- a/validator/acts_validator/src/main/ets/pages/ArkUI/TouchMoveTest.ets +++ b/validator/acts_validator/src/main/ets/pages/ArkUI/TouchMoveTest.ets @@ -122,7 +122,7 @@ struct CustomContainer1 { await fileio.close(fd); Logger.info(TAG, `write done`); prompt.showToast({ - message: '图片保存成功', duration: 1000 + message: '结果保存成功', duration: 1000 }); } getScreen = (isFullScreen: boolean) => {