summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yabin Huang <yabinh@google.com> 2023-12-18 18:49:33 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-12-18 18:49:33 +0000
commit1c668cf2b32c7bb5b642a8ca91a4b5e4d17fc7d8 (patch)
treed5e57891e6a7942b1f04ac7f8438a4d98a5f5a6d
parent8cae90d72aff475764081d06d0fdb80a30d3dfb4 (diff)
parent0c09232b01bf093b57665cca22f9d98ddac0581c (diff)
Merge "Update IMMI#onImeParentChanged() to take the display ID" into main
-rw-r--r--services/core/java/com/android/server/inputmethod/InputMethodManagerInternal.java6
-rw-r--r--services/core/java/com/android/server/inputmethod/InputMethodManagerService.java2
-rw-r--r--services/core/java/com/android/server/wm/DisplayContent.java3
3 files changed, 7 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerInternal.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerInternal.java
index 548945598a41..dda50cab2cdd 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerInternal.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerInternal.java
@@ -167,8 +167,10 @@ public abstract class InputMethodManagerInternal {
/**
* Indicates that the IME window has re-parented to the new target when the IME control changed.
+ *
+ * @param displayId the display hosting the IME window
*/
- public abstract void onImeParentChanged();
+ public abstract void onImeParentChanged(int displayId);
/**
* Destroys the IME surface for the given display.
@@ -300,7 +302,7 @@ public abstract class InputMethodManagerInternal {
}
@Override
- public void onImeParentChanged() {
+ public void onImeParentChanged(int displayId) {
}
@Override
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
index c3eb51952141..0d29b7dca8d4 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -5671,7 +5671,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
}
@Override
- public void onImeParentChanged() {
+ public void onImeParentChanged(int displayId) {
synchronized (ImfLock.class) {
// Hide the IME method menu only when the IME surface parent is changed by the
// input target changed, in case seeing the dialog dismiss flickering during
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index ba22763dd289..c98280e30242 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -4794,7 +4794,8 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
assignRelativeLayerForIme(getSyncTransaction(), true /* forceUpdate */);
scheduleAnimation();
- mWmService.mH.post(() -> InputMethodManagerInternal.get().onImeParentChanged());
+ mWmService.mH.post(
+ () -> InputMethodManagerInternal.get().onImeParentChanged(getDisplayId()));
} else if (mImeControlTarget != null && mImeControlTarget == mImeLayeringTarget) {
// Even if the IME surface parent is not changed, the layer target belonging to the
// parent may have changes. Then attempt to reassign if the IME control target is