Updater: Show the correct percentage during package installation
Fixes the mismatch between the progress bar's status and the percentage displayed next to it. Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/4830 Change-Id: I5c243acda4f06561cbd5b3a73060205b32d8d41d
This commit is contained in:
@@ -187,6 +187,9 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
|
|||||||
update.getFinalizing() ?
|
update.getFinalizing() ?
|
||||||
R.string.finalizing_package :
|
R.string.finalizing_package :
|
||||||
R.string.preparing_ota_first_boot);
|
R.string.preparing_ota_first_boot);
|
||||||
|
String percentage = NumberFormat.getPercentInstance().format(
|
||||||
|
update.getInstallProgress() / 100.f);
|
||||||
|
viewHolder.mPercentage.setText(percentage);
|
||||||
viewHolder.mProgressBar.setIndeterminate(false);
|
viewHolder.mProgressBar.setIndeterminate(false);
|
||||||
viewHolder.mProgressBar.setProgress(update.getInstallProgress());
|
viewHolder.mProgressBar.setProgress(update.getInstallProgress());
|
||||||
} else if (mUpdaterController.isVerifyingUpdate(downloadId)) {
|
} else if (mUpdaterController.isVerifyingUpdate(downloadId)) {
|
||||||
|
Reference in New Issue
Block a user