Merge "Implement work-profile infra in BasePreferenceController"

This commit is contained in:
Raff Tsai
2019-12-10 03:02:17 +00:00
committed by Android (Google) Code Review
13 changed files with 132 additions and 149 deletions

View File

@@ -15,8 +15,6 @@
*/
package com.android.settings.location;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.doReturn;
@@ -114,17 +112,6 @@ public class LocationForWorkPreferenceControllerTest {
verify(mPreference).setSummary(R.string.switch_off_text);
}
@Test
public void isAvailable_noManagedProfile_shouldReturnFalse() {
when(mUserManager.getUserProfiles()).thenReturn(new ArrayList<>());
assertThat(mController.isAvailable()).isFalse();
}
@Test
public void isAvailable_hasManagedProfile_shouldReturnTrue() {
assertThat(mController.isAvailable()).isTrue();
}
@Test
public void onLocationModeChanged_disabledByAdmin_shouldDisablePreference() {
mController.displayPreference(mScreen);