diff options
3 files changed, 13 insertions, 6 deletions
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index 2bb2b7b21cce..f0fb33eaaee7 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -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, " "); diff --git a/services/core/java/com/android/server/inputmethod/SoftInputShowHideHistory.java b/services/core/java/com/android/server/inputmethod/SoftInputShowHideHistory.java index 3023603dc437..84456327526a 100644 --- a/services/core/java/com/android/server/inputmethod/SoftInputShowHideHistory.java +++ b/services/core/java/com/android/server/inputmethod/SoftInputShowHideHistory.java @@ -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)) diff --git a/services/tests/InputMethodSystemServerTests/src/com/android/server/inputmethod/InputMethodManagerServiceTests.java b/services/tests/InputMethodSystemServerTests/src/com/android/server/inputmethod/InputMethodManagerServiceTests.java index e5d315358df6..72cbac331551 100644 --- a/services/tests/InputMethodSystemServerTests/src/com/android/server/inputmethod/InputMethodManagerServiceTests.java +++ b/services/tests/InputMethodSystemServerTests/src/com/android/server/inputmethod/InputMethodManagerServiceTests.java @@ -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 */); |