Keep track of the installation status of AB updates

This allows to show the correct labels.

Change-Id: I52f42e042af0df2d091d786c03102cec352b3a5b
This commit is contained in:
Gabriele M
2017-11-30 23:41:00 +01:00
parent c5f36ee047
commit e66a8fa53a
6 changed files with 26 additions and 14 deletions

View File

@@ -414,20 +414,15 @@ public class UpdaterService extends Service {
}
private void handleInstallProgress(UpdateInfo update) {
setNotificationTitle(update);
int progress = update.getInstallProgress();
mNotificationBuilder.setProgress(100, progress, false);
setNotificationTitle(update);
if (progress == 0) {
mNotificationStyle.bigText(getString(R.string.finalizing_package));
mNotificationBuilder.setProgress(0, 0, true);
} else {
String percent = NumberFormat.getPercentInstance().format(progress / 100.f);
mNotificationStyle.setSummaryText(percent);
mNotificationStyle.bigText(getString(R.string.preparing_ota_first_boot));
}
String percent = NumberFormat.getPercentInstance().format(progress / 100.f);
mNotificationStyle.setSummaryText(percent);
mNotificationStyle.bigText(
update.getFinalizing() ?
getString(R.string.finalizing_package) :
getString(R.string.preparing_ota_first_boot));
mNotificationManager.notify(NOTIFICATION_ID, mNotificationBuilder.build());
}