Merge "AOD setting availability depends on other user settings" into oc-dr1-dev

This commit is contained in:
Geoffrey Pitsch
2017-08-01 14:00:18 +00:00
committed by Android (Google) Code Review
3 changed files with 7 additions and 3 deletions

View File

@@ -75,7 +75,7 @@ public class AmbientDisplayAlwaysOnPreferenceController extends PreferenceContro
@Override
public boolean isAvailable() {
return mConfig.alwaysOnAvailable();
return mConfig.alwaysOnAvailableForUser(MY_USER);
}
@Override

View File

@@ -62,6 +62,10 @@ public class AmbientDisplayConfiguration {
return true;
}
public boolean alwaysOnAvailableForUser(int user) {
return true;
}
public boolean available() {
return true;
}

View File

@@ -105,7 +105,7 @@ public class AmbientDisplayAlwaysOnPreferenceControllerTest {
@Test
public void isAvailable_available() throws Exception {
when(mConfig.alwaysOnAvailable())
when(mConfig.alwaysOnAvailableForUser(anyInt()))
.thenReturn(true);
assertThat(mController.isAvailable()).isTrue();
@@ -113,7 +113,7 @@ public class AmbientDisplayAlwaysOnPreferenceControllerTest {
@Test
public void isAvailable_unavailable() throws Exception {
when(mConfig.alwaysOnAvailable())
when(mConfig.alwaysOnAvailableForUser(anyInt()))
.thenReturn(false);
assertThat(mController.isAvailable()).isFalse();