mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 15:25:52 +00:00
Bug 1000315 - Part 5: Uninstall prompting on Android (just a stub for now). r=mfinkle
This commit is contained in:
parent
2206f043e8
commit
f1f8c2ebb6
@ -353,6 +353,7 @@ var BrowserApp = {
|
||||
Services.obs.addObserver(this, "webapps-runtime-install", false);
|
||||
Services.obs.addObserver(this, "webapps-runtime-install-package", false);
|
||||
Services.obs.addObserver(this, "webapps-ask-install", false);
|
||||
Services.obs.addObserver(this, "webapps-ask-uninstall", false);
|
||||
Services.obs.addObserver(this, "webapps-launch", false);
|
||||
Services.obs.addObserver(this, "webapps-runtime-uninstall", false);
|
||||
Services.obs.addObserver(this, "Webapps:AutoInstall", false);
|
||||
@ -1707,6 +1708,10 @@ var BrowserApp = {
|
||||
WebappManager.askInstall(JSON.parse(aData));
|
||||
break;
|
||||
|
||||
case "webapps-ask-uninstall":
|
||||
WebappManager.askUninstall(JSON.parse(aData));
|
||||
break;
|
||||
|
||||
case "webapps-launch": {
|
||||
WebappManager.launch(JSON.parse(aData));
|
||||
break;
|
||||
|
@ -194,6 +194,12 @@ this.WebappManager = {
|
||||
});
|
||||
},
|
||||
|
||||
askUninstall: function(aData) {
|
||||
// Android does not currently support automatic uninstalling of apps.
|
||||
// See bug 1019054.
|
||||
DOMApplicationRegistry.denyUninstall(aData, "NOT_SUPPORTED");
|
||||
},
|
||||
|
||||
launch: function({ apkPackageName }) {
|
||||
debug("launch: " + apkPackageName);
|
||||
|
||||
@ -633,8 +639,7 @@ this.WebappManager = {
|
||||
let app = DOMApplicationRegistry.webapps[id];
|
||||
if (aData.apkPackageNames.indexOf(app.apkPackageName) > -1) {
|
||||
debug("attempting to uninstall " + app.name);
|
||||
DOMApplicationRegistry.uninstall(
|
||||
app.manifestURL,
|
||||
DOMApplicationRegistry.uninstall(app.manifestURL).then(
|
||||
function() {
|
||||
debug("success uninstalling " + app.name);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user