From: liwei Date: Fri, 15 Jan 2021 02:19:22 +0000 (+0800) Subject: [Tizen6.5 Migration][Service] Print appcontrol data when service app is launched X-Git-Tag: submit/tizen/20210118.023427^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=486ed93ebf9d237de154cd431219727f46221e42;p=platform%2Fframework%2Fweb%2Fwrtjs.git [Tizen6.5 Migration][Service] Print appcontrol data when service app is launched Now in many scenario UI app launch service app, service app will check tizen.application.getCurrentApplication().getRequestedAppControl() operation and data, so print this data is good for debugging. (ex. 3201506003227, STARZY) Related patch: https://review.tizen.org/gerrit/248053/ Change-Id: I9f7b6c6319ddc0e16089ef826855ce064aeb754f Signed-off-by: liwei --- diff --git a/wrt_app/common/service_runner.ts b/wrt_app/common/service_runner.ts index 8913929..4a0d1f1 100644 --- a/wrt_app/common/service_runner.ts +++ b/wrt_app/common/service_runner.ts @@ -16,6 +16,15 @@ function isServiceApplication() { function isGlobalService() { return global['serviceType'] === 'GLOBAL'; } +function printAppControlData(id: string) { + var reqAppControl = global.tizen.application.getCurrentApplication().getRequestedAppControl(); + var appControlData = reqAppControl.appControl.data; + console.log(`id: ${id}, appControlData operation: ${reqAppControl.appControl.operation}`); + for (var dataIndex in appControlData) { + for (var valueIndex in appControlData[dataIndex].value) + console.log(`data[${dataIndex}][${valueIndex}]: ${appControlData[dataIndex].value[valueIndex]}`); + } +} function registerExtensionResolver(id: string) { if (wrt.tv) { @@ -63,6 +72,7 @@ export function start(id: string, filename: string) { // FIXME: this is for awaking up uv loop. // uv loop is sleeping for a few second with tizen webapis's aync callback fakeTimer = setInterval(() => {}, 100); + printAppControlData(id); try { app = require(filename); if (app.onStart !== undefined) {