Loading core/java/android/view/inputmethod/InputMethodManagerInternal.java +5 −0 Original line number Diff line number Diff line Loading @@ -32,4 +32,9 @@ public interface InputMethodManagerInternal { * Called by the window manager to let the input method manager rotate the input method. */ void switchInputMethod(boolean forwardDirection); /** * Hides the current input method, if visible. */ void hideCurrentInputMethod(); } services/core/java/com/android/server/InputMethodManagerService.java +12 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub static final int MSG_BIND_INPUT = 1010; static final int MSG_SHOW_SOFT_INPUT = 1020; static final int MSG_HIDE_SOFT_INPUT = 1030; static final int MSG_HIDE_CURRENT_INPUT_METHOD = 1035; static final int MSG_ATTACH_TOKEN = 1040; static final int MSG_CREATE_SESSION = 1050; Loading Loading @@ -2846,6 +2847,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } args.recycle(); return true; case MSG_HIDE_CURRENT_INPUT_METHOD: synchronized (mMethodMap) { hideCurrentInputLocked(0, null); } return true; case MSG_ATTACH_TOKEN: args = (SomeArgs)msg.obj; try { Loading Loading @@ -3880,6 +3886,12 @@ public class InputMethodManagerService extends IInputMethodManager.Stub mHandler.sendMessage(mHandler.obtainMessage(MSG_SWITCH_IME, forwardDirection ? 1 : 0, 0)); } @Override public void hideCurrentInputMethod() { mHandler.removeMessages(MSG_HIDE_CURRENT_INPUT_METHOD); mHandler.sendEmptyMessage(MSG_HIDE_CURRENT_INPUT_METHOD); } } private static String imeWindowStatusToString(final int imeWindowVis) { Loading services/core/java/com/android/server/wm/DockedStackDividerController.java +32 −1 Original line number Diff line number Diff line Loading @@ -45,9 +45,11 @@ import android.view.SurfaceControl; import android.view.animation.AnimationUtils; import android.view.animation.Interpolator; import android.view.animation.PathInterpolator; import android.view.inputmethod.InputMethodManagerInternal; import com.android.internal.policy.DividerSnapAlgorithm; import com.android.internal.policy.DockedDividerUtils; import com.android.server.LocalServices; import com.android.server.wm.DimLayer.DimLayerUser; import com.android.server.wm.WindowManagerService.H; Loading Loading @@ -131,6 +133,7 @@ public class DockedStackDividerController implements DimLayerUser { private float mLastAnimationProgress; private float mLastDividerProgress; private final DividerSnapAlgorithm[] mSnapAlgorithmForRotation = new DividerSnapAlgorithm[4]; private boolean mImeHideRequested; DockedStackDividerController(WindowManagerService service, DisplayContent displayContent) { mService = service; Loading Loading @@ -375,11 +378,39 @@ public class DockedStackDividerController implements DimLayerUser { } } mDockedStackListeners.finishBroadcast(); if (!exists) { if (exists) { InputMethodManagerInternal inputMethodManagerInternal = LocalServices.getService(InputMethodManagerInternal.class); if (inputMethodManagerInternal != null) { // Hide the current IME to avoid problems with animations from IME adjustment when // attaching the docked stack. inputMethodManagerInternal.hideCurrentInputMethod(); mImeHideRequested = true; } } else { setMinimizedDockedStack(false); } } /** * Resets the state that IME hide has been requested. See {@link #isImeHideRequested}. */ void resetImeHideRequested() { mImeHideRequested = false; } /** * The docked stack divider controller makes sure the IME gets hidden when attaching the docked * stack, to avoid animation problems. This flag indicates whether the request to hide the IME * has been sent in an asynchronous manner, and the IME should be treated as hidden already. * * @return whether IME hide request has been sent */ boolean isImeHideRequested() { return mImeHideRequested; } void notifyDockedStackMinimizedChanged(boolean minimizedDock, long animDuration) { mService.mH.removeMessages(NOTIFY_DOCKED_STACK_MINIMIZED_CHANGED); mService.mH.obtainMessage(NOTIFY_DOCKED_STACK_MINIMIZED_CHANGED, Loading services/core/java/com/android/server/wm/WindowManagerService.java +2 −1 Original line number Diff line number Diff line Loading @@ -7596,7 +7596,8 @@ public class WindowManagerService extends IWindowManager.Stub void adjustForImeIfNeeded(final DisplayContent displayContent) { final WindowState imeWin = mInputMethodWindow; final boolean imeVisible = imeWin != null && imeWin.isVisibleLw() && imeWin.isDisplayedLw(); final boolean imeVisible = imeWin != null && imeWin.isVisibleLw() && imeWin.isDisplayedLw() && !displayContent.mDividerControllerLocked.isImeHideRequested(); final boolean dockVisible = isStackVisibleLocked(DOCKED_STACK_ID); final TaskStack imeTargetStack = getImeFocusStackLocked(); final int imeDockSide = (dockVisible && imeTargetStack != null) ? Loading services/core/java/com/android/server/wm/WindowStateAnimator.java +4 −0 Original line number Diff line number Diff line Loading @@ -1745,6 +1745,10 @@ class WindowStateAnimator { mWin.mAppToken.onFirstWindowDrawn(mWin, this); } if (mWin.mAttrs.type == TYPE_INPUT_METHOD) { mWin.mDisplayContent.mDividerControllerLocked.resetImeHideRequested(); } return true; } return false; Loading Loading
core/java/android/view/inputmethod/InputMethodManagerInternal.java +5 −0 Original line number Diff line number Diff line Loading @@ -32,4 +32,9 @@ public interface InputMethodManagerInternal { * Called by the window manager to let the input method manager rotate the input method. */ void switchInputMethod(boolean forwardDirection); /** * Hides the current input method, if visible. */ void hideCurrentInputMethod(); }
services/core/java/com/android/server/InputMethodManagerService.java +12 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub static final int MSG_BIND_INPUT = 1010; static final int MSG_SHOW_SOFT_INPUT = 1020; static final int MSG_HIDE_SOFT_INPUT = 1030; static final int MSG_HIDE_CURRENT_INPUT_METHOD = 1035; static final int MSG_ATTACH_TOKEN = 1040; static final int MSG_CREATE_SESSION = 1050; Loading Loading @@ -2846,6 +2847,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } args.recycle(); return true; case MSG_HIDE_CURRENT_INPUT_METHOD: synchronized (mMethodMap) { hideCurrentInputLocked(0, null); } return true; case MSG_ATTACH_TOKEN: args = (SomeArgs)msg.obj; try { Loading Loading @@ -3880,6 +3886,12 @@ public class InputMethodManagerService extends IInputMethodManager.Stub mHandler.sendMessage(mHandler.obtainMessage(MSG_SWITCH_IME, forwardDirection ? 1 : 0, 0)); } @Override public void hideCurrentInputMethod() { mHandler.removeMessages(MSG_HIDE_CURRENT_INPUT_METHOD); mHandler.sendEmptyMessage(MSG_HIDE_CURRENT_INPUT_METHOD); } } private static String imeWindowStatusToString(final int imeWindowVis) { Loading
services/core/java/com/android/server/wm/DockedStackDividerController.java +32 −1 Original line number Diff line number Diff line Loading @@ -45,9 +45,11 @@ import android.view.SurfaceControl; import android.view.animation.AnimationUtils; import android.view.animation.Interpolator; import android.view.animation.PathInterpolator; import android.view.inputmethod.InputMethodManagerInternal; import com.android.internal.policy.DividerSnapAlgorithm; import com.android.internal.policy.DockedDividerUtils; import com.android.server.LocalServices; import com.android.server.wm.DimLayer.DimLayerUser; import com.android.server.wm.WindowManagerService.H; Loading Loading @@ -131,6 +133,7 @@ public class DockedStackDividerController implements DimLayerUser { private float mLastAnimationProgress; private float mLastDividerProgress; private final DividerSnapAlgorithm[] mSnapAlgorithmForRotation = new DividerSnapAlgorithm[4]; private boolean mImeHideRequested; DockedStackDividerController(WindowManagerService service, DisplayContent displayContent) { mService = service; Loading Loading @@ -375,11 +378,39 @@ public class DockedStackDividerController implements DimLayerUser { } } mDockedStackListeners.finishBroadcast(); if (!exists) { if (exists) { InputMethodManagerInternal inputMethodManagerInternal = LocalServices.getService(InputMethodManagerInternal.class); if (inputMethodManagerInternal != null) { // Hide the current IME to avoid problems with animations from IME adjustment when // attaching the docked stack. inputMethodManagerInternal.hideCurrentInputMethod(); mImeHideRequested = true; } } else { setMinimizedDockedStack(false); } } /** * Resets the state that IME hide has been requested. See {@link #isImeHideRequested}. */ void resetImeHideRequested() { mImeHideRequested = false; } /** * The docked stack divider controller makes sure the IME gets hidden when attaching the docked * stack, to avoid animation problems. This flag indicates whether the request to hide the IME * has been sent in an asynchronous manner, and the IME should be treated as hidden already. * * @return whether IME hide request has been sent */ boolean isImeHideRequested() { return mImeHideRequested; } void notifyDockedStackMinimizedChanged(boolean minimizedDock, long animDuration) { mService.mH.removeMessages(NOTIFY_DOCKED_STACK_MINIMIZED_CHANGED); mService.mH.obtainMessage(NOTIFY_DOCKED_STACK_MINIMIZED_CHANGED, Loading
services/core/java/com/android/server/wm/WindowManagerService.java +2 −1 Original line number Diff line number Diff line Loading @@ -7596,7 +7596,8 @@ public class WindowManagerService extends IWindowManager.Stub void adjustForImeIfNeeded(final DisplayContent displayContent) { final WindowState imeWin = mInputMethodWindow; final boolean imeVisible = imeWin != null && imeWin.isVisibleLw() && imeWin.isDisplayedLw(); final boolean imeVisible = imeWin != null && imeWin.isVisibleLw() && imeWin.isDisplayedLw() && !displayContent.mDividerControllerLocked.isImeHideRequested(); final boolean dockVisible = isStackVisibleLocked(DOCKED_STACK_ID); final TaskStack imeTargetStack = getImeFocusStackLocked(); final int imeDockSide = (dockVisible && imeTargetStack != null) ? Loading
services/core/java/com/android/server/wm/WindowStateAnimator.java +4 −0 Original line number Diff line number Diff line Loading @@ -1745,6 +1745,10 @@ class WindowStateAnimator { mWin.mAppToken.onFirstWindowDrawn(mWin, this); } if (mWin.mAttrs.type == TYPE_INPUT_METHOD) { mWin.mDisplayContent.mDividerControllerLocked.resetImeHideRequested(); } return true; } return false; Loading