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

Commit 68ebcdf3 authored by Jeff Brown's avatar Jeff Brown
Browse files

Fix ACTION_CANCEL handling in status bar.

Bug: 5198231

Widgets always need to handle ACTION_CANCEL properly since
it can happen at any time, such as when the screen is turned
off or the screen is rotated, removed or reconfigured.

Change-Id: Ia30b14bb6f68cdde5286b4d72e69130e9fb38732
parent 6515f50d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -186,6 +186,7 @@ public class SwipeHelper {
                }
                break;
            case MotionEvent.ACTION_UP:
            case MotionEvent.ACTION_CANCEL:
                mDragging = false;
                mCurrView = null;
                mCurrAnimView = null;
+5 −3
Original line number Diff line number Diff line
@@ -1469,9 +1469,10 @@ public class PhoneStatusBar extends StatusBar {
            return false;
        }

        final int action = event.getAction();
        final int statusBarSize = mStatusBarView.getHeight();
        final int hitSize = statusBarSize*2;
        if (event.getAction() == MotionEvent.ACTION_DOWN) {
        if (action == MotionEvent.ACTION_DOWN) {
            final int y = (int)event.getRawY();

            if (!mExpanded) {
@@ -1496,7 +1497,7 @@ public class PhoneStatusBar extends StatusBar {
        } else if (mTracking) {
            mVelocityTracker.addMovement(event);
            final int minY = statusBarSize + mCloseView.getHeight();
            if (event.getAction() == MotionEvent.ACTION_MOVE) {
            if (action == MotionEvent.ACTION_MOVE) {
                int y = (int)event.getRawY();
                if (mAnimatingReveal && y < minY) {
                    // nothing
@@ -1504,7 +1505,8 @@ public class PhoneStatusBar extends StatusBar {
                    mAnimatingReveal = false;
                    updateExpandedViewPos(y + mViewDelta);
                }
            } else if (event.getAction() == MotionEvent.ACTION_UP) {
            } else if (action == MotionEvent.ACTION_UP
                    || action == MotionEvent.ACTION_CANCEL) {
                mVelocityTracker.computeCurrentVelocity(1000);

                float yVel = mVelocityTracker.getYVelocity();