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

Commit e9122826 authored by Felix Stern's avatar Felix Stern Committed by Android (Google) Code Review
Browse files

Revert "Redirecting hide call from IMMS to client"

This reverts commit 9a302201.

Reason for revert: b/405107176

Change-Id: I37bbe94bdec7cd77fcb46319237be84ab70194bb
parent 9a302201
Loading
Loading
Loading
Loading
+9 −30
Original line number Diff line number Diff line
@@ -1826,14 +1826,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
            @NonNull UserData userData) {
        final int userId = userData.mUserId;
        if (userData.mCurClient == client) {
            if (Flags.refactorInsetsController()) {
                final var statsToken = createStatsTokenForFocusedClient(false /* show */,
                        SoftInputShowHideReason.HIDE_REMOVE_CLIENT, userId);
                setImeVisibilityOnFocusedWindowClient(false, userData, statsToken);
            } else {
            hideCurrentInputLocked(userData.mImeBindingState.mFocusedWindow, 0 /* flags */,
                    SoftInputShowHideReason.HIDE_REMOVE_CLIENT, userId);
            }
            if (userData.mBoundToMethod) {
                userData.mBoundToMethod = false;
                final var userBindingController = userData.mBindingController;
@@ -2103,14 +2097,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
        }

        if (visibilityStateComputer.getImePolicy().isImeHiddenByDisplayPolicy()) {
            if (Flags.refactorInsetsController()) {
                final var statsToken = createStatsTokenForFocusedClient(false /* show */,
                        SoftInputShowHideReason.HIDE_DISPLAY_IME_POLICY_HIDE, userId);
                setImeVisibilityOnFocusedWindowClient(false, userData, statsToken);
            } else {
            hideCurrentInputLocked(userData.mImeBindingState.mFocusedWindow, 0 /* flags */,
                    SoftInputShowHideReason.HIDE_DISPLAY_IME_POLICY_HIDE, userId);
            }
            return InputBindResult.NO_IME;
        }

@@ -3867,17 +3855,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                        Slog.w(TAG, "If you need to impersonate a foreground user/profile from"
                                + " a background user, use EditorInfo.targetInputMethodUser with"
                                + " INTERACT_ACROSS_USERS_FULL permission.");

                        if (Flags.refactorInsetsController()) {
                            final var statsToken = createStatsTokenForFocusedClient(
                                    false /* show */, SoftInputShowHideReason.HIDE_INVALID_USER,
                                    userId);
                            setImeVisibilityOnFocusedWindowClient(false, userData, statsToken);
                        } else {
                        hideCurrentInputLocked(userData.mImeBindingState.mFocusedWindow,
                                    0 /* flags */, SoftInputShowHideReason.HIDE_INVALID_USER,
                                    userId);
                        }
                                0 /* flags */, SoftInputShowHideReason.HIDE_INVALID_USER, userId);
                        return InputBindResult.INVALID_USER;
                    }

@@ -5014,6 +4993,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                        setImeVisibilityOnFocusedWindowClient(false, userData,
                                null /* TODO(b/353463205) check statsToken */);
                    } else {

                        hideCurrentInputLocked(userData.mImeBindingState.mFocusedWindow,
                                0 /* flags */, reason, userId);
                    }
@@ -6708,9 +6688,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                    final InputMethodSettings settings = InputMethodSettingsRepository.get(userId);
                    final var userData = getUserData(userId);
                    if (Flags.refactorInsetsController()) {
                        final var statsToken = createStatsTokenForFocusedClient(false /* show */,
                                SoftInputShowHideReason.HIDE_RESET_SHELL_COMMAND, userId);
                        setImeVisibilityOnFocusedWindowClient(false, userData, statsToken);
                        setImeVisibilityOnFocusedWindowClient(false, userData,
                                null /* TODO(b329229469) initialize statsToken here? */);
                    } else {
                        hideCurrentInputLocked(userData.mImeBindingState.mFocusedWindow,
                                0 /* flags */,