diff options
| author | 2014-11-10 22:49:36 +0000 | |
|---|---|---|
| committer | 2014-11-10 22:49:39 +0000 | |
| commit | 12174a7d2940299ee0f951905bcbcc55ea724eae (patch) | |
| tree | f9cc6b3c40b18abbb1febf750cfbb980b9499a10 | |
| parent | f2bd3cc9df7e6da3e5802edd3d028b6b4498bb26 (diff) | |
| parent | aea80f40d8dc55b7de5b3d0efe78f63eeb7c2745 (diff) | |
Merge "Cancel lockscreen/shade gestures when orientation changes" into lmp-mr1-dev
3 files changed, 10 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java index f206e5633819..33f6564b948a 100644 --- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java +++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java @@ -453,7 +453,8 @@ public class SwipeHelper implements Gefingerpoken { && !mTouchAboveFalsingThreshold; boolean dismissChild = mCallback.canChildBeDismissed(mCurrView) - && !falsingDetected && (childSwipedFastEnough || childSwipedFarEnough); + && !falsingDetected && (childSwipedFastEnough || childSwipedFarEnough) + && ev.getActionMasked() == MotionEvent.ACTION_UP; if (dismissChild) { // flingadingy diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index b531c681bca6..9d7d31090338 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -523,7 +523,8 @@ public class NotificationPanelView extends PanelView implements case MotionEvent.ACTION_UP: trackMovement(event); if (mQsTracking) { - flingQsWithCurrentVelocity(); + flingQsWithCurrentVelocity( + event.getActionMasked() == MotionEvent.ACTION_CANCEL); mQsTracking = false; } mIntercepting = false; @@ -558,9 +559,9 @@ public class NotificationPanelView extends PanelView implements super.requestDisallowInterceptTouchEvent(disallowIntercept); } - private void flingQsWithCurrentVelocity() { + private void flingQsWithCurrentVelocity(boolean isCancelMotionEvent) { float vel = getCurrentVelocity(); - flingSettings(vel, flingExpandsQs(vel)); + flingSettings(vel, flingExpandsQs(vel) && !isCancelMotionEvent); } private boolean flingExpandsQs(float vel) { @@ -729,7 +730,8 @@ public class NotificationPanelView extends PanelView implements float fraction = getQsExpansionFraction(); if ((fraction != 0f || y >= mInitialTouchY) && (fraction != 1f || y <= mInitialTouchY)) { - flingQsWithCurrentVelocity(); + flingQsWithCurrentVelocity( + event.getActionMasked() == MotionEvent.ACTION_CANCEL); } else { mScrollYOverride = -1; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java index c706ef095cfa..47ce6032c9b7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -330,7 +330,8 @@ public abstract class PanelView extends FrameLayout { vectorVel = (float) Math.hypot( mVelocityTracker.getXVelocity(), mVelocityTracker.getYVelocity()); } - boolean expand = flingExpands(vel, vectorVel); + boolean expand = flingExpands(vel, vectorVel) + || event.getActionMasked() == MotionEvent.ACTION_CANCEL; onTrackingStopped(expand); DozeLog.traceFling(expand, mTouchAboveFalsingThreshold, mStatusBar.isFalsingThresholdNeeded(), |