From 75b1c4f8064e1680aa2bd3d6c21b3662c51f07de Mon Sep 17 00:00:00 2001 From: DongHyun Song Date: Thu, 2 Jul 2020 17:20:33 +0900 Subject: [PATCH] [Service][VD] Add getPackageId for eden preview plugin Add getPackageId() for eden preview plugin, which is using package ID as unique key of preview DB. getPackageId: return package ID from tizen.application's info getServiceId: return service ID of internal_id Change-Id: I587a1815d4783d5dfc692aec6b0a4a9d4401cfd8 Signed-off-by: DongHyun Song --- wrt_app/common/service_manager.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/wrt_app/common/service_manager.js b/wrt_app/common/service_manager.js index a699a6f..3e77f26 100644 --- a/wrt_app/common/service_manager.js +++ b/wrt_app/common/service_manager.js @@ -30,7 +30,17 @@ function startService(id, filename) { }; if (wrt.tv) { sandbox[id].webapis = webapis; - sandbox[id].webapis.getApplicationId = () => { return id; } + sandbox[id].webapis.getServiceId = () => { + let service_id = id.split(':')[0]; + return service_id; + } + sandbox[id].webapis.getPackageId = () => { + let service_id = id.split(':')[0]; + let app_info = tizen.application.getAppInfo(service_id); + if (app_info) + return app_info.packageId; + return ''; + } } if (is_global_service) { -- 2.7.4