summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff Brown <jeffbrown@google.com> 2011-09-12 14:50:31 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2011-09-12 14:50:31 -0700
commit125b73eb59a991fe77cb757454ec7468bf0abca7 (patch)
tree6fb1b3954e877b327cbf2a8b2db88feacd2789b5
parent1cd955b01d8ea72009be56f4c4a93d4d79e902df (diff)
parent68ebcdf3fd8b98fe35ec3e0b2e91fd254fcd807f (diff)
Merge "Fix ACTION_CANCEL handling in status bar. Bug: 5198231"
-rw-r--r--packages/SystemUI/src/com/android/systemui/SwipeHelper.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java8
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 0354fd7d1117..ec36de76d3d3 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 69e0752f6b42..e0a8d7e50399 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();