Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7c64f15 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

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.
parents 692a316d dac57e4e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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();