From: DongHyun, Song Date: Wed, 14 Jul 2021 04:57:53 +0000 (+0900) Subject: [Service] Add wrt.setServiceAppId() X-Git-Tag: submit/tizen/20210715.160020^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3da9a4868f0a5ee3962f985f63e9fa979cf07a09;p=platform%2Fframework%2Fweb%2Fwrtjs.git [Service] Add wrt.setServiceAppId() 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 --- diff --git a/wrt_app/service/device_api_router.ts b/wrt_app/service/device_api_router.ts index 17997926..2c9c0516 100644 --- a/wrt_app/service/device_api_router.ts +++ b/wrt_app/service/device_api_router.ts @@ -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; diff --git a/wrt_app/service/service_runner.ts b/wrt_app/service/service_runner.ts index c028e032..1fd20808 100644 --- a/wrt_app/service/service_runner.ts +++ b/wrt_app/service/service_runner.ts @@ -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) {