diff options
author | Jeff Brown <jeffbrown@google.com> | 2011-09-12 14:12:17 -0700 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2011-09-12 14:12:17 -0700 |
commit | 68ebcdf3fd8b98fe35ec3e0b2e91fd254fcd807f (patch) | |
tree | f22373b1bf041bbcd5235b5ce5cb0278c07dcdcc /packages | |
parent | 6515f50d0c759cfff163aaf7f42a970019d93923 (diff) | |
download | frameworks_base-68ebcdf3fd8b98fe35ec3e0b2e91fd254fcd807f.zip frameworks_base-68ebcdf3fd8b98fe35ec3e0b2e91fd254fcd807f.tar.gz frameworks_base-68ebcdf3fd8b98fe35ec3e0b2e91fd254fcd807f.tar.bz2 |
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
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/SwipeHelper.java | 1 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java index 0354fd7..ec36de7 100644 --- a/packages/SystemUI/src/com/android/systemui/SwipeHelper.java +++ b/packages/SystemUI/src/com/android/systemui/SwipeHelper.java @@ -186,6 +186,7 @@ public class SwipeHelper { } break; case MotionEvent.ACTION_UP: + case MotionEvent.ACTION_CANCEL: mDragging = false; mCurrView = null; mCurrAnimView = null; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 69e0752..e0a8d7e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -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(); |