From: liwei Date: Mon, 1 Nov 2021 08:36:23 +0000 (+0800) Subject: [VD] Show window for background execution app in deeplink scenario X-Git-Tag: accepted/tizen/unified/20211104.123521^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d72b248a6beac7ecd6ebd23fd6de7da75921bc54;p=platform%2Fframework%2Fweb%2Fwrtjs.git [VD] Show window for background execution app in deeplink scenario Now, for backexecution(http://samsung.com/tv/metadata/background.execution.support) app, when app go background, WRT will call evas_object_hide() manually, it's a new logic for 'add Gaming hub feature'(https://review.tizen.org/gerrit/259693/), bcz WRT call evas_object_hide(), so appfw clear win cache data in its side, then appfw cannot raise window(__raise_win()) while app launch by deeplink(unneed reload). To fix this issue, when app launched by deeplink(unneed reload) and this app config background execution metadata, WRT will show it manually. Change-Id: I93229016cb08314adce3ebee8a80dfba35e8ba67 Signed-off-by: liwei --- diff --git a/wrt_app/common/web_application_delegate.ts b/wrt_app/common/web_application_delegate.ts index 648ccb4..7d3bd18 100644 --- a/wrt_app/common/web_application_delegate.ts +++ b/wrt_app/common/web_application_delegate.ts @@ -24,7 +24,7 @@ export class WebApplicationDelegate { this.webApplication = webApplication; } - backgroundExecutable() { return false; } + backgroundExecutableLaunchMode() { return false; } beforeQuit() { } canIgnoreSuspend() { return false; } clearCache() { } diff --git a/wrt_app/src/tv/web_application_tv.ts b/wrt_app/src/tv/web_application_tv.ts index 8a29733..eeaaae5 100644 --- a/wrt_app/src/tv/web_application_tv.ts +++ b/wrt_app/src/tv/web_application_tv.ts @@ -21,7 +21,8 @@ import { WebApplication } from '../web_application'; import { WebApplicationDelegate } from '../../common/web_application_delegate'; export class WebApplicationDelegateTV extends WebApplicationDelegate { - backgroundExecution: boolean = false; + backgroundExecutionLaunchMode: boolean = false; + backgroundExecutionMetaData: string = 'false'; inspectorSrc: string = ''; isAlwaysReload: boolean = false; preloadStatus: string = 'none'; @@ -43,15 +44,16 @@ export class WebApplicationDelegateTV extends WebApplicationDelegate { this.preloadStatus = 'none'; } if (options.launchMode == 'backgroundExecution') { - console.log('backgroundExecution'); - this.backgroundExecution = true; + console.log('launch mode is backgroundExecution'); + this.backgroundExecutionLaunchMode = true; } else { - this.backgroundExecution = false; + this.backgroundExecutionLaunchMode = false; } this.isAlwaysReload = this.tv.isAlwaysReload(); this.webApplication.multitaskingSupport = this.tv.getMultitaskingSupport(); this.webApplication.defaultBackgroundColor = '#0000'; this.webApplication.defaultTransparent = true; + this.backgroundExecutionMetaData = this.tv.getMetadata('http://samsung.com/tv/metadata/background.execution.support'); this.initEventListener(); } @@ -136,8 +138,8 @@ Then you can get profile log from the initial loading.`; } } - backgroundExecutable() { - return this.backgroundExecution; + backgroundExecutableLaunchMode() { + return this.backgroundExecutionLaunchMode; } isPreloading() { @@ -180,7 +182,7 @@ Then you can get profile log from the initial loading.`; needInpectorGuide() { let inspectorEnabledByVconf = this.tv.needUseInspector(); - if (inspectorEnabledByVconf && !this.backgroundExecution) { + if (inspectorEnabledByVconf && !this.backgroundExecutionLaunchMode) { this.inspectorSrc = this.webApplication.contentSrc; this.webApplication.contentSrc = 'about:blank'; return true; @@ -237,6 +239,11 @@ Then you can get profile log from the initial loading.`; return false; } } + + if ('true' === this.backgroundExecutionMetaData) { + console.log(`handle AppControl background exectution app to show`); + this.webApplication.mainWindow.show(); + } return true; } diff --git a/wrt_app/src/web_application.ts b/wrt_app/src/web_application.ts old mode 100755 new mode 100644 index b891413..aa020c0 --- a/wrt_app/src/web_application.ts +++ b/wrt_app/src/web_application.ts @@ -266,7 +266,7 @@ export class WebApplication { } private backgroundRunnable() { - return this.backgroundSupport || this.profileDelegate.backgroundExecutable(); + return this.backgroundSupport || this.profileDelegate.backgroundExecutableLaunchMode(); } handleAppControlEvent(appControl: any) { @@ -404,8 +404,8 @@ export class WebApplication { return; } console.log('WebApplication : show'); - if (this.profileDelegate.backgroundExecutable()) { - console.log('skip showing while backgroundExecution mode'); + if (this.profileDelegate.backgroundExecutableLaunchMode()) { + console.log('skip showing while backgroundExecutionLaunchMode mode'); } else if (!this.mainWindow.isVisible()) { console.log(`show this.windowList.length : ${this.windowList.length}`); this.mainWindow.show();