Do not show toggle for location tz detection in search.
It also makes setting in line with "Set time zone automatically", which is rendered w/o toggle on search page. Bug: 185906072 Test: manually verified that toggle is not shown Test: m -j30 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.datetime.LocationTimeZoneDetectionPreferenceControllerTest" Change-Id: Ie71572c4a9b9bd6adf3660556363331e2943fd5b
This commit is contained in:
@@ -109,6 +109,14 @@ public class LocationTimeZoneDetectionPreferenceController
|
|||||||
mTimeManager.removeTimeZoneDetectorListener(this);
|
mTimeManager.removeTimeZoneDetectorListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSliceable() {
|
||||||
|
// Prevent use in a slice, which would enable search to display a toggle in the search
|
||||||
|
// results: LocationToggleDisabledDialogFragment has to be shown under some circumstances
|
||||||
|
// which doesn't work when embedded in search. b/185906072
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAvailabilityStatus() {
|
public int getAvailabilityStatus() {
|
||||||
TimeZoneCapabilities timeZoneCapabilities =
|
TimeZoneCapabilities timeZoneCapabilities =
|
||||||
|
@@ -86,6 +86,11 @@ public class LocationTimeZoneDetectionPreferenceControllerTest {
|
|||||||
verify(mTimeManager).updateTimeZoneConfiguration(expectedConfiguration);
|
verify(mTimeManager).updateTimeZoneConfiguration(expectedConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void isNotSliceable() {
|
||||||
|
assertThat(mController.isSliceable()).isFalse();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void setChecked_withTrue_shouldDoNothing_whenLocationIsDisabled() {
|
public void setChecked_withTrue_shouldDoNothing_whenLocationIsDisabled() {
|
||||||
when(mLocationManager.isLocationEnabled()).thenReturn(false);
|
when(mLocationManager.isLocationEnabled()).thenReturn(false);
|
||||||
|
Reference in New Issue
Block a user