summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/KeyInputQueue.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-10-13 22:43:33 -0700
committerDianne Hackborn <hackbod@google.com>2009-10-13 22:47:02 -0700
commitf2ddfb15288b71b0ddaf23df5128ed6525c71cb9 (patch)
tree959b0952d3afdf95ca8275a2b89c8545a8486495 /services/java/com/android/server/KeyInputQueue.java
parent53cd579459132b01442118c0cafc545f4ff54f01 (diff)
Another fix for #2186897: Cannot unlock the device by swiping
This was probably a side-effect of the divide by zero exception, but we'll be safe anyway. Change-Id: I875200febb9b3090d12f170066b2bea74c9f77f8
Diffstat (limited to 'services/java/com/android/server/KeyInputQueue.java')
-rw-r--r--services/java/com/android/server/KeyInputQueue.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/services/java/com/android/server/KeyInputQueue.java b/services/java/com/android/server/KeyInputQueue.java
index 09591f44e5e3..5d65c714e77c 100644
--- a/services/java/com/android/server/KeyInputQueue.java
+++ b/services/java/com/android/server/KeyInputQueue.java
@@ -721,11 +721,14 @@ public abstract class KeyInputQueue {
// virtual key area... but still
// propagate this to the previous
// data for comparisons.
+ int num = ms.mNextNumPointers;
+ if (num > InputDevice.MAX_POINTERS) {
+ num = InputDevice.MAX_POINTERS;
+ }
System.arraycopy(ms.mNextData, 0,
ms.mLastData, 0,
- ms.mNextNumPointers
- * MotionEvent.NUM_SAMPLE_DATA);
- ms.mLastNumPointers = ms.mNextNumPointers;
+ num * MotionEvent.NUM_SAMPLE_DATA);
+ ms.mLastNumPointers = num;
}
ms.finish();