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

Commit 39df954a authored by Taran Singh's avatar Taran Singh
Browse files

Use MotionEvent#isStylusPointer in initiator

Lets use the utility method newly introduced in MotionEvent instead of
duplicating it.

Bug: 287335464
Test: atest StylusHandwritingTest
Change-Id: I875341878a344c2b87feec525463e6394f2d0eb7
parent 4ac3a5d5
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -132,12 +132,7 @@ public class HandwritingInitiator {
            case MotionEvent.ACTION_DOWN:
            case MotionEvent.ACTION_POINTER_DOWN:
                mState = null;
                final int actionIndex = motionEvent.getActionIndex();
                final int toolType = motionEvent.getToolType(actionIndex);
                // TOOL_TYPE_ERASER is also from stylus. This indicates that the user is holding
                // the eraser button during handwriting.
                if (toolType != MotionEvent.TOOL_TYPE_STYLUS
                        && toolType != MotionEvent.TOOL_TYPE_ERASER) {
                if (!motionEvent.isStylusPointer()) {
                    // The motion event is not from a stylus event, ignore it.
                    return false;
                }