commit | cf83f9dd125125e199a3aee8110c718e46ff8854 | [log] [tgz] |
---|---|---|
author | Geoffrey Pitsch <gpitsch@google.com> | Tue Aug 01 14:08:10 2017 +0000 |
committer | android-build-merger <android-build-merger@google.com> | Tue Aug 01 14:08:10 2017 +0000 |
tree | b47eaa77dfb27e5840e9c537dfe5ddb0564bef35 | |
parent | 72054d6db3296eb974538d5fa46d331fa0f5b10c [diff] | |
parent | 6d62355313d7ce92f1ee79b91c6c6643e466e14b [diff] |
Merge "AOD setting availability depends on other user settings" into oc-dr1-dev am: 6d62355313 Change-Id: If6f49df149ebaf960f40336556e5e9c199c23ef2
diff --git a/src/com/android/settings/display/AmbientDisplayAlwaysOnPreferenceController.java b/src/com/android/settings/display/AmbientDisplayAlwaysOnPreferenceController.java index 53898e8..fffa243 100644 --- a/src/com/android/settings/display/AmbientDisplayAlwaysOnPreferenceController.java +++ b/src/com/android/settings/display/AmbientDisplayAlwaysOnPreferenceController.java
@@ -77,7 +77,7 @@ @Override public boolean isAvailable() { - return mConfig.alwaysOnAvailable(); + return mConfig.alwaysOnAvailableForUser(MY_USER); } @Override
diff --git a/tests/robotests/src/com/android/internal/hardware/AmbientDisplayConfiguration.java b/tests/robotests/src/com/android/internal/hardware/AmbientDisplayConfiguration.java index 59ca483..3dcf6ab 100644 --- a/tests/robotests/src/com/android/internal/hardware/AmbientDisplayConfiguration.java +++ b/tests/robotests/src/com/android/internal/hardware/AmbientDisplayConfiguration.java
@@ -62,6 +62,10 @@ return true; } + public boolean alwaysOnAvailableForUser(int user) { + return true; + } + public boolean available() { return true; }
diff --git a/tests/robotests/src/com/android/settings/display/AmbientDisplayAlwaysOnPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/display/AmbientDisplayAlwaysOnPreferenceControllerTest.java index 3f3f4b5..3869807 100644 --- a/tests/robotests/src/com/android/settings/display/AmbientDisplayAlwaysOnPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/display/AmbientDisplayAlwaysOnPreferenceControllerTest.java
@@ -105,7 +105,7 @@ @Test public void isAvailable_available() throws Exception { - when(mConfig.alwaysOnAvailable()) + when(mConfig.alwaysOnAvailableForUser(anyInt())) .thenReturn(true); assertThat(mController.isAvailable()).isTrue(); @@ -113,7 +113,7 @@ @Test public void isAvailable_unavailable() throws Exception { - when(mConfig.alwaysOnAvailable()) + when(mConfig.alwaysOnAvailableForUser(anyInt())) .thenReturn(false); assertThat(mController.isAvailable()).isFalse();