diff options
| author | 2022-09-07 01:53:37 +0000 | |
|---|---|---|
| committer | 2022-09-07 01:53:37 +0000 | |
| commit | 30e354347e8b08a1b0fe88e7236352748480559c (patch) | |
| tree | 0a9a50137b02aa5d4ce99e22651672fb2a28ea98 | |
| parent | b72a652f4690d8053e8005cb066b38101b1faf97 (diff) | |
| parent | ee68a1e34cb0151950038cd8a5f5b76397e85907 (diff) | |
Merge "Improve lock annotation for InputMethodManager (3/N)"
| -rw-r--r-- | core/java/android/view/inputmethod/InputMethodManager.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index bf5ec3dbfb03..9acd1af952ae 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -896,21 +896,25 @@ public final class InputMethodManager { return mDelegate.hasActiveConnection(view); } + @GuardedBy("mH") private View getServedViewLocked() { return mCurRootView != null ? mCurRootView.getImeFocusController().getServedView() : null; } + @GuardedBy("mH") private View getNextServedViewLocked() { return mCurRootView != null ? mCurRootView.getImeFocusController().getNextServedView() : null; } + @GuardedBy("mH") private void setServedViewLocked(View view) { if (mCurRootView != null) { mCurRootView.getImeFocusController().setServedView(view); } } + @GuardedBy("mH") private void setNextServedViewLocked(View view) { if (mCurRootView != null) { mCurRootView.getImeFocusController().setNextServedView(view); @@ -929,6 +933,7 @@ public final class InputMethodManager { /** * Returns {@code true} when the given view has been served by Input Method. */ + @GuardedBy("mH") private boolean hasServedByInputMethodLocked(View view) { final View servedView = getServedViewLocked(); return (servedView == view @@ -3252,6 +3257,7 @@ public final class InputMethodManager { } } + @GuardedBy("mH") private void flushPendingEventsLocked() { mH.removeMessages(MSG_FLUSH_INPUT_EVENT); @@ -3264,6 +3270,7 @@ public final class InputMethodManager { } } + @GuardedBy("mH") private PendingEvent obtainPendingEventLocked(InputEvent event, Object token, String inputMethodId, FinishedInputEventCallback callback, Handler handler) { PendingEvent p = mPendingEventPool.acquire(); @@ -3278,6 +3285,7 @@ public final class InputMethodManager { return p; } + @GuardedBy("mH") private void recyclePendingEventLocked(PendingEvent p) { p.recycle(); mPendingEventPool.release(p); @@ -3310,6 +3318,7 @@ public final class InputMethodManager { mServiceInvoker.showInputMethodPickerFromSystem(mClient, mode, displayId); } + @GuardedBy("mH") private void showInputMethodPickerLocked() { mServiceInvoker.showInputMethodPickerFromClient(mClient, SHOW_IM_PICKER_MODE_AUTO); } @@ -3844,6 +3853,7 @@ public final class InputMethodManager { } } + @GuardedBy("mH") private void forAccessibilitySessionsLocked( Consumer<IAccessibilityInputMethodSessionInvoker> consumer) { for (int i = 0; i < mAccessibilityInputMethodSession.size(); i++) { |