File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
services/java/com/android/server Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -1142,6 +1142,10 @@ void unbindCurrentMethodLocked(boolean reportToClient) {
11421142 if (mCurToken != null ) {
11431143 try {
11441144 if (DEBUG ) Slog .v (TAG , "Removing window token: " + mCurToken );
1145+ if ((mImeWindowVis & InputMethodService .IME_ACTIVE ) != 0 ) {
1146+ // The current IME is shown. Hence an IME switch (transition) is happening.
1147+ mWindowManagerService .saveLastInputMethodWindowForTransition ();
1148+ }
11451149 mIWindowManager .removeWindowToken (mCurToken );
11461150 } catch (RemoteException e ) {
11471151 }
Original file line number Diff line number Diff line change @@ -3430,9 +3430,6 @@ public void removeWindowToken(IBinder token) {
34303430 synchronized (mWindowMap ) {
34313431 WindowToken wtoken = mTokenMap .remove (token );
34323432 if (wtoken != null ) {
3433- if (wtoken .windowType == TYPE_INPUT_METHOD && mInputMethodWindow != null ) {
3434- mPolicy .setLastInputMethodWindowLw (mInputMethodWindow , mInputMethodTarget );
3435- }
34363433 boolean delayed = false ;
34373434 if (!wtoken .hidden ) {
34383435 wtoken .hidden = true ;
@@ -9269,6 +9266,15 @@ boolean removeFakeWindowLocked(FakeWindow window) {
92699266 }
92709267 }
92719268
9269+ // It is assumed that this method is called only by InputMethodManagerService.
9270+ public void saveLastInputMethodWindowForTransition () {
9271+ synchronized (mWindowMap ) {
9272+ if (mInputMethodWindow != null ) {
9273+ mPolicy .setLastInputMethodWindowLw (mInputMethodWindow , mInputMethodTarget );
9274+ }
9275+ }
9276+ }
9277+
92729278 @ Override
92739279 public boolean hasNavigationBar () {
92749280 return mPolicy .hasNavigationBar ();
You can’t perform that action at this time.
0 commit comments