[Service] Add wrt.setServiceAppId() 58/261258/4 submit/tizen/20210715.160020
authorDongHyun, Song <dh81.song@samsung.com>
Wed, 14 Jul 2021 04:57:53 +0000 (13:57 +0900)
committerDongHyun, Song <dh81.song@samsung.com>
Wed, 14 Jul 2021 05:47:52 +0000 (14:47 +0900)
To set app id by tid base, calls wrt.setServiceAppId() at first.

Related patch:
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/261259/

Change-Id: Idc38d5b179fe71fdc264564e03aaf4a432bf2a87
Signed-off-by: DongHyun, Song <dh81.song@samsung.com>
wrt_app/service/device_api_router.ts
wrt_app/service/service_runner.ts

index 1799792..2c9c051 100644 (file)
@@ -239,8 +239,6 @@ export class DeviceAPIRouter {
       this.funcRequestedAppcontrol = this.currentApplication.getRequestedAppControl;
       this.currentApplication.getRequestedAppControl = () => {
         console.log(`Routing - getRequestedAppControl() : ${this.getServiceId()}`);
-        if (wrt.tv)
-          wrt.tv.setCurrentApplication(this.getServiceId());
         return this.funcRequestedAppcontrol();
       }
       return this.currentApplication;
index c028e03..1fd2080 100644 (file)
@@ -67,6 +67,7 @@ let checkLauncherAlive = (id: string) => {
 }
 
 export function start(id: string, filename: string) {
+  wrt.setServiceAppId(id);
   XWalkExtension.initialize();
   XWalkExtension.setRuntimeMessageHandler((type, data) => {
     if (type === 'tizen://exit') {
@@ -93,13 +94,12 @@ export function start(id: string, filename: string) {
     console.log(`start global service file: ${filename}`);
   }
 
-  printAppControlData(id);
-
   try {
     let ids = id.split(':');
     let serviceId = ids[0];
     let packageId = global.webapis.getPackageId();
     wrt.security?.dropThreadPrivilege(packageId, serviceId);
+    printAppControlData(id);
 
     app = require(filename);
     if (app.onStart !== undefined) {