Merge change 8683
* changes: Fix a bug that was causing ArrayIndexOutOfBoutExceptions when obtaining a MotionEvent from an older one that had a number of time samples.
This commit is contained in:
@@ -509,7 +509,7 @@ public final class MotionEvent implements Parcelable {
|
||||
ev.mYPrecision = o.mYPrecision;
|
||||
|
||||
final int NT = ev.mNumSamples = o.mNumSamples;
|
||||
if (ev.mTimeSamples.length < NT) {
|
||||
if (ev.mTimeSamples.length >= NT) {
|
||||
System.arraycopy(o.mTimeSamples, 0, ev.mTimeSamples, 0, NT);
|
||||
} else {
|
||||
ev.mTimeSamples = (long[])o.mTimeSamples.clone();
|
||||
|
||||
Reference in New Issue
Block a user