OSDN Git Service

Fix possible crash in System UI
authorJim Miller <jaggies@google.com>
Tue, 15 Oct 2013 20:46:51 +0000 (13:46 -0700)
committerJim Miller <jaggies@google.com>
Tue, 15 Oct 2013 20:46:51 +0000 (13:46 -0700)
Fixes bug 11215581

Change-Id: Ic76ad783729316539e8e57feb098d6e823b4ecdf

packages/Keyguard/src/com/android/keyguard/PagedView.java

index 23488d4..9d31ab0 100644 (file)
@@ -1553,6 +1553,9 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
             if (mTouchState == TOUCH_STATE_SCROLLING) {
                 final int activePointerId = mActivePointerId;
                 final int pointerIndex = ev.findPointerIndex(activePointerId);
+
+                if (pointerIndex == -1) return true;
+
                 final float x = ev.getX(pointerIndex);
                 final VelocityTracker velocityTracker = mVelocityTracker;
                 velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity);