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
This commit is contained in:
Geoffrey Boullanger
2024-08-30 14:46:53 +00:00
parent 2d07418b8b
commit 970d364d07

View File

@@ -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