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

Commit 0694a3cf authored by Antonio Kantek's avatar Antonio Kantek Committed by Android (Google) Code Review
Browse files

Merge "Bind userId with ImeBindingState" into main

parents be819304 21f20ab0
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -21,7 +21,9 @@ import static android.server.inputmethod.InputMethodManagerServiceProto.CUR_FOCU
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED;

import android.annotation.Nullable;
import android.annotation.UserIdInt;
import android.os.IBinder;
import android.os.UserHandle;
import android.util.Printer;
import android.util.proto.ProtoOutputStream;
import android.view.WindowManager;
@@ -36,6 +38,9 @@ import com.android.server.wm.WindowManagerInternal;
 */
final class ImeBindingState {

    @UserIdInt
    final int mUserId;

    /**
     * The last window token that we confirmed to be focused.  This is always updated upon
     * reports from the input method client. If the window state is already changed before the
@@ -90,6 +95,7 @@ final class ImeBindingState {

    static ImeBindingState newEmptyState() {
        return new ImeBindingState(
                /*userId=*/ UserHandle.USER_NULL,
                /*focusedWindow=*/ null,
                /*focusedWindowSoftInputMode=*/ SOFT_INPUT_STATE_UNSPECIFIED,
                /*focusedWindowClient=*/ null,
@@ -97,10 +103,12 @@ final class ImeBindingState {
        );
    }

    ImeBindingState(@Nullable IBinder focusedWindow,
    ImeBindingState(@UserIdInt int userId,
            @Nullable IBinder focusedWindow,
            @SoftInputModeFlags int focusedWindowSoftInputMode,
            @Nullable ClientState focusedWindowClient,
            @Nullable EditorInfo focusedWindowEditorInfo) {
        mUserId = userId;
        mFocusedWindow = focusedWindow;
        mFocusedWindowSoftInputMode = focusedWindowSoftInputMode;
        mFocusedWindowClient = focusedWindowClient;
+2 −1
Original line number Diff line number Diff line
@@ -3712,7 +3712,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                    null, null, null, null, -1, false);
        }

        mImeBindingState = new ImeBindingState(windowToken, softInputMode, cs, editorInfo);
        mImeBindingState = new ImeBindingState(userData.mUserId, windowToken, softInputMode, cs,
                editorInfo);
        mFocusedWindowPerceptible.put(windowToken, true);

        // We want to start input before showing the IME, but after closing