Move the Location time zone detection setting

Move the Location time zone detection setting to Date & Time as per
UI review / product request.

This initial commit just moves the existing MVP setting behavior to a
different screen. Still invisible by default.

Enable with:
$ adb shell setprop persist.sys.location_time_zone_detection_feature_enabled 1
.. plus a reboot.

Bug: 152746236
Test: Manual: build / boot / toggle switch in SettingsUI / inspect output of adb shell dumpsys time_zone_detector
Test: m -j30 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.datetime.LocationTimeZoneDetectionPreferenceControllerTest"
Test: m -j30 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.datetime.locationtimezone.TimeZoneDetectionTogglePreferenceControllerTest"
Test: m -j30 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.datetime.locationtimezone.TimeZoneDetectionSettingsTest"
Change-Id: I9ecfa853014a9f92086a9cb2d34e1517474ceb93
This commit is contained in:
Neil Fuller
2020-11-09 20:44:27 +00:00
parent 76eb401911
commit 218404394f
10 changed files with 15 additions and 21 deletions

View File

@@ -52,6 +52,14 @@
settings:userRestriction="no_config_date_time"
settings:keywords="@string/keywords_time_zone"/>
<!-- This preference gets removed if location-based time zone detection is not supported -->
<com.android.settingslib.RestrictedPreference
android:key="location_time_zone_detection"
android:title="@string/location_time_zone_detection_screen_title"
settings:controller="com.android.settings.datetime.LocationTimeZoneDetectionPreferenceController"
android:fragment="com.android.settings.datetime.locationtimezone.TimeZoneDetectionSettings"
settings:userRestriction="no_config_date_time"/>
<PreferenceCategory
android:key="time_format_preference_category"
android:title="@string/time_format_category_title"

View File

@@ -65,13 +65,6 @@
settings:forWork="true"
settings:useAdminDisabledSummary="true"/>
<!-- This preference gets removed if location-based time zone detection is not supported -->
<Preference
android:key="location_time_zone_detection"
android:title="@string/location_time_zone_detection_screen_title"
settings:controller="com.android.settings.location.LocationTimeZoneDetectionPreferenceController"
android:fragment="com.android.settings.location.TimeZoneDetectionSettings" />
<PreferenceCategory
android:key="location_services"
android:layout="@layout/preference_category_no_label"

View File

@@ -51,13 +51,6 @@
android:fragment="com.android.settings.location.ScanningSettings"
settings:controller="com.android.settings.location.LocationScanningPreferenceController"/>
<!-- This preference gets removed if location-based time zone detection is not supported -->
<Preference
android:key="location_time_zone_detection"
android:title="@string/location_time_zone_detection_screen_title"
settings:controller="com.android.settings.location.LocationTimeZoneDetectionPreferenceController"
android:fragment="com.android.settings.location.TimeZoneDetectionSettings" />
<PreferenceCategory
android:key="location_services"
android:layout="@layout/preference_category_no_label"

View File

@@ -22,7 +22,7 @@
<SwitchPreference
android:title="@string/location_time_zone_detection_enabled_title"
android:summary="@string/location_time_zone_detection_enabled_description"
settings:controller="com.android.settings.location.TimeZoneDetectionTogglePreferenceController"
settings:controller="com.android.settings.datetime.locationtimezone.TimeZoneDetectionTogglePreferenceController"
android:key="location_time_zone_detection_enabled" />
</PreferenceScreen>

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.settings.location;
package com.android.settings.datetime;
import static android.app.time.TimeZoneCapabilities.CAPABILITY_NOT_ALLOWED;
import static android.app.time.TimeZoneCapabilities.CAPABILITY_NOT_APPLICABLE;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.settings.location;
package com.android.settings.datetime.locationtimezone;
import android.app.settings.SettingsEnums;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.android.settings.location;
package com.android.settings.datetime.locationtimezone;
import android.app.time.TimeManager;
import android.app.time.TimeZoneCapabilitiesAndConfig;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.android.settings.location;
package com.android.settings.datetime;
import static android.app.time.TimeZoneCapabilities.CAPABILITY_NOT_APPLICABLE;
import static android.app.time.TimeZoneCapabilities.CAPABILITY_NOT_SUPPORTED;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.android.settings.location;
package com.android.settings.datetime.locationtimezone;
import static com.google.common.truth.Truth.assertThat;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.settings.location;
package com.android.settings.datetime.locationtimezone;
import static android.app.time.TimeZoneCapabilities.CAPABILITY_NOT_APPLICABLE;
import static android.app.time.TimeZoneCapabilities.CAPABILITY_POSSESSED;