From 17f35382d72ec1dc5753bd97ee635ff32171912e Mon Sep 17 00:00:00 2001 From: Gabriele M Date: Fri, 25 Aug 2017 20:05:57 +0200 Subject: [PATCH] Show alert dialog for major upgrades Major upgrades are not possible with Updater and they are already blocked. This commit adds a dialog with a link to a webpage that explains how to upgrade manually. Based on: https://github.com/LineageOS/android_packages_apps_CMUpdater/commit/d5d343d6275c0c896e2f50daa1ef5aec973ef891 Change-Id: Ifb23e0a4db1060fc696d13e6694f3e849af70e2d --- res/drawable/ic_info.xml | 9 +++++ res/values/strings.xml | 5 +++ .../lineageos/updater/UpdatesListAdapter.java | 36 ++++++++++++++++++- 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 res/drawable/ic_info.xml diff --git a/res/drawable/ic_info.xml b/res/drawable/ic_info.xml new file mode 100644 index 0000000..cf53e14 --- /dev/null +++ b/res/drawable/ic_info.xml @@ -0,0 +1,9 @@ + + + diff --git a/res/values/strings.xml b/res/values/strings.xml index 7522a24..16cbc5a 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -87,6 +87,7 @@ Pause download Resume download Install update + Show information Delete file Delete the selected update file? @@ -121,4 +122,8 @@ You\'re about to download an update package using mobile data which is likely going to cause high data usage. Would you like to proceed? Do not show again Mobile data warning + + Update blocked + This update cannot be installed using the updater app. Please read %1$s for more information. + http://wiki.lineageos.org/upgrading.html diff --git a/src/org/lineageos/updater/UpdatesListAdapter.java b/src/org/lineageos/updater/UpdatesListAdapter.java index ca12244..5cb70df 100644 --- a/src/org/lineageos/updater/UpdatesListAdapter.java +++ b/src/org/lineageos/updater/UpdatesListAdapter.java @@ -22,7 +22,10 @@ import android.support.design.widget.Snackbar; import android.support.v7.app.AlertDialog; import android.support.v7.view.ActionMode; import android.support.v7.widget.RecyclerView; +import android.text.SpannableString; import android.text.format.Formatter; +import android.text.method.LinkMovementMethod; +import android.text.util.Linkify; import android.util.Log; import android.util.TypedValue; import android.view.LayoutInflater; @@ -68,7 +71,8 @@ public class UpdatesListAdapter extends RecyclerView.Adapter