Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d46dff8d authored by Sunny Shao's avatar Sunny Shao
Browse files

Fix UI flicker problem and update wordings

- "Set time zone automatically" changes to "Set automatically".
- "Use location to set time zone" changes to "Use location"
- Add a new summary text with "Location may be used to set time zone".

Fixes: 233968737
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.datetime
Change-Id: Ia16c428e906cda4ebe052bad83c3f574075a7a64
parent 50e45777
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -606,7 +606,7 @@
    <!-- Date & time setting screen setting switch title: whether the system clock (Unix epoch time) should be determined automatically [CHAR LIMIT=100] -->
    <string name="date_time_auto">Set time automatically</string>
    <!-- Date & time setting screen setting switch title: whether the time zone should be determined automatically [CHAR LIMIT=100]  -->
    <string name="zone_auto_title">Set time zone automatically</string>
    <string name="zone_auto_title">Set automatically</string>
    <!-- Date & time setting screen setting option summary text for the automatic 24 hour setting checkbox [CHAR LIMIT=100] -->
    <string name="date_time_24hour_auto">Use locale default</string>
    <!-- Date & time setting screen setting check box title [CHAR LIMIT=30] -->
@@ -4254,7 +4254,7 @@
    <string name="managed_profile_location_services">Location services for work</string>
    <!-- [CHAR LIMIT=60] Date&Time settings screen, toggle button title -->
    <string name="location_time_zone_detection_toggle_title">Use location to set time zone</string>
    <string name="location_time_zone_detection_toggle_title">Use location</string>
    <!-- [CHAR LIMIT=60] Date&Time settings screen, title of the dialog shown when user tries to
         enable GeoTZ when Location toggle is off. -->
    <string name="location_time_zone_detection_location_is_off_dialog_title">Device location needed</string>
@@ -4280,6 +4280,8 @@
    <!-- [CHAR LIMIT=NONE] Location settings screen, summary when location time zone detection is not
         allowed for the user, e.g. because of device policy -->
    <string name="location_time_zone_detection_not_allowed">Location time zone detection changes are not allowed</string>
    <!-- [CHAR LIMIT=NONE] Location settings screen, summary when location time zone detection is enabled. -->
    <string name="location_time_zone_detection_auto_is_on">Location may be used to set time zone</string>
    <!-- [CHAR LIMIT=30] Security & location settings screen, setting check box label for Google location service (cell ID, wifi, etc.) -->
    <string name="location_network_based">Wi\u2011Fi &amp; mobile network location</string>
+0 −1
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@
        <com.android.settingslib.RestrictedSwitchPreference
            android:key="auto_zone"
            android:title="@string/zone_auto_title"
            settings:allowDividerAbove="true"
            settings:userRestriction="no_config_date_time"/>

        <!-- This preference gets removed if location-based time zone detection is not supported -->
+1 −1
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ public class LocationTimeZoneDetectionPreferenceController
            // If capability is possessed, toggle status already tells all the information needed.
            // Returning null will make previous text stick on toggling.
            // See AbstractPreferenceController#refreshSummary.
            return "";
            summaryResId = R.string.location_time_zone_detection_auto_is_on;
        } else {
            // This is unexpected: getAvailabilityStatus() should ensure that the UI element isn't
            // even shown for known cases, or the capability is unknown.
+2 −1
Original line number Diff line number Diff line
@@ -150,7 +150,8 @@ public class LocationTimeZoneDetectionPreferenceControllerTest {
                new TimeZoneCapabilitiesAndConfig(capabilities, configuration);

        when(mTimeManager.getTimeZoneCapabilitiesAndConfig()).thenReturn(capabilitiesAndConfig);
        assertThat(mController.getSummary().toString()).isEmpty();
        assertThat(mController.getSummary()).isEqualTo(
                mContext.getString(R.string.location_time_zone_detection_auto_is_on));
    }

    @Test