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 Original line Diff line number Diff line
@@ -1239,14 +1239,13 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
        }
        }
    }
    }


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


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


    @Override
    @Override