From 811d0502725440838dbd77a478ea9a1b0b6c5e3e Mon Sep 17 00:00:00 2001 From: Michael W Date: Sat, 5 Feb 2022 15:22:41 +0100 Subject: [PATCH] Updater: No need to install every update * Apparently users are not aware that they don't have to install every update we ever released (weeklies) after they have skipped some due to various reasons * Since we are providing full installation packages, remind the user that it's ok to only ever choose the newest one Change-Id: I70f9acd70344f36aaae7e45b848f6bcb7a8b3c0f --- res/values/strings.xml | 4 ++++ .../lineageos/updater/UpdatesListAdapter.java | 20 ++++++++++++++++++- src/org/lineageos/updater/misc/Constants.java | 2 ++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 485bf068..d1fb3174 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -152,4 +152,8 @@ New updates Ongoing downloads Update failed + + Did you know? + LineageOS updates are full installation packages. That means you can always install only the latest update, even if you skipped some in between! + Thanks for the info! diff --git a/src/org/lineageos/updater/UpdatesListAdapter.java b/src/org/lineageos/updater/UpdatesListAdapter.java index 53bd29e9..27cdce3d 100644 --- a/src/org/lineageos/updater/UpdatesListAdapter.java +++ b/src/org/lineageos/updater/UpdatesListAdapter.java @@ -477,7 +477,10 @@ public class UpdatesListAdapter extends RecyclerView.Adapter Utils.triggerUpdate(mActivity, downloadId)) + (dialog, which) -> { + Utils.triggerUpdate(mActivity, downloadId); + maybeShowInfoDialog(); + }) .setNegativeButton(android.R.string.cancel, null); } @@ -493,6 +496,21 @@ public class UpdatesListAdapter extends RecyclerView.Adapter preferences.edit() + .putBoolean(Constants.HAS_SEEN_INFO_DIALOG, true) + .apply()) + .show(); + } + private void startActionMode(final UpdateInfo update, final boolean canDelete, View anchor) { mSelectedDownload = update.getDownloadId(); notifyItemChanged(update.getDownloadId()); diff --git a/src/org/lineageos/updater/misc/Constants.java b/src/org/lineageos/updater/misc/Constants.java index 0597eab6..6144ed74 100644 --- a/src/org/lineageos/updater/misc/Constants.java +++ b/src/org/lineageos/updater/misc/Constants.java @@ -55,4 +55,6 @@ public final class Constants { public static final String UPDATE_RECOVERY_EXEC = "/vendor/bin/install-recovery.sh"; public static final String UPDATE_RECOVERY_PROPERTY = "persist.vendor.recovery_update"; + + public static final String HAS_SEEN_INFO_DIALOG = "has_seen_info_dialog"; }