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
@@ -34,6 +34,8 @@ import android.os.UserHandle;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import com.android.settings.R;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -153,6 +155,12 @@ public class AutoTimePreferenceControllerTest {
|
||||
assertThat(mController.isEnabled()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getSummary() {
|
||||
assertThat(mController.getSummary().toString()).isEqualTo(
|
||||
mContext.getString(R.string.date_time_auto_summary));
|
||||
}
|
||||
|
||||
private static TimeCapabilitiesAndConfig createCapabilitiesAndConfig(boolean autoSupported,
|
||||
boolean autoEnabled) {
|
||||
int configureAutoDetectionEnabledCapability =
|
||||
|
@@ -225,7 +225,8 @@ public class AutoTimeZonePreferenceControllerTest {
|
||||
when(mTimeManager.getTimeZoneCapabilitiesAndConfig()).thenReturn(capabilitiesAndConfig);
|
||||
when(mTimeManager.updateTimeZoneConfiguration(Mockito.any())).thenReturn(true);
|
||||
|
||||
assertThat(mController.getSummary()).isEqualTo("");
|
||||
assertThat(mController.getSummary().toString()).isEqualTo(
|
||||
mContext.getString(R.string.zone_auto_title_summary));
|
||||
|
||||
capabilitiesAndConfig = createCapabilitiesAndConfig(
|
||||
/* autoSupported= */true, /* autoEnabled= */true, /* telephonySupported= */
|
||||
@@ -233,7 +234,7 @@ public class AutoTimeZonePreferenceControllerTest {
|
||||
when(mTimeManager.getTimeZoneCapabilitiesAndConfig()).thenReturn(capabilitiesAndConfig);
|
||||
when(mTimeManager.updateTimeZoneConfiguration(Mockito.any())).thenReturn(true);
|
||||
|
||||
assertThat(mController.getSummary()).isEqualTo(
|
||||
assertThat(mController.getSummary().toString()).isEqualTo(
|
||||
mContext.getString(R.string.auto_zone_requires_location_summary));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user