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

Commit 62f51e67 authored by Shu Chen's avatar Shu Chen
Browse files

Makes the multi-touch prevention only works for editable TextView.

The original logic of preventing the multi-touch issue for the edtiable
text view was introduced by ag/10930920.
Turns out the non-editable text views are affected.

The root cause of the issue is that:
 - the ACTION_DOWN/ACTION_UP events, as well as ACTION_PONITER_DOWN /
   ACTION_POINTER_UP, could be generated by different fingers,
 - and View#onTouchEvent() gets muted when isFromPrimePointer() == false,
 - so that no gesture is generated, e.g. click, long press, etc.

Note that View#onTouchEvent() is necessary to be muted to prevent long press
on text or scrolling while dragging the insertion handle view.

Bug: 169288151
Change-Id: Ia763e94be727ad23bb13839f146293f1579d03ec
(cherry picked from commit 265096d9)
parent ce7806da
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -11009,12 +11009,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                    MotionEvent.actionToString(event.getActionMasked()),
                    MotionEvent.actionToString(event.getActionMasked()),
                    event.getX(), event.getY());
                    event.getX(), event.getY());
        }
        }
        final int action = event.getActionMasked();
        if (mEditor != null) {
            if (!isFromPrimePointer(event, false)) {
            if (!isFromPrimePointer(event, false)) {
                return true;
                return true;
            }
            }
        final int action = event.getActionMasked();
        if (mEditor != null) {
            mEditor.onTouchEvent(event);
            mEditor.onTouchEvent(event);
            if (mEditor.mInsertionPointCursorController != null
            if (mEditor.mInsertionPointCursorController != null