Loading packages/SystemUI/multivalentTests/src/com/android/systemui/lowlight/LowLightBehaviorCoreStartableTest.kt +20 −1 Original line number Diff line number Diff line Loading @@ -286,7 +286,7 @@ class LowLightBehaviorCoreStartableTest : SysuiTestCase() { ) setBatteryPluggedIn(true) setDisplayOn(true) setDisplayOn(false) fakeKeyguardRepository.setDozeTransitionModel( DozeTransitionModel(from = DozeStateModel.UNINITIALIZED, to = DozeStateModel.DOZE) Loading Loading @@ -334,6 +334,25 @@ class LowLightBehaviorCoreStartableTest : SysuiTestCase() { assertThat(ambientLightModeMonitor.fake.started).isFalse() } @Test fun testDoNotSubscribeIfScreenOnNonIdleForScreenOffBehaviorPluggedIn() = kosmos.runTest { lowLightRepository.addAction(LowLightDisplayBehavior.SCREEN_OFF, action) lowLightSettingsRepository.setLowLightDisplayBehavior( LowLightDisplayBehavior.SCREEN_OFF ) fakeKeyguardRepository.setDozeTransitionModel( DozeTransitionModel(from = DozeStateModel.UNINITIALIZED, to = DozeStateModel.DOZE) ) setBatteryPluggedIn(true) setDisplayOn(true) underTest.start() assertThat(ambientLightModeMonitor.fake.started).isFalse() } private fun Kosmos.setLowLightFromSensor(lowlight: Boolean) { val lightMode = if (lowlight) { Loading packages/SystemUI/src/com/android/systemui/lowlight/LowLightBehaviorCoreStartable.kt +2 −3 Original line number Diff line number Diff line Loading @@ -164,12 +164,11 @@ constructor( private fun shouldTrackLowLight(behavior: LowLightDisplayBehavior): Flow<Boolean> { return allOf( anyOf(isScreenOn, flowOf(behavior.allowedInScreenState(ScreenState.OFF))), dreamSettingsInteractor.dreamingEnabled, isPluggedIn, anyOf( isDeviceIdleAndNotDozing, flowOf(behavior.allowedInScreenState(ScreenState.DOZE)), allOf(isScreenOn, isDeviceIdleAndNotDozing), allOf(not(isScreenOn), flowOf(behavior.allowedInScreenState(ScreenState.OFF))), ), ) .flatMapLatestConflated { Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/lowlight/LowLightBehaviorCoreStartableTest.kt +20 −1 Original line number Diff line number Diff line Loading @@ -286,7 +286,7 @@ class LowLightBehaviorCoreStartableTest : SysuiTestCase() { ) setBatteryPluggedIn(true) setDisplayOn(true) setDisplayOn(false) fakeKeyguardRepository.setDozeTransitionModel( DozeTransitionModel(from = DozeStateModel.UNINITIALIZED, to = DozeStateModel.DOZE) Loading Loading @@ -334,6 +334,25 @@ class LowLightBehaviorCoreStartableTest : SysuiTestCase() { assertThat(ambientLightModeMonitor.fake.started).isFalse() } @Test fun testDoNotSubscribeIfScreenOnNonIdleForScreenOffBehaviorPluggedIn() = kosmos.runTest { lowLightRepository.addAction(LowLightDisplayBehavior.SCREEN_OFF, action) lowLightSettingsRepository.setLowLightDisplayBehavior( LowLightDisplayBehavior.SCREEN_OFF ) fakeKeyguardRepository.setDozeTransitionModel( DozeTransitionModel(from = DozeStateModel.UNINITIALIZED, to = DozeStateModel.DOZE) ) setBatteryPluggedIn(true) setDisplayOn(true) underTest.start() assertThat(ambientLightModeMonitor.fake.started).isFalse() } private fun Kosmos.setLowLightFromSensor(lowlight: Boolean) { val lightMode = if (lowlight) { Loading
packages/SystemUI/src/com/android/systemui/lowlight/LowLightBehaviorCoreStartable.kt +2 −3 Original line number Diff line number Diff line Loading @@ -164,12 +164,11 @@ constructor( private fun shouldTrackLowLight(behavior: LowLightDisplayBehavior): Flow<Boolean> { return allOf( anyOf(isScreenOn, flowOf(behavior.allowedInScreenState(ScreenState.OFF))), dreamSettingsInteractor.dreamingEnabled, isPluggedIn, anyOf( isDeviceIdleAndNotDozing, flowOf(behavior.allowedInScreenState(ScreenState.DOZE)), allOf(isScreenOn, isDeviceIdleAndNotDozing), allOf(not(isScreenOn), flowOf(behavior.allowedInScreenState(ScreenState.OFF))), ), ) .flatMapLatestConflated { Loading