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

Commit ef63dc49 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Inline clearInputShownLocked() and isInputShownLocked()" into main

parents 3468f2d0 292aaee5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -463,7 +463,7 @@ final class InputMethodBindingController {
                    // should now try to restart the service for us.
                    mLastBindTime = SystemClock.uptimeMillis();
                    clearCurMethodAndSessions();
                    mService.clearInputShownLocked();
                    mService.mVisibilityStateComputer.setInputShown(false);
                    mService.unbindCurrentClientLocked(UnbindReason.DISCONNECT_IME, mUserId);
                }
            }
+6 −16
Original line number Diff line number Diff line
@@ -371,7 +371,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
    @GuardedBy("ImfLock.class")
    @MultiUserUnawareField
    @NonNull
    private final ImeVisibilityStateComputer mVisibilityStateComputer;
    final ImeVisibilityStateComputer mVisibilityStateComputer;

    @GuardedBy("ImfLock.class")
    @SharedByAllUsersField
@@ -1805,16 +1805,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
        }
    }

    @GuardedBy("ImfLock.class")
    void clearInputShownLocked() {
        mVisibilityStateComputer.setInputShown(false);
    }

    @GuardedBy("ImfLock.class")
    private boolean isInputShownLocked() {
        return mVisibilityStateComputer.isInputShown();
    }

    @GuardedBy("ImfLock.class")
    private boolean isShowRequestedForCurrentWindow(@UserIdInt int userId) {
        final var userData = getUserData(userId);
@@ -3049,7 +3039,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
        try {
            if (DEBUG) Slog.v(TAG, "Client requesting input be shown");
            if (Flags.refactorInsetsController()) {
                boolean wasVisible = isInputShownLocked();
                boolean wasVisible = mVisibilityStateComputer.isInputShown();
                if (userData.mImeBindingState != null
                        && userData.mImeBindingState.mFocusedWindowClient != null
                        && userData.mImeBindingState.mFocusedWindowClient.mClient != null) {
@@ -3486,7 +3476,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
        final int callingUserId = UserHandle.getUserId(uid);
        final int userId = resolveImeUserIdLocked(callingUserId);
        if (!canInteractWithImeLocked(uid, client, "hideSoftInput", statsToken, userId)) {
            if (isInputShownLocked()) {
            if (mVisibilityStateComputer.isInputShown()) {
                ImeTracker.forLogging().onFailed(
                        statsToken, ImeTracker.PHASE_SERVER_CLIENT_FOCUSED);
            } else {
@@ -3504,7 +3494,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                if (userData.mImeBindingState != null
                        && userData.mImeBindingState.mFocusedWindowClient != null
                        && userData.mImeBindingState.mFocusedWindowClient.mClient != null) {
                    boolean wasVisible = isInputShownLocked();
                    boolean wasVisible = mVisibilityStateComputer.isInputShown();
                    // TODO add windowToken to interface
                    userData.mImeBindingState.mFocusedWindowClient.mClient
                            .setImeVisibility(false, statsToken);
@@ -3566,7 +3556,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
        // TODO(b/246309664): Clean up IMMS#mImeWindowVis
        IInputMethodInvoker curMethod = bindingController.getCurMethod();
        final boolean shouldHideSoftInput = curMethod != null
                && (isInputShownLocked()
                && (mVisibilityStateComputer.isInputShown()
                || (bindingController.getImeWindowVis() & InputMethodService.IME_ACTIVE) != 0);

        mVisibilityStateComputer.requestImeVisibility(windowToken, false);
@@ -4972,7 +4962,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                        // implemented so that auxiliary subtypes will be excluded when the soft
                        // keyboard is invisible.
                        synchronized (ImfLock.class) {
                            showAuxSubtypes = isInputShownLocked();
                            showAuxSubtypes = mVisibilityStateComputer.isInputShown();
                        }
                        break;
                    case InputMethodManager.SHOW_IM_PICKER_MODE_INCLUDE_AUXILIARY_SUBTYPES: