Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e27ae70 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Making ShadeInteractor aware of user interactions remotely initiated." into main

parents bfbd5668 ffb93503
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ class SceneContainerHapticsViewModelTest : SysuiTestCase() {
            // WHEN the transition occurs
            sceneInteractor.setTransitionState(MutableStateFlow(validTransition))
            runCurrent()
            assertThat(isUserInteracting).isFalse()
            assertThat(isUserInteracting).isTrue()

            // THEN the expected token plays without interaction properties
            assertThat(msdlPlayer.latestTokenPlayed).isEqualTo(MSDLToken.SWIPE_THRESHOLD_INDICATOR)
@@ -254,7 +254,7 @@ class SceneContainerHapticsViewModelTest : SysuiTestCase() {
            // WHEN the transition occurs
            sceneInteractor.setTransitionState(MutableStateFlow(validTransition))
            runCurrent()
            assertThat(isUserInteracting).isFalse()
            assertThat(isUserInteracting).isTrue()

            // THEN the expected token plays without interaction properties
            assertThat(msdlPlayer.latestTokenPlayed).isEqualTo(MSDLToken.SWIPE_THRESHOLD_INDICATOR)
+2 −1
Original line number Diff line number Diff line
@@ -360,7 +360,8 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
                        mTestScope.getBackgroundScope(),
                        mFakeKeyguardRepository,
                        mShadeRepository
                ));
                ),
                mKosmos.getSceneInteractor());
        SystemClock systemClock = new FakeSystemClock();
        mStatusBarStateController = new StatusBarStateControllerImpl(
                mUiEventLogger,
+2 −1
Original line number Diff line number Diff line
@@ -198,7 +198,8 @@ public class QuickSettingsControllerImplBaseTest extends SysuiTestCase {
                        mTestScope.getBackgroundScope(),
                        mKeyguardRepository,
                        mShadeRepository
                ));
                ),
                mKosmos.getSceneInteractor());

        when(mResources.getDimensionPixelSize(
                R.dimen.lockscreen_shade_qs_transition_distance)).thenReturn(DEFAULT_HEIGHT);
+4 −7
Original line number Diff line number Diff line
@@ -57,13 +57,10 @@ constructor(

    /** Should haptics be played by pulling down the shade */
    private val isShadePullHapticsRequired: Flow<Boolean> =
        combine(
                shadeInteractor.isUserInteracting,
                sceneInteractor.transitionState,
                sceneInteractor.isRemoteUserInteractionOngoing,
            ) { interacting, transitionState, remoteInteractionGoing ->
                val validInteraction = interacting || remoteInteractionGoing
                validInteraction && transitionState.isValidForShadePullHaptics()
        combine(shadeInteractor.isUserInteracting, sceneInteractor.transitionState) {
                interacting,
                transitionState ->
                interacting && transitionState.isValidForShadePullHaptics()
            }
            .distinctUntilChanged()

+2 −1
Original line number Diff line number Diff line
@@ -47,7 +47,8 @@ interface ShadeInteractor : BaseShadeInteractor {
    /**
     * Whether the user is expanding or collapsing either the shade or quick settings with user
     * input (i.e. dragging a pointer). This will be true even if the user's input gesture had ended
     * but a transition they initiated is still animating.
     * but a transition they initiated is still animating. It will also be true if the gesture was
     * originated by the user but outside of System UI.
     */
    val isUserInteracting: StateFlow<Boolean>

Loading