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

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

Merge "Propagate userId to IMMS#finishSessionLocked()" into main

parents afa8171d 318f0feb
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -474,6 +474,9 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
        IInputMethodSession mSession;
        InputChannel mChannel;

        @UserIdInt
        final int mUserId;

        @Override
        public String toString() {
            return "SessionState{uid=" + mClient.mUid + " pid=" + mClient.mPid
@@ -482,15 +485,17 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                    + " session=" + Integer.toHexString(
                    System.identityHashCode(mSession))
                    + " channel=" + mChannel
                    + " userId=" + mUserId
                    + "}";
        }

        SessionState(ClientState client, IInputMethodInvoker method,
                IInputMethodSession session, InputChannel channel) {
                IInputMethodSession session, InputChannel channel, @UserIdInt int userId) {
            mClient = client;
            mMethod = method;
            mSession = session;
            mChannel = channel;
            mUserId = userId;
        }
    }

@@ -2349,7 +2354,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                    if (userData.mCurClient != null) {
                        clearClientSessionLocked(userData.mCurClient);
                        userData.mCurClient.mCurSession = new SessionState(
                                userData.mCurClient, method, session, channel);
                                userData.mCurClient, method, session, channel, userId);
                        InputBindResult res = attachNewInputLocked(
                                StartInputReason.SESSION_CREATED_BY_IME, true, userId);
                        attachNewAccessibilityLocked(StartInputReason.SESSION_CREATED_BY_IME, true,
@@ -2490,9 +2495,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                    sessionState.mSession.finishSession();
                } catch (RemoteException e) {
                    Slog.w(TAG, "Session failed to close due to remote exception", e);
                    // TODO(b/350386877): Propagate userId from the caller or infer it from
                    //  sessionState
                    final int userId = mCurrentUserId;
                    final int userId = sessionState.mUserId;
                    final var bindingController = getInputMethodBindingController(userId);
                    updateSystemUiLocked(0 /* vis */, bindingController.getBackDisposition(),
                            userId);
+1 −1
Original line number Diff line number Diff line
@@ -348,7 +348,7 @@ public class InputMethodManagerServiceTestBase {
            ClientState cs = mInputMethodManagerService.getClientStateLocked(client);
            cs.mCurSession = new InputMethodManagerService.SessionState(cs,
                    mMockInputMethodInvoker, mMockInputMethodSession, mock(
                    InputChannel.class));
                    InputChannel.class), mCallingUserId);
        }
    }
}