Loading src/com/android/settings/display/AmbientDisplaySettings.java +1 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ public class AmbientDisplaySettings extends DashboardFragment { protected List<AbstractPreferenceController> getPreferenceControllers(Context context) { return buildPreferenceControllers(context, getLifecycle(), new AmbientDisplayConfiguration(context), mMetricsFeatureProvider, () -> { updatePreferenceStates(); }); this::updatePreferenceStates); } @Override Loading src/com/android/settings/gestures/DoubleTapScreenPreferenceController.java +5 −0 Original line number Diff line number Diff line Loading @@ -102,4 +102,9 @@ public class DoubleTapScreenPreferenceController extends GesturePreferenceContro return new InlineSwitchPayload(SECURE_KEY, ResultPayload.SettingsSource.SECURE, ON /* onValue */, intent, isAvailable(), ON /* defaultValue */); } @Override protected boolean canHandleClicks() { return !mAmbientConfig.alwaysOnEnabled(mUserId); } } No newline at end of file tests/robotests/src/com/android/settings/gestures/DoubleTapScreenPreferenceControllerTest.java +12 −0 Original line number Diff line number Diff line Loading @@ -161,4 +161,16 @@ public class DoubleTapScreenPreferenceControllerTest { assertThat(DoubleTapScreenPreferenceController.isSuggestionComplete( mAmbientDisplayConfiguration, prefs)).isTrue(); } @Test public void canHandleClicks_falseWhenAlwaysOnEnabled() { when(mAmbientDisplayConfiguration.alwaysOnEnabled(anyInt())).thenReturn(true); assertThat(mController.canHandleClicks()).isFalse(); } @Test public void canHandleClicks_trueWhenAlwaysOnDisabled() { when(mAmbientDisplayConfiguration.alwaysOnEnabled(anyInt())).thenReturn(false); assertThat(mController.canHandleClicks()).isTrue(); } } Loading
src/com/android/settings/display/AmbientDisplaySettings.java +1 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ public class AmbientDisplaySettings extends DashboardFragment { protected List<AbstractPreferenceController> getPreferenceControllers(Context context) { return buildPreferenceControllers(context, getLifecycle(), new AmbientDisplayConfiguration(context), mMetricsFeatureProvider, () -> { updatePreferenceStates(); }); this::updatePreferenceStates); } @Override Loading
src/com/android/settings/gestures/DoubleTapScreenPreferenceController.java +5 −0 Original line number Diff line number Diff line Loading @@ -102,4 +102,9 @@ public class DoubleTapScreenPreferenceController extends GesturePreferenceContro return new InlineSwitchPayload(SECURE_KEY, ResultPayload.SettingsSource.SECURE, ON /* onValue */, intent, isAvailable(), ON /* defaultValue */); } @Override protected boolean canHandleClicks() { return !mAmbientConfig.alwaysOnEnabled(mUserId); } } No newline at end of file
tests/robotests/src/com/android/settings/gestures/DoubleTapScreenPreferenceControllerTest.java +12 −0 Original line number Diff line number Diff line Loading @@ -161,4 +161,16 @@ public class DoubleTapScreenPreferenceControllerTest { assertThat(DoubleTapScreenPreferenceController.isSuggestionComplete( mAmbientDisplayConfiguration, prefs)).isTrue(); } @Test public void canHandleClicks_falseWhenAlwaysOnEnabled() { when(mAmbientDisplayConfiguration.alwaysOnEnabled(anyInt())).thenReturn(true); assertThat(mController.canHandleClicks()).isFalse(); } @Test public void canHandleClicks_trueWhenAlwaysOnDisabled() { when(mAmbientDisplayConfiguration.alwaysOnEnabled(anyInt())).thenReturn(false); assertThat(mController.canHandleClicks()).isTrue(); } }