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:
Tommaso Fonda
2023-04-08 18:58:08 +02:00
parent e83f74ace7
commit bfbc440118

View File

@@ -185,6 +185,9 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
update.getFinalizing() ?
R.string.finalizing_package :
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.setProgress(update.getInstallProgress());
} else if (mUpdaterController.isVerifyingUpdate(downloadId)) {