Show progress when installing AB updates
Change-Id: If8cd2e2da1f15a4af415aa35ccf61052c318333f
This commit is contained in:
@@ -159,7 +159,10 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
|
|||||||
} else if (mUpdaterController.isInstallingUpdate(downloadId)) {
|
} else if (mUpdaterController.isInstallingUpdate(downloadId)) {
|
||||||
setButtonAction(viewHolder.mAction, Action.INSTALL, downloadId, false);
|
setButtonAction(viewHolder.mAction, Action.INSTALL, downloadId, false);
|
||||||
viewHolder.mProgressText.setText(R.string.list_installing_update);
|
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)) {
|
} else if (mUpdaterController.isVerifyingUpdate(downloadId)) {
|
||||||
setButtonAction(viewHolder.mAction, Action.INSTALL, downloadId, false);
|
setButtonAction(viewHolder.mAction, Action.INSTALL, downloadId, false);
|
||||||
viewHolder.mProgressText.setText(R.string.list_verifying_update);
|
viewHolder.mProgressText.setText(R.string.list_verifying_update);
|
||||||
@@ -226,7 +229,7 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
|
|||||||
activeLayout = update.getStatus() == UpdateStatus.STARTING;
|
activeLayout = update.getStatus() == UpdateStatus.STARTING;
|
||||||
break;
|
break;
|
||||||
case UpdateStatus.Persistent.VERIFIED:
|
case UpdateStatus.Persistent.VERIFIED:
|
||||||
activeLayout = false;
|
activeLayout = update.getStatus() == UpdateStatus.INSTALLING;
|
||||||
break;
|
break;
|
||||||
case UpdateStatus.Persistent.INCOMPLETE:
|
case UpdateStatus.Persistent.INCOMPLETE:
|
||||||
activeLayout = true;
|
activeLayout = true;
|
||||||
|
@@ -332,7 +332,7 @@ public class UpdaterService extends Service {
|
|||||||
}
|
}
|
||||||
case INSTALLING: {
|
case INSTALLING: {
|
||||||
mNotificationBuilder.mActions.clear();
|
mNotificationBuilder.mActions.clear();
|
||||||
mNotificationBuilder.setProgress(0, 0, true);
|
mNotificationBuilder.setProgress(0, 0, false);
|
||||||
mNotificationStyle.setSummaryText(null);
|
mNotificationStyle.setSummaryText(null);
|
||||||
String text = getString(R.string.installing_update);
|
String text = getString(R.string.installing_update);
|
||||||
mNotificationStyle.bigText(text);
|
mNotificationStyle.bigText(text);
|
||||||
|
Reference in New Issue
Block a user