Loading services/core/java/com/android/server/wm/DisplayContent.java +9 −1 Original line number Diff line number Diff line Loading @@ -3374,6 +3374,14 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp mUpdateImeTarget = updateImeTarget; WindowState target = getWindow(mComputeImeTargetPredicate); // Keeps the IME target with the last window while swiping up to recents to prevent // flickering due to IME hide animation on top of recents. // TODO(b/166736352): This logic should go away once we switch over target immediately // and do the screenshot to preserve IME on disappearing target if (target != null && curTarget != null && target.isActivityTypeHome() && curTarget.getInsetsState().getSource(ITYPE_IME).isVisible()) { return curTarget; } // Yet more tricksyness! If this window is a "starting" window, we do actually want // to be on top of it, but it is not -really- where input will go. So look down below Loading Loading @@ -3546,7 +3554,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp ); } private void updateImeParent() { void updateImeParent() { final SurfaceControl newParent = computeImeParent(); if (newParent != null) { getPendingTransaction().reparent(mImeWindowsContainers.mSurfaceControl, newParent); Loading services/core/java/com/android/server/wm/RecentsAnimationController.java +14 −0 Original line number Diff line number Diff line Loading @@ -283,6 +283,20 @@ public class RecentsAnimationController implements DeathRecipient { public void hideCurrentInputMethod() { final long token = Binder.clearCallingIdentity(); try { synchronized (mService.getWindowManagerLock()) { // Make sure to update the correct IME parent in case that the IME parent may // be computed as display layer when re-layout window happens during rotation // but there is intermediate state that the bounds of task and the IME // target's activity is not the same during rotating. mDisplayContent.updateImeParent(); // Ignore hiding IME if IME window is attached to app. // Since we would like to snapshot Task with IME window while transitioning // to recents. if (mDisplayContent.isImeAttachedToApp()) { return; } } final InputMethodManagerInternal inputMethodManagerInternal = LocalServices.getService(InputMethodManagerInternal.class); if (inputMethodManagerInternal != null) { Loading services/core/java/com/android/server/wm/TaskSnapshotController.java +2 −1 Original line number Diff line number Diff line Loading @@ -368,7 +368,8 @@ class TaskSnapshotController { SurfaceControl[] excludeLayers; final WindowState imeWindow = task.getDisplayContent().mInputMethodWindow; if (imeWindow != null) { // Exclude IME window snapshot when IME isn't proper to attach to app. if (imeWindow != null && !task.getDisplayContent().isImeAttachedToApp()) { excludeLayers = new SurfaceControl[1]; excludeLayers[0] = imeWindow.getSurfaceControl(); } else { Loading Loading
services/core/java/com/android/server/wm/DisplayContent.java +9 −1 Original line number Diff line number Diff line Loading @@ -3374,6 +3374,14 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp mUpdateImeTarget = updateImeTarget; WindowState target = getWindow(mComputeImeTargetPredicate); // Keeps the IME target with the last window while swiping up to recents to prevent // flickering due to IME hide animation on top of recents. // TODO(b/166736352): This logic should go away once we switch over target immediately // and do the screenshot to preserve IME on disappearing target if (target != null && curTarget != null && target.isActivityTypeHome() && curTarget.getInsetsState().getSource(ITYPE_IME).isVisible()) { return curTarget; } // Yet more tricksyness! If this window is a "starting" window, we do actually want // to be on top of it, but it is not -really- where input will go. So look down below Loading Loading @@ -3546,7 +3554,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp ); } private void updateImeParent() { void updateImeParent() { final SurfaceControl newParent = computeImeParent(); if (newParent != null) { getPendingTransaction().reparent(mImeWindowsContainers.mSurfaceControl, newParent); Loading
services/core/java/com/android/server/wm/RecentsAnimationController.java +14 −0 Original line number Diff line number Diff line Loading @@ -283,6 +283,20 @@ public class RecentsAnimationController implements DeathRecipient { public void hideCurrentInputMethod() { final long token = Binder.clearCallingIdentity(); try { synchronized (mService.getWindowManagerLock()) { // Make sure to update the correct IME parent in case that the IME parent may // be computed as display layer when re-layout window happens during rotation // but there is intermediate state that the bounds of task and the IME // target's activity is not the same during rotating. mDisplayContent.updateImeParent(); // Ignore hiding IME if IME window is attached to app. // Since we would like to snapshot Task with IME window while transitioning // to recents. if (mDisplayContent.isImeAttachedToApp()) { return; } } final InputMethodManagerInternal inputMethodManagerInternal = LocalServices.getService(InputMethodManagerInternal.class); if (inputMethodManagerInternal != null) { Loading
services/core/java/com/android/server/wm/TaskSnapshotController.java +2 −1 Original line number Diff line number Diff line Loading @@ -368,7 +368,8 @@ class TaskSnapshotController { SurfaceControl[] excludeLayers; final WindowState imeWindow = task.getDisplayContent().mInputMethodWindow; if (imeWindow != null) { // Exclude IME window snapshot when IME isn't proper to attach to app. if (imeWindow != null && !task.getDisplayContent().isImeAttachedToApp()) { excludeLayers = new SurfaceControl[1]; excludeLayers[0] = imeWindow.getSurfaceControl(); } else { Loading