summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--services/java/com/android/server/InputMethodManagerService.java4
-rwxr-xr-xservices/java/com/android/server/wm/WindowManagerService.java12
2 files changed, 13 insertions, 3 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index 47b8352..a49ccf7 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -1142,6 +1142,10 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
if (mCurToken != null) {
try {
if (DEBUG) Slog.v(TAG, "Removing window token: " + mCurToken);
+ if ((mImeWindowVis & InputMethodService.IME_ACTIVE) != 0) {
+ // The current IME is shown. Hence an IME switch (transition) is happening.
+ mWindowManagerService.saveLastInputMethodWindowForTransition();
+ }
mIWindowManager.removeWindowToken(mCurToken);
} catch (RemoteException e) {
}
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 204a6cd..7687852 100755
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -3430,9 +3430,6 @@ public class WindowManagerService extends IWindowManager.Stub
synchronized(mWindowMap) {
WindowToken wtoken = mTokenMap.remove(token);
if (wtoken != null) {
- if (wtoken.windowType == TYPE_INPUT_METHOD && mInputMethodWindow != null) {
- mPolicy.setLastInputMethodWindowLw(mInputMethodWindow, mInputMethodTarget);
- }
boolean delayed = false;
if (!wtoken.hidden) {
wtoken.hidden = true;
@@ -9269,6 +9266,15 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
+ // It is assumed that this method is called only by InputMethodManagerService.
+ public void saveLastInputMethodWindowForTransition() {
+ synchronized (mWindowMap) {
+ if (mInputMethodWindow != null) {
+ mPolicy.setLastInputMethodWindowLw(mInputMethodWindow, mInputMethodTarget);
+ }
+ }
+ }
+
@Override
public boolean hasNavigationBar() {
return mPolicy.hasNavigationBar();