Loading core/java/android/view/WindowManagerPolicy.java +7 −0 Original line number Diff line number Diff line Loading @@ -1099,6 +1099,13 @@ public interface WindowManagerPolicy { */ public void stopScreenSaver(); /** * Set the last used input method window state. This state is used to make IME transition * smooth. * @hide */ public void setLastInputMethodWindowLw(WindowState ime, WindowState target); /** * Print the WindowManagerPolicy's state into the given stream. * Loading policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +34 −13 Original line number Diff line number Diff line Loading @@ -324,6 +324,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { volatile boolean mPowerKeyHandled; // accessed from input reader and handler thread boolean mPendingPowerKeyUpCanceled; Handler mHandler; WindowState mLastInputMethodWindow = null; WindowState mLastInputMethodTargetWindow = null; static final int RECENT_APPS_BEHAVIOR_SHOW_OR_DISMISS = 0; static final int RECENT_APPS_BEHAVIOR_EXIT_TOUCH_MODE_AND_SHOW = 1; Loading Loading @@ -2395,6 +2397,14 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (win == mStatusBar || win == mNavigationBar) { return; } final boolean needsToOffsetInputMethodTarget = (win == mLastInputMethodTargetWindow && mLastInputMethodWindow != null); if (needsToOffsetInputMethodTarget) { if (DEBUG_LAYOUT) { Slog.i(TAG, "Offset ime target window by the last ime window state"); } offsetInputMethodWindowLw(mLastInputMethodWindow); } final int fl = attrs.flags; final int sim = attrs.softInputMode; Loading Loading @@ -2672,6 +2682,12 @@ public class PhoneWindowManager implements WindowManagerPolicy { // Dock windows carve out the bottom of the screen, so normal windows // can't appear underneath them. if (attrs.type == TYPE_INPUT_METHOD && !win.getGivenInsetsPendingLw()) { setLastInputMethodWindowLw(null, null); offsetInputMethodWindowLw(win); } } private void offsetInputMethodWindowLw(WindowState win) { int top = win.getContentFrameLw().top; top += win.getGivenContentInsetsLw().top; if (mContentBottom > top) { Loading @@ -2686,7 +2702,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { + mDockBottom + " mContentBottom=" + mContentBottom + " mCurBottom=" + mCurBottom); } } /** {@inheritDoc} */ @Override Loading Loading @@ -4184,6 +4199,12 @@ public class PhoneWindowManager implements WindowManagerPolicy { return mHasNavigationBar; } @Override public void setLastInputMethodWindowLw(WindowState ime, WindowState target) { mLastInputMethodWindow = ime; mLastInputMethodTargetWindow = target; } public void dump(String prefix, FileDescriptor fd, PrintWriter pw, String[] args) { pw.print(prefix); pw.print("mSafeMode="); pw.print(mSafeMode); pw.print(" mSystemReady="); pw.print(mSystemReady); Loading services/java/com/android/server/wm/WindowManagerService.java +4 −0 Original line number Diff line number Diff line Loading @@ -2262,6 +2262,7 @@ public class WindowManagerService extends IWindowManager.Stub boolean imMayMove = true; if (attrs.type == TYPE_INPUT_METHOD) { win.mGivenInsetsPending = true; mInputMethodWindow = win; addInputMethodWindowToListLocked(win); imMayMove = false; Loading Loading @@ -3422,6 +3423,9 @@ 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; Loading Loading
core/java/android/view/WindowManagerPolicy.java +7 −0 Original line number Diff line number Diff line Loading @@ -1099,6 +1099,13 @@ public interface WindowManagerPolicy { */ public void stopScreenSaver(); /** * Set the last used input method window state. This state is used to make IME transition * smooth. * @hide */ public void setLastInputMethodWindowLw(WindowState ime, WindowState target); /** * Print the WindowManagerPolicy's state into the given stream. * Loading
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +34 −13 Original line number Diff line number Diff line Loading @@ -324,6 +324,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { volatile boolean mPowerKeyHandled; // accessed from input reader and handler thread boolean mPendingPowerKeyUpCanceled; Handler mHandler; WindowState mLastInputMethodWindow = null; WindowState mLastInputMethodTargetWindow = null; static final int RECENT_APPS_BEHAVIOR_SHOW_OR_DISMISS = 0; static final int RECENT_APPS_BEHAVIOR_EXIT_TOUCH_MODE_AND_SHOW = 1; Loading Loading @@ -2395,6 +2397,14 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (win == mStatusBar || win == mNavigationBar) { return; } final boolean needsToOffsetInputMethodTarget = (win == mLastInputMethodTargetWindow && mLastInputMethodWindow != null); if (needsToOffsetInputMethodTarget) { if (DEBUG_LAYOUT) { Slog.i(TAG, "Offset ime target window by the last ime window state"); } offsetInputMethodWindowLw(mLastInputMethodWindow); } final int fl = attrs.flags; final int sim = attrs.softInputMode; Loading Loading @@ -2672,6 +2682,12 @@ public class PhoneWindowManager implements WindowManagerPolicy { // Dock windows carve out the bottom of the screen, so normal windows // can't appear underneath them. if (attrs.type == TYPE_INPUT_METHOD && !win.getGivenInsetsPendingLw()) { setLastInputMethodWindowLw(null, null); offsetInputMethodWindowLw(win); } } private void offsetInputMethodWindowLw(WindowState win) { int top = win.getContentFrameLw().top; top += win.getGivenContentInsetsLw().top; if (mContentBottom > top) { Loading @@ -2686,7 +2702,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { + mDockBottom + " mContentBottom=" + mContentBottom + " mCurBottom=" + mCurBottom); } } /** {@inheritDoc} */ @Override Loading Loading @@ -4184,6 +4199,12 @@ public class PhoneWindowManager implements WindowManagerPolicy { return mHasNavigationBar; } @Override public void setLastInputMethodWindowLw(WindowState ime, WindowState target) { mLastInputMethodWindow = ime; mLastInputMethodTargetWindow = target; } public void dump(String prefix, FileDescriptor fd, PrintWriter pw, String[] args) { pw.print(prefix); pw.print("mSafeMode="); pw.print(mSafeMode); pw.print(" mSystemReady="); pw.print(mSystemReady); Loading
services/java/com/android/server/wm/WindowManagerService.java +4 −0 Original line number Diff line number Diff line Loading @@ -2262,6 +2262,7 @@ public class WindowManagerService extends IWindowManager.Stub boolean imMayMove = true; if (attrs.type == TYPE_INPUT_METHOD) { win.mGivenInsetsPending = true; mInputMethodWindow = win; addInputMethodWindowToListLocked(win); imMayMove = false; Loading Loading @@ -3422,6 +3423,9 @@ 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; Loading