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 <hyunduk.kim@samsung.com>
<feature name="http://tizen.org/feature/screen.size.all"/>
<icon src="icon.png"/>
<name>WebApp Addon Settings</name>
+ <tizen:privilege name="http://tizen.org/privilege/packagemanager.install"/>
<tizen:privilege name="http://tizen.org/privilege/internet"/>
<tizen:privilege name="http://tizen.org/privilege/download"/>
<tizen:privilege name="http://tizen.org/privilege/filesystem.read"/>
}
this.saveJsonDB();
- ipcRenderer.send(IPC_EXTENSIONS_UNINSTALLED, extension.name);
+ ipcRenderer.send(IPC_EXTENSIONS_UNINSTALLED, extension.name, extension.pkgid);
}
/* installer - get manifest info from path */
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;
}