commit | bfbc440118caec0f94ac93c16baaf74cb401655d | [log] [tgz] |
---|---|---|
author | Tommaso Fonda <fondatommaso2@gmail.com> | Sat Apr 08 18:58:08 2023 +0200 |
committer | Tommaso Fonda <fondatommaso2@gmail.com> | Thu Apr 13 17:31:46 2023 +0200 |
tree | 4bcad5c763c410c9d4e7bd24716a306e181cf6ee | |
parent | e83f74ace7ec3a307cf407a63f56652b8f0ea1b2 [diff] |
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
diff --git a/src/org/lineageos/updater/UpdatesListAdapter.java b/src/org/lineageos/updater/UpdatesListAdapter.java index 7cf04a8..605862a 100644 --- a/src/org/lineageos/updater/UpdatesListAdapter.java +++ b/src/org/lineageos/updater/UpdatesListAdapter.java
@@ -185,6 +185,9 @@ 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)) {