Merge "Update titles and summaries of the Date and time settings page" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
d6f73f35b6
@@ -27,6 +27,8 @@ import android.app.time.TimeConfiguration;
|
||||
import android.app.time.TimeManager;
|
||||
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;
|
||||
@@ -76,6 +78,17 @@ public class AutoTimePreferenceController extends TogglePreferenceController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
super.updateState(preference);
|
||||
refreshSummary(preference);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getSummary() {
|
||||
return mContext.getString(R.string.date_time_auto_summary);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChecked() {
|
||||
return isEnabled();
|
||||
|
||||
@@ -129,11 +129,11 @@ public class AutoTimeZonePreferenceController extends TogglePreferenceController
|
||||
// time zone must use location.
|
||||
if (LocationProviderStatusPreferenceController.hasLocationTimeZoneNoTelephonyFallback(
|
||||
mTimeManager.getTimeZoneCapabilitiesAndConfig().getDetectorStatus())) {
|
||||
return mContext.getResources().getString(R.string.auto_zone_requires_location_summary);
|
||||
return mContext.getString(R.string.auto_zone_requires_location_summary);
|
||||
}
|
||||
// If the user has a dedicated toggle to control location use, the summary can
|
||||
// be empty because the use of location is explicit.
|
||||
return "";
|
||||
|
||||
// If the user has a dedicated toggle to control location use, explain what it does.
|
||||
return mContext.getString(R.string.zone_auto_title_summary);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
|
||||
Reference in New Issue
Block a user