Set status to INSTALLING when reconnecting to the service

Otherwise the service won't run in foreground after restarting
the app while an update is being installed.

Change-Id: I8a75d206ead2945e7326c144b0b4354fbb2accb4
This commit is contained in:
Gabriele M
2018-03-24 16:17:19 +01:00
parent dd712cfdbe
commit fa5f24ac3f

View File

@@ -67,6 +67,10 @@ class ABUpdateInstaller {
switch (status) {
case UpdateEngine.UpdateStatusConstants.DOWNLOADING:
case UpdateEngine.UpdateStatusConstants.FINALIZING: {
if (update.getStatus() != UpdateStatus.INSTALLING) {
update.setStatus(UpdateStatus.INSTALLING);
mUpdaterController.notifyUpdateChange(mDownloadId);
}
int progress = Math.round(percent * 100);
mUpdaterController.getActualUpdate(mDownloadId).setInstallProgress(progress);
boolean finalizing = status == UpdateEngine.UpdateStatusConstants.FINALIZING;