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

Commit ada655fe authored by Josep del Río's avatar Josep del Río Committed by Android (Google) Code Review
Browse files

Merge "Prevent touches while stylus is hovering" into main

parents d0193b05 7ac2938d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1171,12 +1171,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.