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

Commit 7ac2938d authored by Josep del Rio's avatar Josep del Rio Committed by Josep del Río
Browse files

Prevent touches while stylus is hovering

While using Scribe, it is possible to get sporadic touches during
the time that the stylus is not touching the screen but hovering
it; for instance, the time between completing a word and starting
a new one, "i" dots, etc.

Bug: 353919303
Test: ABTD
Flag: EXEMPT bugfix

Change-Id: I5600e2275df27fbfebb4cad84a11861871caf80a
parent 1800d500
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1166,12 +1166,14 @@ public class InputMethodService extends AbstractInputMethodService {
            }
            switch (motionEvent.getAction()) {
                case MotionEvent.ACTION_DOWN:
                case MotionEvent.ACTION_HOVER_ENTER:
                    // Consume and ignore all touches while stylus is down to prevent
                    // accidental touches from going to the app while writing.
                    mPrivOps.setHandwritingSurfaceNotTouchable(false);
                    break;
                case MotionEvent.ACTION_UP:
                case MotionEvent.ACTION_CANCEL:
                case MotionEvent.ACTION_HOVER_EXIT:
                    // Go back to only consuming stylus events so that the user
                    // can continue to interact with the app using touch
                    // when the stylus is not down.