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

Commit 1ec9394c authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Let IMMI#transferTouchFocusToImeWindow() take userId

RemoteInlineSuggestionViewConnector is already a per-user instance,
but when it gets call back

  InputMethodManagerInternal#transferTouchFocusToImeWindow

the user ID has not been propagated.

As a preparation to make the following instance fields per-user, this
CL makes it take the user ID as an explicit parameter.

The user ID is not yet used in this CL thus there must be no
observable behavior change.

Bug: 305829876
Bug: 339358344
Test: presubmit
Change-Id: Idf0cdd3cd56701a4343c6f4faa954605f03e4f31
parent b7602777
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ final class RemoteInlineSuggestionViewConnector {
        final InputMethodManagerInternal inputMethodManagerInternal =
                LocalServices.getService(InputMethodManagerInternal.class);
        if (!inputMethodManagerInternal.transferTouchFocusToImeWindow(sourceInputToken,
                displayId)) {
                displayId, mUserId)) {
            Slog.e(TAG, "Cannot transfer touch focus from suggestion to IME");
            mOnErrorCallback.run();
        }
+3 −2
Original line number Diff line number Diff line
@@ -150,10 +150,11 @@ public abstract class InputMethodManagerInternal {
     *
     * @param sourceInputToken the source token.
     * @param displayId        the display hosting the IME window
     * @param userId           the user ID this request is about
     * @return {@code true} if the transfer is successful
     */
    public abstract boolean transferTouchFocusToImeWindow(@NonNull IBinder sourceInputToken,
            int displayId);
            int displayId, @UserIdInt int userId);

    /**
     * Reports that IME control has transferred to the given window token, or if null that
@@ -287,7 +288,7 @@ public abstract class InputMethodManagerInternal {

                @Override
                public boolean transferTouchFocusToImeWindow(@NonNull IBinder sourceInputToken,
                        int displayId) {
                        int displayId, @UserIdInt int userId) {
                    return false;
                }

+1 −1
Original line number Diff line number Diff line
@@ -5625,7 +5625,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.

        @Override
        public boolean transferTouchFocusToImeWindow(@NonNull IBinder sourceInputToken,
                int displayId) {
                int displayId, @UserIdInt int userId) {
            //TODO(b/150843766): Check if Input Token is valid.
            final IBinder curHostInputToken;
            synchronized (ImfLock.class) {