diff options
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowManagerService.java | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 2ed09ae2daf3..ee128c7abe7f 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -7411,32 +7411,32 @@ public class WindowManagerService extends IWindowManager.Stub } } - public boolean inputMethodClientHasFocus(IInputMethodClient client) { - boolean hasFocus; - synchronized (mWindowMap) { - // Check all displays if any input method window has focus. - for (int i = mRoot.mChildren.size() - 1; i >= 0; --i) { - final DisplayContent displayContent = mRoot.mChildren.get(i); - if (displayContent.inputMethodClientHasFocus(client)) { - return true; + @Override + public boolean inputMethodClientHasFocus(IInputMethodClient client) { + synchronized (mWindowMap) { + // Check all displays if any input method window has focus. + for (int i = mRoot.mChildren.size() - 1; i >= 0; --i) { + final DisplayContent displayContent = mRoot.mChildren.get(i); + if (displayContent.inputMethodClientHasFocus(client)) { + return true; + } } - } - // Okay, how about this... what is the current focus? - // It seems in some cases we may not have moved the IM - // target window, such as when it was in a pop-up window, - // so let's also look at the current focus. (An example: - // go to Gmail, start searching so the keyboard goes up, - // press home. Sometimes the IME won't go down.) - // Would be nice to fix this more correctly, but it's - // way at the end of a release, and this should be good enough. - if (mCurrentFocus != null && mCurrentFocus.mSession.mClient != null - && mCurrentFocus.mSession.mClient.asBinder() == client.asBinder()) { - return true; + // Okay, how about this... what is the current focus? + // It seems in some cases we may not have moved the IM + // target window, such as when it was in a pop-up window, + // so let's also look at the current focus. (An example: + // go to Gmail, start searching so the keyboard goes up, + // press home. Sometimes the IME won't go down.) + // Would be nice to fix this more correctly, but it's + // way at the end of a release, and this should be good enough. + if (mCurrentFocus != null && mCurrentFocus.mSession.mClient != null + && mCurrentFocus.mSession.mClient.asBinder() == client.asBinder()) { + return true; + } } + return false; } - return false; - } @Override public int getDisplayIdForWindow(IBinder windowToken) { |