From: hyunduk.kim Date: Mon, 16 Sep 2019 06:23:59 +0000 (+0900) Subject: [Addon Setting App] Uninstallation from device X-Git-Tag: submit/tizen/20190920.002515~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d7ab2ebd4e79052725bc06cb462e7c230d67abbb;p=platform%2Fframework%2Fweb%2Fwrtjs.git [Addon Setting App] Uninstallation from device When user selects 'X' button for unistallation, it not only removes the addon from addon DB file but also unistalls the addon package from device. - Handle pkgid(package id) field for each installed addon - The pkgid is passed to wrtjs when user selects to uninstall - WRTjs eventually invokes package manager API to uninstall the addon package as you can see in [1] and [2] - To use the package manager API, this app needs to have privilege http://tizen.org/privilege/packagemanager.install and also be packed to wgt with platform privilege level [1] https://review.tizen.org/gerrit/213786 [2] https://review.tizen.org/gerrit/213787 Change-Id: I547ea9a3aea8487a5759c1886435911819b7491c Signed-off-by: hyunduk.kim --- diff --git a/addon_setting_app/config.xml b/addon_setting_app/config.xml index b04d31d6..5fca78dc 100755 --- a/addon_setting_app/config.xml +++ b/addon_setting_app/config.xml @@ -6,6 +6,7 @@ WebApp Addon Settings + diff --git a/addon_setting_app/src/extension_manager.js b/addon_setting_app/src/extension_manager.js index 7ccd34ba..d4b2658e 100644 --- a/addon_setting_app/src/extension_manager.js +++ b/addon_setting_app/src/extension_manager.js @@ -148,7 +148,7 @@ } this.saveJsonDB(); - ipcRenderer.send(IPC_EXTENSIONS_UNINSTALLED, extension.name); + ipcRenderer.send(IPC_EXTENSIONS_UNINSTALLED, extension.name, extension.pkgid); } /* installer - get manifest info from path */ @@ -175,6 +175,16 @@ else extension.type = 'WRT'; extension.activate = true; // activate by default + let arr = ext_path.split("/"); + let index = -1; + for (let i in arr) { + if (arr[i] == 'shared') { + index = i - 1; + break; + } + } + extension.pkgid = arr[index]; + return extension; }