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

Commit 2b52d5f0 authored by William Leshner's avatar William Leshner Committed by Automerger Merge Worker
Browse files

Merge "Attempted fix for IllegalStateException" into tm-qpr-dev am: c143f762...

Merge "Attempted fix for IllegalStateException" into tm-qpr-dev am: c143f762 am: 279774f6 am: 5cab4953

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21656516



Change-Id: I8af9f342d55d841273f0e7a0deeb2ff271254813
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ebaa7650 5cab4953
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -254,7 +254,10 @@ public class BouncerSwipeTouchHandler implements DreamTouchHandler {
        mCurrentScrimController = mScrimManager.getCurrentController();

        session.registerCallback(() -> {
            if (mVelocityTracker != null) {
                mVelocityTracker.recycle();
                mVelocityTracker = null;
            }
            mScrimManager.removeCallback(mScrimManagerCallback);
            mCapture = null;
            mNotificationShadeWindowController.setForcePluginOpen(false, this);
+9 −0
Original line number Diff line number Diff line
@@ -450,6 +450,15 @@ public class BouncerSwipeTouchHandlerTest extends SysuiTestCase {
        swipeToPosition(0f, Direction.DOWN, 0);
    }

    @Test
    public void testTouchSessionOnRemovedCalledTwice() {
        mTouchHandler.onSessionStart(mTouchSession);
        ArgumentCaptor<DreamTouchHandler.TouchSession.Callback> onRemovedCallbackCaptor =
                ArgumentCaptor.forClass(DreamTouchHandler.TouchSession.Callback.class);
        verify(mTouchSession).registerCallback(onRemovedCallbackCaptor.capture());
        onRemovedCallbackCaptor.getValue().onRemoved();
        onRemovedCallbackCaptor.getValue().onRemoved();
    }

    private void swipeToPosition(float percent, Direction direction, float velocityY) {
        Mockito.clearInvocations(mTouchSession);