Bug 828944 - downloadavailable flag is removed if you reboot after stopping the download r=ferjm

This commit is contained in:
Fabrice Desré 2013-01-11 07:32:06 -08:00
parent 4e5550547b
commit e099e975b1
2 changed files with 7 additions and 3 deletions

View File

@ -407,6 +407,7 @@ UpdatePrompt.prototype = {
// Trigger apps update check and wait for all to be done before
// notifying gaia.
onUpdateCheckStart: function UP_onUpdateCheckStart() {
log("onUpdateCheckStart (" + this._checkingApps + ")");
// Don't start twice.
if (this._checkingApps) {
return;
@ -426,8 +427,11 @@ UpdatePrompt.prototype = {
this.result.forEach(function updateApp(aApp) {
let update = aApp.checkForUpdate();
update.onsuccess = function() {
if (aApp.downloadAvailable) {
appsToUpdate.push(aApp.manifestURL);
}
appsChecked += 1;
appsToUpdate.push(aApp.manifestURL);
if (appsChecked == appsCount) {
self.appsUpdated(appsToUpdate);
}

View File

@ -914,8 +914,6 @@ this.DOMApplicationRegistry = {
app.progress = 0;
app.installState = download.previousState;
app.downloading = false;
app.downloadAvailable = false;
app.downloadSize = 0;
this._saveApps((function() {
this.broadcastMessage("Webapps:PackageEvent",
{ type: "canceled",
@ -968,6 +966,7 @@ this.DOMApplicationRegistry = {
manifestURL: aManifestURL,
app: app,
manifest: jsonManifest });
DOMApplicationRegistry._saveApps();
}
}).bind(this));
@ -1869,6 +1868,7 @@ this.DOMApplicationRegistry = {
manifestURL: aApp.manifestURL,
app: app });
lastProgressTime = now;
self._saveApps();
}
},
onStatus: function notifStatus(aRequest, aContext, aStatus, aStatusArg) { },