Changes to location settings for geotz
This change adds a new entry for geolocation-based time zone detection (shorthand: "geotz") to the location settings. The UI code uses information retrieved via the TimeManager API to keep the conditional logic in one place, i.e. to avoid the UI needing to know too much about the various conditions that affect the availability / applicability of the toggle. Screen variations / conditions / other info: Location settings screen: 1) The entry only shows up on a device at all if geotz detection is enabled for the device (currently a compile time setting, off by default). 2) The new entry is hidden on the screen when the user first opens it. To see it, the user has to expand "Advanced". The setting is in the shared (non-GMS) section of the screen. 3) When visible, the entry has a summary that shows the current status: either a reason why the setting is not applicable, or the user's current setting value. 4) Selecting the entry opens a sub-screen. The code included here distinguishes between different cases with the summary message (i.e. the text underneath the entry). See strings.xml for the placeholder text. Some strings will not show up currently, but are included in case the rules change as they are valid possibilities from the TimeManager API. The same changes have been made for the "personal" tab when a work profile is enabled. Location Time Zone Detection settings screen: 1) The toggle is always enabled and always shows the user's current configuration setting. All manual tests run with the geotz feature enabled with: adb shell setprop \ persist.sys.location_time_zone_detection_feature_enabled 1 Bug: 152746236 Test: Manual: build / boot / toggle switch in SettingsUI / inspect output of adb shell dumpsys time_zone_detector Test: Manual: build / boot / install TestDPC / toggle switch in work profile in SettingsUI / inspect output of adb shell dumpsys time_zone_detector Test: m -j30 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.location.TimeZoneDetectionPreferenceControllerTest" Test: m -j30 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.location.LocationTimeZoneDetectionPreferenceControllerTest" Test: m -j30 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.location.TimeZoneDetectionSettingsTest" Change-Id: Ia853d30bc54a113000b30f48776418f262d98358
Loading
Please register or sign in to comment