fix application_copy problem

Signed-off-by: baoyang <baoyang9@huawei.com>
Change-Id: I2d573cb73d1625c76216c103f99ffc298c4f7bd5
This commit is contained in:
baoyang 2024-11-15 18:34:53 +08:00
parent cd4f029e11
commit e43f62bd79
3 changed files with 12 additions and 12 deletions

View File

@ -61,13 +61,13 @@ export default class SecurityExtensionAbility extends extension {
private async createWindow(name: string, windowType, rect, want): Promise<void> {
console.info(TAG + 'create securityWindow');
let dialogSet: Set<string> = GlobalContext.load('dialogSet');
let dialogSet: Set<number> = GlobalContext.load('dialogSet');
if (!dialogSet) {
dialogSet = new Set<string>();
dialogSet = new Set<number>();
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<string> = GlobalContext.load('dialogSet');
let callerToken: string = want.parameters['ohos.aafwk.param.callerBundleName'];
let dialogSet: Set<number> = GlobalContext.load('dialogSet');
let callerToken: number = want.parameters['ohos.caller.uid'];
dialogSet.delete(callerToken);
GlobalContext.store('dialogSet', dialogSet);
if (dialogSet.size === 0) {

View File

@ -20,7 +20,7 @@ export class GlobalContext {
bundleName: string;
globalState: string;
windowNum: number;
dialogSet: Set<string>;
dialogSet: Set<number>;
public static getContext(): GlobalContext {
if (!GlobalContext.instance) {

View File

@ -63,8 +63,8 @@ struct SecurityDialog {
action: () => {
this.dialogController?.close();
this.win.destroyWindow();
let dialogSet: Set<string> = GlobalContext.load('dialogSet');
let callerToken: string = this.want.parameters['ohos.aafwk.param.callerBundleName'];
let dialogSet: Set<number> = 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<string> = GlobalContext.load('dialogSet');
let callerToken: string = this.want.parameters['ohos.aafwk.param.callerBundleName'];
let dialogSet: Set<number> = 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<string> = GlobalContext.load('dialogSet');
let callerToken: string = this.want.parameters['ohos.aafwk.param.callerBundleName'];
let dialogSet: Set<number> = GlobalContext.load('dialogSet');
let callerToken: number = this.want.parameters['ohos.caller.uid'];
dialogSet.delete(callerToken);
GlobalContext.store('dialogSet', dialogSet);
if (dialogSet.size === 0) {