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

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

Merge "Inline IMMS#hasAttachedClient() with making it multi-user aware" into main

parents 7dd90db2 930e5d77
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -172,6 +172,7 @@ final class DefaultImeVisibilityApplier {
            @ImeVisibilityStateComputer.VisibilityState int state,
            @SoftInputShowHideReason int reason, @UserIdInt int userId) {
        final var bindingController = mService.getInputMethodBindingController(userId);
        final var userData = mService.getUserData(userId);
        final int displayIdToShowIme = bindingController.getDisplayIdToShowIme();
        switch (state) {
            case STATE_SHOW_IME:
@@ -184,7 +185,7 @@ final class DefaultImeVisibilityApplier {
                break;
            case STATE_HIDE_IME:
                if (!Flags.refactorInsetsController()) {
                    if (mService.hasAttachedClient()) {
                    if (userData.mCurClient != null) {
                        ImeTracker.forLogging().onProgress(statsToken,
                                ImeTracker.PHASE_SERVER_APPLY_IME_VISIBILITY);
                        // IMMS only knows of focused window, not the actual IME target.
+0 −9
Original line number Diff line number Diff line
@@ -1856,15 +1856,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
        }
    }

    /**
     * {@code true} when a {@link ClientState} has attached from starting the
     * input connection.
     */
    @GuardedBy("ImfLock.class")
    boolean hasAttachedClient() {
        return getUserData(mCurrentUserId).mCurClient != null;
    }

    @VisibleForTesting
    void setAttachedClientForTesting(@NonNull ClientState cs) {
        synchronized (ImfLock.class) {