From e43f62bd794c26c306b3a49d5a9f79f43d36f3ec Mon Sep 17 00:00:00 2001 From: baoyang Date: Fri, 15 Nov 2024 18:34:53 +0800 Subject: [PATCH] fix application_copy problem Signed-off-by: baoyang Change-Id: I2d573cb73d1625c76216c103f99ffc298c4f7bd5 --- .../ets/SecurityExtAbility/SecurityExtAbility.ts | 10 +++++----- .../src/main/ets/common/utils/globalContext.ts | 2 +- .../src/main/ets/pages/securityDialog.ets | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/permissionmanager/src/main/ets/SecurityExtAbility/SecurityExtAbility.ts b/permissionmanager/src/main/ets/SecurityExtAbility/SecurityExtAbility.ts index b16a6a1..e2fa2af 100644 --- a/permissionmanager/src/main/ets/SecurityExtAbility/SecurityExtAbility.ts +++ b/permissionmanager/src/main/ets/SecurityExtAbility/SecurityExtAbility.ts @@ -61,13 +61,13 @@ export default class SecurityExtensionAbility extends extension { private async createWindow(name: string, windowType, rect, want): Promise { console.info(TAG + 'create securityWindow'); - let dialogSet: Set = GlobalContext.load('dialogSet'); + let dialogSet: Set = GlobalContext.load('dialogSet'); if (!dialogSet) { - dialogSet = new Set(); + dialogSet = new Set(); console.info(TAG + 'new dialogSet'); GlobalContext.store('dialogSet', dialogSet); } - let callerToken: string = want.parameters['ohos.aafwk.param.callerBundleName']; + let callerToken: number = want.parameters['ohos.caller.uid']; if (dialogSet.has(callerToken)) { console.info(TAG + 'window already exists'); return; @@ -77,8 +77,8 @@ export default class SecurityExtensionAbility extends extension { let storage: LocalStorage = new LocalStorage({ 'want': want, 'win': win }); await win.bindDialogTarget(want.parameters['ohos.ability.params.token'].value, () => { win.destroyWindow(); - let dialogSet: Set = GlobalContext.load('dialogSet'); - let callerToken: string = want.parameters['ohos.aafwk.param.callerBundleName']; + let dialogSet: Set = GlobalContext.load('dialogSet'); + let callerToken: number = want.parameters['ohos.caller.uid']; dialogSet.delete(callerToken); GlobalContext.store('dialogSet', dialogSet); if (dialogSet.size === 0) { diff --git a/permissionmanager/src/main/ets/common/utils/globalContext.ts b/permissionmanager/src/main/ets/common/utils/globalContext.ts index edb3b59..06bcf12 100644 --- a/permissionmanager/src/main/ets/common/utils/globalContext.ts +++ b/permissionmanager/src/main/ets/common/utils/globalContext.ts @@ -20,7 +20,7 @@ export class GlobalContext { bundleName: string; globalState: string; windowNum: number; - dialogSet: Set; + dialogSet: Set; public static getContext(): GlobalContext { if (!GlobalContext.instance) { diff --git a/permissionmanager/src/main/ets/pages/securityDialog.ets b/permissionmanager/src/main/ets/pages/securityDialog.ets index 43dc4ae..8d552a6 100644 --- a/permissionmanager/src/main/ets/pages/securityDialog.ets +++ b/permissionmanager/src/main/ets/pages/securityDialog.ets @@ -63,8 +63,8 @@ struct SecurityDialog { action: () => { this.dialogController?.close(); this.win.destroyWindow(); - let dialogSet: Set = GlobalContext.load('dialogSet'); - let callerToken: string = this.want.parameters['ohos.aafwk.param.callerBundleName']; + let dialogSet: Set = GlobalContext.load('dialogSet'); + let callerToken: number = this.want.parameters['ohos.caller.uid']; dialogSet.delete(callerToken); GlobalContext.store('dialogSet', dialogSet); if (dialogSet.size === 0) { @@ -85,8 +85,8 @@ struct SecurityDialog { autoCancel: false, cancel: () => { this.win.destroyWindow(); - let dialogSet: Set = GlobalContext.load('dialogSet'); - let callerToken: string = this.want.parameters['ohos.aafwk.param.callerBundleName']; + let dialogSet: Set = GlobalContext.load('dialogSet'); + let callerToken: number = this.want.parameters['ohos.caller.uid']; dialogSet.delete(callerToken); GlobalContext.store('dialogSet', dialogSet); if (dialogSet.size === 0) { @@ -238,8 +238,8 @@ struct SecurityDialog { data.reclaim(); reply.reclaim(); this.win.destroyWindow(); - let dialogSet: Set = GlobalContext.load('dialogSet'); - let callerToken: string = this.want.parameters['ohos.aafwk.param.callerBundleName']; + let dialogSet: Set = GlobalContext.load('dialogSet'); + let callerToken: number = this.want.parameters['ohos.caller.uid']; dialogSet.delete(callerToken); GlobalContext.store('dialogSet', dialogSet); if (dialogSet.size === 0) {