Loading packages/SystemUI/multivalentTests/src/com/android/systemui/topwindoweffects/domain/interactor/SqueezeEffectInteractorTest.kt +4 −4 Original line number Diff line number Diff line Loading @@ -42,14 +42,14 @@ class SqueezeEffectInteractorTest : SysuiTestCase() { } @Test fun powerButtonSemantics_powerKeyNotDownAsSingleGestureAndDisabled_cancelsSqueeze() = fun powerButtonSemantics_powerKeyNotDownAsSingleGestureAndDisabled_isNull() = kosmos.runTest { fakeSqueezeEffectRepository.isEffectEnabled.value = false fakeSqueezeEffectRepository.isPowerButtonPressedAsSingleGesture.value = false val powerButtonSemantics by collectLastValue(underTest.powerButtonSemantics) assertThat(powerButtonSemantics).isEqualTo(PowerButtonSemantics.CANCEL_SQUEEZE) assertThat(powerButtonSemantics).isNull() } @Test Loading Loading @@ -114,7 +114,7 @@ class SqueezeEffectInteractorTest : SysuiTestCase() { } @Test fun powerButtonSemantics_onLPPAndDisabledAndPowerKeyNotAsSingleGesture_cancelsSqueeze() = fun powerButtonSemantics_onLPPAndDisabledAndPowerKeyNotAsSingleGesture_isNull() = kosmos.runTest { fakeSqueezeEffectRepository.isEffectEnabled.value = false fakeSqueezeEffectRepository.isPowerButtonPressedAsSingleGesture.value = false Loading @@ -122,6 +122,6 @@ class SqueezeEffectInteractorTest : SysuiTestCase() { val powerButtonSemantics by collectLastValue(underTest.powerButtonSemantics) assertThat(powerButtonSemantics).isEqualTo(PowerButtonSemantics.CANCEL_SQUEEZE) assertThat(powerButtonSemantics).isNull() } } packages/SystemUI/src/com/android/systemui/topwindoweffects/domain/interactor/SqueezeEffectInteractor.kt +2 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,8 @@ constructor(private val squeezeEffectRepository: SqueezeEffectRepository) { ) { isEnabled, isPowerButtonPressedAsSingleGesture, isPowerButtonLongPressed -> val useInitialRumble = squeezeEffectRepository.useHapticRumble() when { !isPowerButtonPressedAsSingleGesture -> PowerButtonSemantics.CANCEL_SQUEEZE isEnabled && !isPowerButtonPressedAsSingleGesture -> PowerButtonSemantics.CANCEL_SQUEEZE isEnabled && isPowerButtonPressedAsSingleGesture && useInitialRumble -> PowerButtonSemantics.START_SQUEEZE_WITH_RUMBLE isEnabled && isPowerButtonPressedAsSingleGesture && !useInitialRumble -> Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/topwindoweffects/domain/interactor/SqueezeEffectInteractorTest.kt +4 −4 Original line number Diff line number Diff line Loading @@ -42,14 +42,14 @@ class SqueezeEffectInteractorTest : SysuiTestCase() { } @Test fun powerButtonSemantics_powerKeyNotDownAsSingleGestureAndDisabled_cancelsSqueeze() = fun powerButtonSemantics_powerKeyNotDownAsSingleGestureAndDisabled_isNull() = kosmos.runTest { fakeSqueezeEffectRepository.isEffectEnabled.value = false fakeSqueezeEffectRepository.isPowerButtonPressedAsSingleGesture.value = false val powerButtonSemantics by collectLastValue(underTest.powerButtonSemantics) assertThat(powerButtonSemantics).isEqualTo(PowerButtonSemantics.CANCEL_SQUEEZE) assertThat(powerButtonSemantics).isNull() } @Test Loading Loading @@ -114,7 +114,7 @@ class SqueezeEffectInteractorTest : SysuiTestCase() { } @Test fun powerButtonSemantics_onLPPAndDisabledAndPowerKeyNotAsSingleGesture_cancelsSqueeze() = fun powerButtonSemantics_onLPPAndDisabledAndPowerKeyNotAsSingleGesture_isNull() = kosmos.runTest { fakeSqueezeEffectRepository.isEffectEnabled.value = false fakeSqueezeEffectRepository.isPowerButtonPressedAsSingleGesture.value = false Loading @@ -122,6 +122,6 @@ class SqueezeEffectInteractorTest : SysuiTestCase() { val powerButtonSemantics by collectLastValue(underTest.powerButtonSemantics) assertThat(powerButtonSemantics).isEqualTo(PowerButtonSemantics.CANCEL_SQUEEZE) assertThat(powerButtonSemantics).isNull() } }
packages/SystemUI/src/com/android/systemui/topwindoweffects/domain/interactor/SqueezeEffectInteractor.kt +2 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,8 @@ constructor(private val squeezeEffectRepository: SqueezeEffectRepository) { ) { isEnabled, isPowerButtonPressedAsSingleGesture, isPowerButtonLongPressed -> val useInitialRumble = squeezeEffectRepository.useHapticRumble() when { !isPowerButtonPressedAsSingleGesture -> PowerButtonSemantics.CANCEL_SQUEEZE isEnabled && !isPowerButtonPressedAsSingleGesture -> PowerButtonSemantics.CANCEL_SQUEEZE isEnabled && isPowerButtonPressedAsSingleGesture && useInitialRumble -> PowerButtonSemantics.START_SQUEEZE_WITH_RUMBLE isEnabled && isPowerButtonPressedAsSingleGesture && !useInitialRumble -> Loading