Bug 1115377 - Delete outdated update package when downloading new version. r=snorp

This commit is contained in:
Eugen Sawin 2015-01-14 20:24:43 +01:00
Родитель a6bdbdb9b5
Коммит a52fe731d9
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -118,11 +118,6 @@ public class UpdateService extends IntentService {
} else if (UpdateServiceHelper.ACTION_CANCEL_DOWNLOAD.equals(intent.getAction())) {
mCancelDownload = true;
} else {
if (!UpdateServiceHelper.ACTION_APPLY_UPDATE.equals(intent.getAction())) {
// Delete the update package used to install the current version.
deleteUpdatePackage(getLastFileName());
}
super.onStartCommand(intent, flags, startId);
}
@ -465,6 +460,11 @@ public class UpdateService extends IntentService {
}
}
if (!info.buildID.equals(getLastBuildID())) {
// Delete the previous package when a new version becomes available.
deleteUpdatePackage(getLastFileName());
}
Log.i(LOGTAG, "downloading update package");
sendCheckUpdateResult(UpdateServiceHelper.CheckUpdateResult.DOWNLOADING);