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

Commit 24f7bdda authored by Antonio Kantek's avatar Antonio Kantek
Browse files

Pass UserData to startInputOrWindowGainedFocusInternalLocked

This CL represents an internal refactoring and shouldn't introduce any
observable breakage.

Bug: 325515685
Test: atest CtsInputMethodTestCases

Change-Id: I943123dea956db1388eb26c562c3b1008da2ea03
parent 8916586b
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -3687,7 +3687,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                    result = startInputOrWindowGainedFocusInternalLocked(startInputReason,
                            client, windowToken, startInputFlags, softInputMode, windowFlags,
                            editorInfo, inputConnection, remoteAccessibilityInputConnection,
                            unverifiedTargetSdkVersion, userId, imeDispatcher, cs);
                            unverifiedTargetSdkVersion, userData, imeDispatcher, cs);
                } finally {
                    Binder.restoreCallingIdentity(ident);
                }
@@ -3715,7 +3715,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
            @SoftInputModeFlags int softInputMode, int windowFlags, EditorInfo editorInfo,
            IRemoteInputConnection inputContext,
            @Nullable IRemoteAccessibilityInputConnection remoteAccessibilityInputConnection,
            int unverifiedTargetSdkVersion, @UserIdInt int userId,
            int unverifiedTargetSdkVersion, @NonNull UserDataRepository.UserData userData,
            @NonNull ImeOnBackInvokedDispatcher imeDispatcher, @NonNull ClientState cs) {
        if (DEBUG) {
            Slog.v(TAG, "startInputOrWindowGainedFocusInternalLocked: reason="
@@ -3728,7 +3728,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                    + " softInputMode=" + InputMethodDebug.softInputModeToString(softInputMode)
                    + " windowFlags=#" + Integer.toHexString(windowFlags)
                    + " unverifiedTargetSdkVersion=" + unverifiedTargetSdkVersion
                    + " userId=" + userId
                    + " userData=" + userData
                    + " imeDispatcher=" + imeDispatcher
                    + " cs=" + cs);
        }
@@ -3747,7 +3747,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                startInputByWinGainedFocus, toolType);
        mVisibilityStateComputer.setWindowState(windowToken, windowState);

        final var userData = mUserDataRepository.getOrCreate(userId);
        if (sameWindowFocused && isTextEditor) {
            if (DEBUG) {
                Slog.w(TAG, "Window already focused, ignoring focus gain of: " + client
+5 −0
Original line number Diff line number Diff line
@@ -96,5 +96,10 @@ final class UserDataRepository {
            mUserId = userId;
            mBindingController = bindingController;
        }

        @Override
        public String toString() {
            return "UserData{" + "mUserId=" + mUserId + '}';
        }
    }
}