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

Commit b72a652f authored by Wilson Wu's avatar Wilson Wu Committed by Android (Google) Code Review
Browse files

Merge "Improve lock annotation for InputMethodManager (2/N)"

parents 44f64b62 27d44213
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -446,6 +446,7 @@ public final class InputMethodManager {
     * {@code true} if next {@link ImeFocusController#onPostWindowFocus} needs to
     * restart input.
     */
    @GuardedBy("mH")
    private boolean mRestartOnNextWindowFocus = true;

    /**
@@ -495,8 +496,11 @@ public final class InputMethodManager {
    private CompletionInfo[] mCompletions;

    // Cursor position on the screen.
    @GuardedBy("mH")
    @UnsupportedAppUsage
    Rect mTmpCursorRect = new Rect();

    @GuardedBy("mH")
    @UnsupportedAppUsage
    Rect mCursorRect = new Rect();

@@ -545,6 +549,7 @@ public final class InputMethodManager {
     * @deprecated New code should use {@code mCurBindState.mImeId}.
     */
    @Deprecated
    @GuardedBy("mH")
    @UnsupportedAppUsage
    String mCurId;

@@ -586,6 +591,7 @@ public final class InputMethodManager {
     * @deprecated This is kept for {@link UnsupportedAppUsage}.  Must not be used.
     */
    @Deprecated
    @GuardedBy("mH")
    private int mRequestUpdateCursorAnchorInfoMonitorMode = REQUEST_UPDATE_CURSOR_ANCHOR_INFO_NONE;

    /**
@@ -594,7 +600,9 @@ public final class InputMethodManager {
    @GuardedBy("mH")
    private ImeInsetsSourceConsumer mImeInsetsConsumer;

    @GuardedBy("mH")
    private final Pool<PendingEvent> mPendingEventPool = new SimplePool<>(20);
    @GuardedBy("mH")
    private final SparseArray<PendingEvent> mPendingEvents = new SparseArray<>(20);

    private final DelegateImpl mDelegate = new DelegateImpl();
@@ -841,12 +849,14 @@ public final class InputMethodManager {
         */
        @Override
        public boolean isRestartOnNextWindowFocus(boolean reset) {
            synchronized (mH) {
                final boolean result = mRestartOnNextWindowFocus;
                if (reset) {
                    mRestartOnNextWindowFocus = false;
                }
                return result;
            }
        }

        /**
         * Checks whether the active input connection (if any) is for the given view.