[Service][Builtin] Notify WAS module install app 65/260965/3
authorliwei <wei90727.li@samsung.com>
Wed, 7 Jul 2021 12:39:37 +0000 (20:39 +0800)
committerliwei <wei90727.li@samsung.com>
Tue, 13 Jul 2021 08:24:52 +0000 (16:24 +0800)
This built-in service support W3C AppManifest
installation, notify webappservice module to
install app, then this app can be shown in
apps store.

Native side patch
https://review.tizen.org/gerrit/260966/

Change-Id: If9d0d476a49916be5ff6e0ff6f85485ceaeb3466
Signed-off-by: liwei <wei90727.li@samsung.com>
wrt_app/service/builtins/appmanifest_loader.ts

index 2c8597bd372c82ae74fcb3fda0b5ca7c7311792c..374350195ad0640db82f728b6b782e2a266994ea 100644 (file)
@@ -128,22 +128,11 @@ function cleanUpAndQuit(appName: string) {
 }
 
 function installWgt(appName: string) {
-  let onInstallation = {
-    onprogress: (packageId: string, percentage: string) => {
-      console.log("On installation(" + packageId + ") : progress(" + percentage + ")");
-    },
-    oncomplete: (packageId: string) => {
-      console.log("Installation(" + packageId + ") Complete");
-      wrt.postPlainNotification(appName, 'Install Success', 5);
-      cleanUpAndQuit(appName);
-    }
-  };
   let wgtPath = `${baseWorkingDir}/${appName}/${appName}.wgt`;
-  console.log(`wgtPath: ${wgtPath}`);
-  global.tizen.package.install(wgtPath, onInstallation, (err: any) => {
-    console.log("Error occurred on installation : " + err.name);
-    cleanUpAndQuit(appName);
-  });
+  let installinfo = "{\"app_id\":\"" + appName + "\",\"pkg_path\":\"" + wgtPath + "\"}";
+  console.log(`installWgt info: ${installinfo}`);
+  wrt.notifyInstall(installinfo);
+  process.exit();
 }
 
 function makeWgt(appName: string) {