[Service] update package_id based on input received 79/244279/4
authork2.nagaraju <k2.nagaraju@samsung.com>
Wed, 16 Sep 2020 17:46:01 +0000 (23:16 +0530)
committerk2.nagaraju <k2.nagaraju@samsung.com>
Fri, 18 Sep 2020 17:40:25 +0000 (23:10 +0530)
If passed parameter is |false| or |undefined| then also
|package_id| is updated as current package. which is causing
failure in package service webtct failure.

Change-Id: I6823ed175c3e65224e699d3084b28cd27eb3fab9
Signed-off-by: k2.nagaraju <k2.nagaraju@samsung.com>
wrt_app/service/device_api_router.ts

index b7f645b..3772d5d 100644 (file)
@@ -119,10 +119,11 @@ export class DeviceAPIRouter {
   refinePackageApis() {
     // tizen.package.getPackageInfo()
     this.funcGetPackageInfo = global.tizen.package.getPackageInfo;
-    global.tizen.package.getPackageInfo = (package_id?: string) => {
-      console.log(`Routing - getPackageInfo()`);
-      if (!package_id)
+    global.tizen.package.getPackageInfo = (...args: any[]) => {
+      let package_id = args[0];
+      if (!args.length || args[0] === null)
         package_id = this.getPackageId();
+      console.log(`Routing - getPackageInfo() : ${package_id}`);
       return this.funcGetPackageInfo(package_id);
     }
   }