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

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

Merge "Make SoftInputShowHideHistory multi-user aware" into main

parents d2ab4c59 1e5fdecf
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -4799,7 +4799,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
                userData.mImeBindingState.mFocusedWindowEditorInfo,
                info.focusedWindowName, userData.mImeBindingState.mFocusedWindowSoftInputMode,
                reason, userData.mInFullscreenMode, info.requestWindowName,
                info.imeControlTargetName, info.imeLayerTargetName, info.imeSurfaceParentName));
                info.imeControlTargetName, info.imeLayerTargetName, info.imeSurfaceParentName,
                userId));

        if (statsToken != null) {
            mImeTrackerService.onImmsUpdate(statsToken, info.requestWindowName);
@@ -6132,8 +6133,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
            dumpAsStringNoCheckForUser(userData, fd, pw, args, isCritical);
        }

        // TODO(b/365868861): Make StartInputHistory, SoftInputShowHideHistory and ImeTracker per
        //  user.
        // TODO(b/365868861): Make StartInputHistory and ImeTracker multi-user aware.
        synchronized (ImfLock.class) {
            p.println("  mStartInputHistory:");
            mStartInputHistory.dump(pw, "    ");
+7 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.server.inputmethod;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.UserIdInt;
import android.os.SystemClock;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
@@ -62,6 +63,8 @@ final class SoftInputShowHideHistory {
        final String mImeTargetNameFromWm;
        @Nullable
        final String mImeSurfaceParentName;
        @UserIdInt
        final int mImeUserId;

        Entry(ClientState client, EditorInfo editorInfo,
                String focusedWindowName,
@@ -69,7 +72,7 @@ final class SoftInputShowHideHistory {
                @SoftInputShowHideReason int reason,
                boolean inFullscreenMode, String requestWindowName,
                @Nullable String imeControlTargetName, @Nullable String imeTargetName,
                @Nullable String imeSurfaceParentName) {
                @Nullable String imeSurfaceParentName, @UserIdInt int imeUserId) {
            mClientState = client;
            mEditorInfo = editorInfo;
            mFocusedWindowName = focusedWindowName;
@@ -82,6 +85,7 @@ final class SoftInputShowHideHistory {
            mImeControlTargetName = imeControlTargetName;
            mImeTargetNameFromWm = imeTargetName;
            mImeSurfaceParentName = imeSurfaceParentName;
            mImeUserId = imeUserId;
        }
    }

@@ -102,7 +106,8 @@ final class SoftInputShowHideHistory {
                continue;
            }
            pw.print(prefix);
            pw.println("SoftInputShowHide #" + entry.mSequenceNumber + ":");
            pw.println("SoftInputShowHide[" + entry.mImeUserId + "] #"
                    + entry.mSequenceNumber + ":");

            pw.print(prefix);
            pw.println("  time=" + formatter.format(Instant.ofEpochMilli(entry.mWallTime))
+3 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import java.io.StringWriter;
public final class InputMethodManagerServiceTests {
    static final int SYSTEM_DECORATION_SUPPORT_DISPLAY_ID = 2;
    static final int NO_SYSTEM_DECORATION_SUPPORT_DISPLAY_ID = 3;
    private static final int TEST_IME_USER_ID = 1;

    static InputMethodManagerService.ImeDisplayValidator sChecker =
            (displayId) -> {
@@ -102,7 +103,8 @@ public final class InputMethodManagerServiceTests {
                null,
                null,
                null,
                null));
                null,
                TEST_IME_USER_ID));

        history.dump(new PrintWriter(writer), "" /* prefix */);