diff options
| author | 2024-07-31 10:20:57 -0700 | |
|---|---|---|
| committer | 2024-07-31 10:20:57 -0700 | |
| commit | 1544c80dd31fd152cc33bd0dfec01dc96bb8782c (patch) | |
| tree | 089a7f88e418424a6b2b922c8aee6b99d558fc05 | |
| parent | cd26e7fb38daa53c908ebad7970e8627a98bdbfc (diff) | |
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
| -rw-r--r-- | services/core/java/com/android/server/inputmethod/InputMethodManagerService.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index 730077c854fb..8a2b02a49486 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -1239,12 +1239,11 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl. } } - private void onUpdateEditorToolType(int toolType) { - synchronized (ImfLock.class) { - IInputMethodInvoker curMethod = getCurMethodLocked(); - if (curMethod != null) { - curMethod.updateEditorToolType(toolType); - } + @GuardedBy("ImfLock.class") + private void onUpdateEditorToolTypeLocked(@MotionEvent.ToolType int toolType) { + final IInputMethodInvoker curMethod = getCurMethodLocked(); + if (curMethod != null) { + curMethod.updateEditorToolType(toolType); } } @@ -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 |