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

Commit b976fd7d authored by Beverly Tai's avatar Beverly Tai Committed by Android (Google) Code Review
Browse files

Merge "Make sure DragDownHelper is told of CANCEL touch event" into main

parents bbf31697 a82296af
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -659,6 +659,9 @@ public class NotificationShadeWindowViewController implements Dumpable {
            mTouchCancelled = true;
        }
        mAmbientState.setSwipingUp(false);
        if (MigrateClocksToBlueprint.isEnabled()) {
            mDragDownHelper.stopDragging();
        }
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -959,7 +959,7 @@ class DragDownHelper(
        anim.start()
    }

    private fun stopDragging() {
    fun stopDragging() {
        if (startingChild != null) {
            cancelChildExpansion(startingChild!!)
            startingChild = null
+8 −0
Original line number Diff line number Diff line
@@ -578,6 +578,14 @@ class NotificationShadeWindowViewControllerTest : SysuiTestCase() {
        assertEquals(keyEvent, falsingCollector.lastKeyEvent)
    }

    @Test
    fun cancelCurrentTouch_callsDragDownHelper() {
        mSetFlagsRule.enableFlags(Flags.FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT)
        underTest.cancelCurrentTouch()

        verify(dragDownHelper).stopDragging()
    }

    companion object {
        private val DOWN_EVENT = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN, 0f, 0f, 0)
        private val MOVE_EVENT = MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_MOVE, 0f, 0f, 0)