Merge pull request !351 from fanchenxuan/master_
This commit is contained in:
openharmony_ci 2024-11-21 06:29:49 +00:00 committed by Gitee
commit 47399dc183
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 7 additions and 15 deletions

View File

@ -26,11 +26,6 @@ export default class MainAbility extends UIAbility {
onCreate(want, launchParam): void {
console.log(TAG + 'MainAbility onCreate, ability name is ' + want.abilityName + '.');
if (!this.permissionCheck()) {
this.context.terminateSelf();
return;
}
globalThis.bundleName = want.parameters.bundleName;
GlobalContext.store('bundleName', want.parameters.bundleName);
GlobalContext.store('context', this.context);
@ -41,6 +36,11 @@ export default class MainAbility extends UIAbility {
console.log(TAG + 'MainAbility onWindowStageCreate.');
globalThis.windowStage = windowStage;
globalThis.refresh = false;
if (!this.permissionCheck()) {
windowStage.loadContent('pages/transition');
this.context.terminateSelf();
return;
}
if (globalThis.bundleName) {
globalThis.currentApp = globalThis.bundleName;
@ -82,14 +82,6 @@ export default class MainAbility extends UIAbility {
console.log(TAG + 'MainAbility onNewWant. want: ' + JSON.stringify(want));
console.log(TAG + 'MainAbility onNewWant. bundleName: ' + JSON.stringify(want.parameters.bundleName));
if (!this.permissionCheck()) {
this.context.terminateSelf();
return;
}
if (globalThis.currentApp === undefined) {
this.context.terminateSelf();
}
let bundleName = want.parameters.bundleName ? want.parameters.bundleName : 'all';
if (globalThis.currentApp === 'all') {
if (globalThis.currentApp !== bundleName) {