aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuK1337 <priv.luk@gmail.com>2018-07-24 11:22:14 +0200
committerLuK1337 <priv.luk@gmail.com>2018-07-24 11:45:52 +0200
commite46f532c8ccef58aae60f901588cf1e9b13ffb66 (patch)
tree4cd7587c26e3c3e352a61d1feceb5fcb35a51983
parent412810e0b7581604e79c5a5bdec2e4f93391bd3b (diff)
downloadandroid_packages_apps_Updater-e46f532c8ccef58aae60f901588cf1e9b13ffb66.tar.gz
android_packages_apps_Updater-e46f532c8ccef58aae60f901588cf1e9b13ffb66.tar.bz2
android_packages_apps_Updater-e46f532c8ccef58aae60f901588cf1e9b13ffb66.zip
Updater: Fix 'REBOOT' button not showing up after A/B update
* After update is complete button is being handled in handleNotActiveStatus instead of handleActiveStatus. Change-Id: I6a4df580f93b71fd12e902801125acae668ec991
-rw-r--r--src/org/lineageos/updater/UpdatesListAdapter.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/org/lineageos/updater/UpdatesListAdapter.java b/src/org/lineageos/updater/UpdatesListAdapter.java
index 7b317d3..4fb483f 100644
--- a/src/org/lineageos/updater/UpdatesListAdapter.java
+++ b/src/org/lineageos/updater/UpdatesListAdapter.java
@@ -161,11 +161,6 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
setButtonAction(viewHolder.mAction, Action.INSTALL, downloadId, false);
viewHolder.mProgressText.setText(R.string.list_verifying_update);
viewHolder.mProgressBar.setIndeterminate(true);
- } else if (mUpdaterController.isWaitingForReboot(downloadId)) {
- setButtonAction(viewHolder.mAction, Action.REBOOT, downloadId, false);
- viewHolder.mProgressText.setText(R.string.installing_update_finished);
- viewHolder.mProgressBar.setIndeterminate(false);
- viewHolder.mProgressBar.setProgress(100);
} else {
canDelete = true;
setButtonAction(viewHolder.mAction, Action.RESUME, downloadId, !isBusy());
@@ -188,20 +183,25 @@ public class UpdatesListAdapter extends RecyclerView.Adapter<UpdatesListAdapter.
}
private void handleNotActiveStatus(ViewHolder viewHolder, UpdateInfo update) {
- if (update.getPersistentStatus() == UpdateStatus.Persistent.VERIFIED) {
+ final String downloadId = update.getDownloadId();
+ if (mUpdaterController.isWaitingForReboot(downloadId)) {
+ viewHolder.itemView.setOnLongClickListener(
+ getLongClickListener(update, false, viewHolder.mBuildDate));
+ setButtonAction(viewHolder.mAction, Action.REBOOT, downloadId, true);
+ } else if (update.getPersistentStatus() == UpdateStatus.Persistent.VERIFIED) {
viewHolder.itemView.setOnLongClickListener(
getLongClickListener(update, true, viewHolder.mBuildDate));
setButtonAction(viewHolder.mAction,
Utils.canInstall(update) ? Action.INSTALL : Action.DELETE,
- update.getDownloadId(), !isBusy());
+ downloadId, !isBusy());
} else if (!Utils.canInstall(update)) {
viewHolder.itemView.setOnLongClickListener(
getLongClickListener(update, false, viewHolder.mBuildDate));
- setButtonAction(viewHolder.mAction, Action.INFO, update.getDownloadId(), !isBusy());
+ setButtonAction(viewHolder.mAction, Action.INFO, downloadId, !isBusy());
} else {
viewHolder.itemView.setOnLongClickListener(
getLongClickListener(update, false, viewHolder.mBuildDate));
- setButtonAction(viewHolder.mAction, Action.DOWNLOAD, update.getDownloadId(), !isBusy());
+ setButtonAction(viewHolder.mAction, Action.DOWNLOAD, downloadId, !isBusy());
}
String fileSize = Formatter.formatShortFileSize(mActivity, update.getFileSize());
viewHolder.mBuildSize.setText(fileSize);