Fix service app launch fail for use extension before initialize 86/314686/1 submit/tizen/20240718.160027
authorChunling Ye <chunling.ye@samsung.com>
Wed, 17 Jul 2024 09:48:16 +0000 (17:48 +0800)
committerChunling Ye <chunling.ye@samsung.com>
Wed, 17 Jul 2024 09:48:16 +0000 (17:48 +0800)
In wrtjs patch https://review.tizen.org/gerrit/313614/, move the
new DeviceAPIRouter befroe the XWalkExtension.initialize, but in
new DeviceAPIRouter will use the extensions, so this change lead
many undefined js error.

Now move new DeviceAPIRouter logic behind XWalkExtension.initialize.

Change-Id: Icf7b898777789de2536b18236e4f792360c0fe51
Signed-off-by: Chunling Ye <chunling.ye@samsung.com>
wrt_app/service/service_runner.ts

index 6187297664bc8bca2d4b638a8eb034918e30535e..814de69c880c641629a95001b5d3ebf612871b2f 100644 (file)
@@ -81,8 +81,6 @@ export function start(id: string, filename: string) {
 
     global.ssoGuid = wrt.tv?.getSSOGuid();
     wrt.security?.dropThreadPrivilege(packageId, serviceId);
-
-    deviceApiRouter = new DeviceAPIRouter(id, isGlobalService());
   }
 
   wrt.setServiceAppId(id);
@@ -96,6 +94,7 @@ export function start(id: string, filename: string) {
   });
 
   console.debug(`serviceType : ${global['serviceType']}`)
+  deviceApiRouter = new DeviceAPIRouter(id, isGlobalService());
   printAppControlData(id);
   ServiceMessage.initConsoleMessageNotification(id);