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

Commit 0a65077e authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Work around issue #65333586: Took phone out of pocket...

...and screen was flickering badly

Don't crash if we get a bad pointer ID, just log a wtf
for us to find in APR.

Bug: 65333586
Test: manual

Change-Id: I6f522e05735a64b672c011012c3e3514d454dd8f
parent b913a1e6
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.hardware.input.InputManager;
import android.hardware.input.InputManager.InputDeviceListener;
import android.os.SystemProperties;
import android.util.Log;
import android.util.Slog;
import android.view.InputDevice;
import android.view.KeyEvent;
import android.view.MotionEvent;
@@ -630,6 +631,12 @@ public class PointerLocationView extends View implements InputDeviceListener,
                    >> MotionEvent.ACTION_POINTER_INDEX_SHIFT; // will be 0 for UP

            final int id = event.getPointerId(index);
            if (id >= NP) {
                Slog.wtf(TAG, "Got pointer ID out of bounds: id=" + id + " arraysize="
                        + NP + " pointerindex=" + index
                        + " action=0x" + Integer.toHexString(action));
                return;
            }
            final PointerState ps = mPointers.get(id);
            ps.mCurDown = false;