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

Commit 79c59974 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Cleanup isStylusEvent in HandwritingModeController"

parents d2cc5e8c 9d8d4dae
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package com.android.server.inputmethod;

import static android.view.InputDevice.SOURCE_STYLUS;

import android.Manifest;
import android.annotation.AnyThread;
import android.annotation.NonNull;
@@ -95,15 +93,6 @@ final class HandwritingModeController {
        mInkWindowInitRunnable = inkWindowInitRunnable;
    }

    // TODO(b/210039666): Consider moving this to MotionEvent
    private static boolean isStylusEvent(MotionEvent event) {
        if (!event.isFromSource(SOURCE_STYLUS)) {
            return false;
        }
        final int tool = event.getToolType(0);
        return tool == MotionEvent.TOOL_TYPE_STYLUS || tool == MotionEvent.TOOL_TYPE_ERASER;
    }

    /**
     * Initializes the handwriting spy on the given displayId.
     *
@@ -329,7 +318,7 @@ final class HandwritingModeController {
            return false;
        }
        final MotionEvent event = (MotionEvent) ev;
        if (!isStylusEvent(event)) {
        if (!event.isStylusPointer()) {
            return false;
        }
        if (event.getDisplayId() != mCurrentDisplayId) {