From 970d364d072e1b433436de8fba7b0cdac449e03e Mon Sep 17 00:00:00 2001 From: Geoffrey Boullanger Date: Fri, 30 Aug 2024 14:46:53 +0000 Subject: [PATCH] Add updateState to AutoTimeZonePreferenceController The summary (i.e. description under the toggle title in Android settings) from AutoTimeZonePreferenceController is only used in wifi-only devices, like Tangor. We have found that since V, the summary was no longer displayed in the Date and time settings page. This fix brings the summary back. Bug: b/363176828 Test: tested on a Tangor tablet Flag: EXEMPT bugfix Change-Id: I1f118b8e1d5e0d8d1b0f5b515d79522b72fb4fa4 --- .../datetime/AutoTimeZonePreferenceController.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/com/android/settings/datetime/AutoTimeZonePreferenceController.java b/src/com/android/settings/datetime/AutoTimeZonePreferenceController.java index 3a1f995aaf2..8eccf319784 100644 --- a/src/com/android/settings/datetime/AutoTimeZonePreferenceController.java +++ b/src/com/android/settings/datetime/AutoTimeZonePreferenceController.java @@ -27,6 +27,8 @@ import android.app.time.TimeZoneCapabilitiesAndConfig; import android.app.time.TimeZoneConfiguration; import android.content.Context; +import androidx.preference.Preference; + import com.android.internal.annotations.VisibleForTesting; import com.android.settings.R; import com.android.settings.core.TogglePreferenceController; @@ -115,6 +117,12 @@ public class AutoTimeZonePreferenceController extends TogglePreferenceController return R.string.menu_key_system; } + @Override + public void updateState(Preference preference) { + super.updateState(preference); + refreshSummary(preference); + } + @Override public CharSequence getSummary() { // If auto time zone cannot enable telephony fallback and is capable of location, then auto