[VD] Show window for background execution app in deeplink scenario 87/265887/4 accepted/tizen/unified/20211104.123521 submit/tizen/20211102.160025
authorliwei <wei90727.li@samsung.com>
Mon, 1 Nov 2021 08:36:23 +0000 (16:36 +0800)
committerliwei <wei90727.li@samsung.com>
Tue, 2 Nov 2021 08:28:34 +0000 (16:28 +0800)
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 <wei90727.li@samsung.com>
wrt_app/common/web_application_delegate.ts
wrt_app/src/tv/web_application_tv.ts
wrt_app/src/web_application.ts [changed mode: 0755->0644]

index 648ccb4..7d3bd18 100644 (file)
@@ -24,7 +24,7 @@ export class WebApplicationDelegate {
     this.webApplication = webApplication;
   }
 
-  backgroundExecutable() { return false; }
+  backgroundExecutableLaunchMode() { return false; }
   beforeQuit() { }
   canIgnoreSuspend() { return false; }
   clearCache() { }
index 8a29733..eeaaae5 100644 (file)
@@ -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;
   }
 
old mode 100755 (executable)
new mode 100644 (file)
index b891413..aa020c0
@@ -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();