Remove location_modes_previous references
1. Remove reference to LOCATION_MODE_PREVIOUS. 2. Add setLocationEnabled method in LocationEnabler. When turning location ON/OFF from Settings app or Quick Settings, use LocationEnabler.setLocationEnabled() instead of setLocationMode(). 3. Change unit tests accordingly. Bug: 70990911 Test: Robolectric Test: Manual Change-Id: Ic02ef3cd02f9aa7d2ef18697b19b507575aaf5c2
This commit is contained in:
@@ -88,18 +88,17 @@ public class LocationSwitchBarControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onSwitchChanged_switchChecked_shouldSetPreviousLocationMode() {
|
||||
public void onSwitchChanged_switchChecked_shouldSetLocationEnabled() {
|
||||
mController.onSwitchChanged(mSwitch, true);
|
||||
|
||||
verify(mEnabler).setLocationMode(
|
||||
android.provider.Settings.Secure.LOCATION_MODE_PREVIOUS);
|
||||
verify(mEnabler).setLocationEnabled(true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void onSwitchChanged_switchUnchecked_shouldSetLocationModeOff() {
|
||||
public void onSwitchChanged_switchUnchecked_shouldSetLocationDisabled() {
|
||||
mController.onSwitchChanged(mSwitch, false);
|
||||
|
||||
verify(mEnabler).setLocationMode(android.provider.Settings.Secure.LOCATION_MODE_OFF);
|
||||
verify(mEnabler).setLocationEnabled(false);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user