From ae44edd7eb4d09634531b218e16f3830ceee4ab5 Mon Sep 17 00:00:00 2001 From: DongHyun Song Date: Thu, 17 Dec 2020 14:07:33 +0900 Subject: [PATCH] [Tizen6.5 Migration][Service] Add getPkgApiVersion for global model xwalk.utils.getPkgApiVersion will return required_version of config.xml. (a.k.a. api version) This getPkgApiVersion() is used to check api privileges which is allowed in Tizen platform version. Without this patch, getPkgApiVersion() will returns wrt-service package's api version in its manifest. Reference: https://review.tizen.org/gerrit/247389/ Change-Id: Id084f2eda53e3310a2d7c5842d6bd1be4ca34fe0 Signed-off-by: DongHyun Song --- wrt_app/service/device_api_router.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wrt_app/service/device_api_router.ts b/wrt_app/service/device_api_router.ts index 7cb70cb..50f6c99 100644 --- a/wrt_app/service/device_api_router.ts +++ b/wrt_app/service/device_api_router.ts @@ -16,6 +16,7 @@ export class DeviceAPIRouter { packageId: string; callerAppId: string; permissions: string[]; + pkgApiVersion: string; constructor(id: string, isGlobal: boolean) { this.id = id; @@ -24,10 +25,12 @@ export class DeviceAPIRouter { this.callerAppId = ids[1] ?? ''; this.packageId = this.serviceId.split('.')[0]; this.permissions = []; + this.pkgApiVersion = ''; this.initWebapis(); if (isGlobal) { this.permissions = wrt.getPrivileges(this.id); + this.pkgApiVersion = wrt.getPkgApiVersion(this.id); this.refineApplicationApis(); this.refinePackageApis(); this.refineFilesystemApis() @@ -276,5 +279,8 @@ export class DeviceAPIRouter { throw 'Permission denied'; } } + global.xwalk.utils.getPkgApiVersion = () => { + return this.pkgApiVersion; + } } } -- 2.7.4