summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2013-05-22 15:53:24 -0700
committerJim Miller <jaggies@google.com>2013-05-22 16:05:08 -0700
commitd794e648c313f0c4c8f89a9032fdee26b67a078c (patch)
treed91036a5fd675a1fabcce5f529d4a512b4b209db /policy
parent606ab4706df372974cc86eb1bb1c50d79422d7cc (diff)
downloadframeworks_base-d794e648c313f0c4c8f89a9032fdee26b67a078c.zip
frameworks_base-d794e648c313f0c4c8f89a9032fdee26b67a078c.tar.gz
frameworks_base-d794e648c313f0c4c8f89a9032fdee26b67a078c.tar.bz2
Check for invalid pointer index in PagedView
Fixes bug 9088039 Change-Id: I54897df39adbf224ef3dd3de4ce7254fb70b587c
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/PagedView.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/PagedView.java b/policy/src/com/android/internal/policy/impl/keyguard/PagedView.java
index 186a013..10562e8 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/PagedView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/PagedView.java
@@ -86,7 +86,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
private static final int MIN_SNAP_VELOCITY = 1500;
private static final int MIN_FLING_VELOCITY = 250;
- // We are disabling touch interaction of the widget region for factory ROM.
+ // We are disabling touch interaction of the widget region for factory ROM.
private static final boolean DISABLE_TOUCH_INTERACTION = false;
private static final boolean DISABLE_TOUCH_SIDE_PAGES = true;
private static final boolean DISABLE_FLING_TO_DELETE = false;
@@ -1350,6 +1350,9 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
if (mTouchState == TOUCH_STATE_SCROLLING) {
// Scroll to follow the motion event
final int pointerIndex = ev.findPointerIndex(mActivePointerId);
+
+ if (pointerIndex == -1) return true;
+
final float x = ev.getX(pointerIndex);
final float deltaX = mLastMotionX + mLastMotionXRemainder - x;