Loading core/java/android/view/WindowManagerPolicy.java +10 −0 Original line number Original line Diff line number Diff line Loading @@ -483,6 +483,16 @@ public interface WindowManagerPolicy { */ */ public void switchInputMethod(boolean forwardDirection); public void switchInputMethod(boolean forwardDirection); /** * Returns the visibility of the current input method window (false if there is none). */ public boolean isInputMethodWindowVisible(); /** * Hides the current input method, if visible. */ public void hideCurrentInputMethod(); public void shutdown(boolean confirm); public void shutdown(boolean confirm); public void reboot(boolean confirm); public void reboot(boolean confirm); public void rebootSafeMode(boolean confirm); public void rebootSafeMode(boolean confirm); Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -189,6 +189,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { static final int SHORT_PRESS_POWER_REALLY_GO_TO_SLEEP = 2; static final int SHORT_PRESS_POWER_REALLY_GO_TO_SLEEP = 2; static final int SHORT_PRESS_POWER_REALLY_GO_TO_SLEEP_AND_GO_HOME = 3; static final int SHORT_PRESS_POWER_REALLY_GO_TO_SLEEP_AND_GO_HOME = 3; static final int SHORT_PRESS_POWER_GO_HOME = 4; static final int SHORT_PRESS_POWER_GO_HOME = 4; static final int SHORT_PRESS_POWER_CLOSE_IME_OR_GO_HOME = 5; static final int LONG_PRESS_POWER_NOTHING = 0; static final int LONG_PRESS_POWER_NOTHING = 0; static final int LONG_PRESS_POWER_GLOBAL_ACTIONS = 1; static final int LONG_PRESS_POWER_GLOBAL_ACTIONS = 1; Loading Loading @@ -1302,6 +1303,14 @@ public class PhoneWindowManager implements WindowManagerPolicy { case SHORT_PRESS_POWER_GO_HOME: case SHORT_PRESS_POWER_GO_HOME: launchHomeFromHotKey(true /* awakenFromDreams */, false /*respectKeyguard*/); launchHomeFromHotKey(true /* awakenFromDreams */, false /*respectKeyguard*/); break; break; case SHORT_PRESS_POWER_CLOSE_IME_OR_GO_HOME: if (mWindowManagerFuncs.isInputMethodWindowVisible()) { mWindowManagerFuncs.hideCurrentInputMethod(); } else { launchHomeFromHotKey(true /* awakenFromDreams */, false /*respectKeyguard*/); } break; } } } } } } Loading services/core/java/com/android/server/wm/WindowManagerService.java +18 −0 Original line number Original line Diff line number Diff line Loading @@ -5786,6 +5786,24 @@ public class WindowManagerService extends IWindowManager.Stub } } } } // Called by window manager policy. Not exposed externally. @Override public boolean isInputMethodWindowVisible() { synchronized (mWindowMap) { return mInputMethodWindow != null && mInputMethodWindow.isVisibleLw(); } } // Called by window manager policy. Not exposed externally. @Override public void hideCurrentInputMethod() { final InputMethodManagerInternal inputMethodManagerInternal = LocalServices.getService(InputMethodManagerInternal.class); if (inputMethodManagerInternal != null) { inputMethodManagerInternal.hideCurrentInputMethod(); } } // Called by window manager policy. Not exposed externally. // Called by window manager policy. Not exposed externally. @Override @Override public void lockDeviceNow() { public void lockDeviceNow() { Loading Loading
core/java/android/view/WindowManagerPolicy.java +10 −0 Original line number Original line Diff line number Diff line Loading @@ -483,6 +483,16 @@ public interface WindowManagerPolicy { */ */ public void switchInputMethod(boolean forwardDirection); public void switchInputMethod(boolean forwardDirection); /** * Returns the visibility of the current input method window (false if there is none). */ public boolean isInputMethodWindowVisible(); /** * Hides the current input method, if visible. */ public void hideCurrentInputMethod(); public void shutdown(boolean confirm); public void shutdown(boolean confirm); public void reboot(boolean confirm); public void reboot(boolean confirm); public void rebootSafeMode(boolean confirm); public void rebootSafeMode(boolean confirm); Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -189,6 +189,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { static final int SHORT_PRESS_POWER_REALLY_GO_TO_SLEEP = 2; static final int SHORT_PRESS_POWER_REALLY_GO_TO_SLEEP = 2; static final int SHORT_PRESS_POWER_REALLY_GO_TO_SLEEP_AND_GO_HOME = 3; static final int SHORT_PRESS_POWER_REALLY_GO_TO_SLEEP_AND_GO_HOME = 3; static final int SHORT_PRESS_POWER_GO_HOME = 4; static final int SHORT_PRESS_POWER_GO_HOME = 4; static final int SHORT_PRESS_POWER_CLOSE_IME_OR_GO_HOME = 5; static final int LONG_PRESS_POWER_NOTHING = 0; static final int LONG_PRESS_POWER_NOTHING = 0; static final int LONG_PRESS_POWER_GLOBAL_ACTIONS = 1; static final int LONG_PRESS_POWER_GLOBAL_ACTIONS = 1; Loading Loading @@ -1302,6 +1303,14 @@ public class PhoneWindowManager implements WindowManagerPolicy { case SHORT_PRESS_POWER_GO_HOME: case SHORT_PRESS_POWER_GO_HOME: launchHomeFromHotKey(true /* awakenFromDreams */, false /*respectKeyguard*/); launchHomeFromHotKey(true /* awakenFromDreams */, false /*respectKeyguard*/); break; break; case SHORT_PRESS_POWER_CLOSE_IME_OR_GO_HOME: if (mWindowManagerFuncs.isInputMethodWindowVisible()) { mWindowManagerFuncs.hideCurrentInputMethod(); } else { launchHomeFromHotKey(true /* awakenFromDreams */, false /*respectKeyguard*/); } break; } } } } } } Loading
services/core/java/com/android/server/wm/WindowManagerService.java +18 −0 Original line number Original line Diff line number Diff line Loading @@ -5786,6 +5786,24 @@ public class WindowManagerService extends IWindowManager.Stub } } } } // Called by window manager policy. Not exposed externally. @Override public boolean isInputMethodWindowVisible() { synchronized (mWindowMap) { return mInputMethodWindow != null && mInputMethodWindow.isVisibleLw(); } } // Called by window manager policy. Not exposed externally. @Override public void hideCurrentInputMethod() { final InputMethodManagerInternal inputMethodManagerInternal = LocalServices.getService(InputMethodManagerInternal.class); if (inputMethodManagerInternal != null) { inputMethodManagerInternal.hideCurrentInputMethod(); } } // Called by window manager policy. Not exposed externally. // Called by window manager policy. Not exposed externally. @Override @Override public void lockDeviceNow() { public void lockDeviceNow() { Loading