From 304c406fbe39dfbabb704545c99706abe4affc79 Mon Sep 17 00:00:00 2001 From: Mohit Mali Date: Thu, 24 Sep 2020 11:13:20 +0000 Subject: [PATCH 1/2] Rename the updater settings entry to "System Updater" --- res/xml/system_dashboard_fragment.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/res/xml/system_dashboard_fragment.xml b/res/xml/system_dashboard_fragment.xml index e4b74e06aaf..60c2eaa5443 100644 --- a/res/xml/system_dashboard_fragment.xml +++ b/res/xml/system_dashboard_fragment.xml @@ -57,8 +57,7 @@ android:summary="@string/summary_placeholder" android:icon="@drawable/ic_system_update" android:order="-30" - settings:keywords="@string/keywords_system_update_settings" - settings:controller="com.android.settings.system.SystemUpdatePreferenceController"> + settings:keywords="@string/keywords_system_update_settings"> -- GitLab From 943e7acf43c6823381c0645c0be328f44699c72d Mon Sep 17 00:00:00 2001 From: Mohit Mali Date: Mon, 28 Sep 2020 13:32:31 +0530 Subject: [PATCH 2/2] Remove the updater subtitle --- res/xml/system_dashboard_fragment.xml | 3 ++- src/com/android/settings/Utils.java | 1 + .../system/SystemUpdatePreferenceController.java | 10 ++-------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/res/xml/system_dashboard_fragment.xml b/res/xml/system_dashboard_fragment.xml index 60c2eaa5443..e4b74e06aaf 100644 --- a/res/xml/system_dashboard_fragment.xml +++ b/res/xml/system_dashboard_fragment.xml @@ -57,7 +57,8 @@ android:summary="@string/summary_placeholder" android:icon="@drawable/ic_system_update" android:order="-30" - settings:keywords="@string/keywords_system_update_settings"> + settings:keywords="@string/keywords_system_update_settings" + settings:controller="com.android.settings.system.SystemUpdatePreferenceController"> diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java index b1ed38f6c49..37b7ffd5856 100644 --- a/src/com/android/settings/Utils.java +++ b/src/com/android/settings/Utils.java @@ -108,6 +108,7 @@ public final class Utils extends com.android.settingslib.Utils { * Set the preference's title to the matching activity's label. */ public static final int UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY = 1; + public static final int UPDATE_PREFERENCE_FLAG_DONT_SET_TITLE_TO_MATCHING_ACTIVITY = 0; /** * Color spectrum to use to indicate badness. 0 is completely transparent (no data), diff --git a/src/com/android/settings/system/SystemUpdatePreferenceController.java b/src/com/android/settings/system/SystemUpdatePreferenceController.java index 88715bf4d6f..caafd8832f7 100644 --- a/src/com/android/settings/system/SystemUpdatePreferenceController.java +++ b/src/com/android/settings/system/SystemUpdatePreferenceController.java @@ -67,7 +67,7 @@ public class SystemUpdatePreferenceController extends BasePreferenceController { if (isAvailable()) { Utils.updatePreferenceToSpecificActivityOrRemove(mContext, screen, getPreferenceKey(), - Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY); + Utils.UPDATE_PREFERENCE_FLAG_DONT_SET_TITLE_TO_MATCHING_ACTIVITY); } } @@ -87,8 +87,7 @@ public class SystemUpdatePreferenceController extends BasePreferenceController { @Override public CharSequence getSummary() { - CharSequence summary = mContext.getString(R.string.android_version_summary, - Build.VERSION.RELEASE); + CharSequence summary = ""; final FutureTask bundleFutureTask = new FutureTask<>( // Put the API call in a future to avoid StrictMode violation. () -> mUpdateManager.retrieveSystemUpdateInfo()); @@ -111,11 +110,6 @@ public class SystemUpdatePreferenceController extends BasePreferenceController { Log.d(TAG, "Update statue unknown"); // fall through to next branch case SystemUpdateManager.STATUS_IDLE: - final String version = updateInfo.getString(SystemUpdateManager.KEY_TITLE); - if (!TextUtils.isEmpty(version)) { - summary = mContext.getString(R.string.android_version_summary, version); - } - break; } return summary; } -- GitLab