Merge "AOD setting availability depends on other user settings" into oc-dr1-dev
am: 6d62355313
Change-Id: If6f49df149ebaf960f40336556e5e9c199c23ef2
This commit is contained in:
@@ -77,7 +77,7 @@ public class AmbientDisplayAlwaysOnPreferenceController extends
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAvailable() {
|
public boolean isAvailable() {
|
||||||
return mConfig.alwaysOnAvailable();
|
return mConfig.alwaysOnAvailableForUser(MY_USER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -62,6 +62,10 @@ public class AmbientDisplayConfiguration {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean alwaysOnAvailableForUser(int user) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean available() {
|
public boolean available() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -105,7 +105,7 @@ public class AmbientDisplayAlwaysOnPreferenceControllerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void isAvailable_available() throws Exception {
|
public void isAvailable_available() throws Exception {
|
||||||
when(mConfig.alwaysOnAvailable())
|
when(mConfig.alwaysOnAvailableForUser(anyInt()))
|
||||||
.thenReturn(true);
|
.thenReturn(true);
|
||||||
|
|
||||||
assertThat(mController.isAvailable()).isTrue();
|
assertThat(mController.isAvailable()).isTrue();
|
||||||
@@ -113,7 +113,7 @@ public class AmbientDisplayAlwaysOnPreferenceControllerTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void isAvailable_unavailable() throws Exception {
|
public void isAvailable_unavailable() throws Exception {
|
||||||
when(mConfig.alwaysOnAvailable())
|
when(mConfig.alwaysOnAvailableForUser(anyInt()))
|
||||||
.thenReturn(false);
|
.thenReturn(false);
|
||||||
|
|
||||||
assertThat(mController.isAvailable()).isFalse();
|
assertThat(mController.isAvailable()).isFalse();
|
||||||
|
Reference in New Issue
Block a user