Show progress when installing AB updates

Change-Id: If8cd2e2da1f15a4af415aa35ccf61052c318333f
This commit is contained in:
Gabriele M
2017-11-30 23:40:59 +01:00
parent 2c41ae392c
commit 02f52108d9
2 changed files with 6 additions and 3 deletions

View File

@@ -159,7 +159,10 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
} else if (mUpdaterController.isInstallingUpdate(downloadId)) {
setButtonAction(viewHolder.mAction, Action.INSTALL, downloadId, false);
viewHolder.mProgressText.setText(R.string.list_installing_update);
viewHolder.mProgressBar.setIndeterminate(true);
viewHolder.mProgressBar.setProgress(update.getInstallProgress());
String percentage = NumberFormat.getPercentInstance().format(
update.getInstallProgress() / 100.f);
viewHolder.mProgressPercentage.setText(percentage);
} else if (mUpdaterController.isVerifyingUpdate(downloadId)) {
setButtonAction(viewHolder.mAction, Action.INSTALL, downloadId, false);
viewHolder.mProgressText.setText(R.string.list_verifying_update);
@@ -226,7 +229,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
activeLayout = update.getStatus() == UpdateStatus.STARTING;
break;
case UpdateStatus.Persistent.VERIFIED:
activeLayout = false;
activeLayout = update.getStatus() == UpdateStatus.INSTALLING;
break;
case UpdateStatus.Persistent.INCOMPLETE:
activeLayout = true;

View File

@@ -332,7 +332,7 @@ public class UpdaterService extends Service {
}
case INSTALLING: {
mNotificationBuilder.mActions.clear();
mNotificationBuilder.setProgress(0, 0, true);
mNotificationBuilder.setProgress(0, 0, false);
mNotificationStyle.setSummaryText(null);
String text = getString(R.string.installing_update);
mNotificationStyle.bigText(text);