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

Commit 1544c80d authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Simplify IMMS#onUpdateEditorToolType() a bit

This is a mechanical refactoring CL of

  InputMethodManagerService#onUpdateEditorToolType()

without changing any observable behavior.

Bug: 350386877
Test: presubmit
Flag: EXEMPT refactor
Change-Id: I52e43cf6d87f8da10ee3c986e14ce6a879092d10
parent cd26e7fb
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -1239,14 +1239,13 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
        }
    }

    private void onUpdateEditorToolType(int toolType) {
        synchronized (ImfLock.class) {
            IInputMethodInvoker curMethod = getCurMethodLocked();
    @GuardedBy("ImfLock.class")
    private void onUpdateEditorToolTypeLocked(@MotionEvent.ToolType int toolType) {
        final IInputMethodInvoker curMethod = getCurMethodLocked();
        if (curMethod != null) {
            curMethod.updateEditorToolType(toolType);
        }
    }
    }

    private void discardHandwritingDelegationText() {
        synchronized (ImfLock.class) {
@@ -3465,7 +3464,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
            if (Flags.useHandwritingListenerForTooltype()) {
                maybeReportToolType();
            } else if (lastClickToolType != MotionEvent.TOOL_TYPE_UNKNOWN) {
                onUpdateEditorToolType(lastClickToolType);
                onUpdateEditorToolTypeLocked(lastClickToolType);
            }
            mVisibilityApplier.performShowIme(windowToken, statsToken,
                    mVisibilityStateComputer.getShowFlagsForInputMethodServiceOnly(),
@@ -3499,7 +3498,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
            // other toolTypes are irrelevant and reported as unknown.
            toolType = MotionEvent.TOOL_TYPE_UNKNOWN;
        }
        onUpdateEditorToolType(toolType);
        onUpdateEditorToolTypeLocked(toolType);
    }

    @Override