From 1ee99c4627eeae1a94ada9a884a76b726cf6ca4c Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Tue, 10 Jun 2014 19:07:31 +0900 Subject: [PATCH] Show IME-related system IME dialogs over windows owned by the IME The IME-related system dialogs should be placed over any window owned by the current IME. However, the framework has taken only the main window of the current IME has been taken into account. As a result, the system has not been able to show its IME-related dialog properly layer when the IME is showing its own dialog. This CL addresses the above issue. BUG: 5809660 Change-Id: I205321c7ed42516f36a4bf29dd6a159ac34fd5ec --- .../com/android/server/wm/WindowManagerService.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 2d15dabfef373..8e53a434a2a56 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -1487,10 +1487,15 @@ public class WindowManagerService extends IWindowManager.Stub if (pos >= 0) { final AppWindowToken targetAppToken = mInputMethodTarget.mAppToken; - if (pos < windows.size()) { - WindowState wp = windows.get(pos); - if (wp == mInputMethodWindow) { - pos++; + // Skip windows owned by the input method. + if (mInputMethodWindow != null) { + while (pos < windows.size()) { + WindowState wp = windows.get(pos); + if (wp == mInputMethodWindow || wp.mAttachedWindow == mInputMethodWindow) { + pos++; + continue; + } + break; } } if (DEBUG_INPUT_METHOD) Slog.v(TAG, "Adding " + N + " dialogs at pos=" + pos);