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

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

Merge "Revert "Redirecting hide call from IMMS to client"" into main

parents 83232dd0 e9122826
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);
                    }
@@ -6709,9 +6689,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 */,