Only cancel notification if update isn't installed

* Even if the package is removed on A/B devices
  we still want to show the reboot notification

Change-Id: I980d36766a1427874b65b11674a8f0ae4ce1db88
This commit is contained in:
Luca Stefani
2020-04-11 12:19:06 +02:00
parent 759d5510c8
commit d1273f214e

View File

@@ -126,7 +126,10 @@ public class UpdaterService extends Service {
if (extras != null && downloadId.equals( if (extras != null && downloadId.equals(
extras.getString(UpdaterController.EXTRA_DOWNLOAD_ID))) { extras.getString(UpdaterController.EXTRA_DOWNLOAD_ID))) {
mNotificationBuilder.setExtras(null); mNotificationBuilder.setExtras(null);
mNotificationManager.cancel(NOTIFICATION_ID); UpdateInfo update = mUpdaterController.getUpdate(downloadId);
if (update.getStatus() != UpdateStatus.INSTALLED) {
mNotificationManager.cancel(NOTIFICATION_ID);
}
} }
} }
} }