Loading policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +17 −1 Original line number Diff line number Diff line Loading @@ -5002,8 +5002,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { // If we're currently dozing with the screen on and the keyguard showing, pass the key // to the application but preserve its wake key status to make sure we still move // from dozing to fully interactive if we would normally go from off to fully // interactive. // interactive, unless the user has explicitly disabled this wake key. result = ACTION_PASS_TO_USER; isWakeKey = isWakeKey && isWakeKeyEnabled(keyCode); } else { // When the screen is off and the key is not injected, determine whether // to wake the device but don't pass the key to the application. Loading Loading @@ -5301,6 +5302,21 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } /** * Check if the given keyCode represents a key that is considered a wake key * and is currently enabled by the user in Settings or for another reason. */ private boolean isWakeKeyEnabled(int keyCode) { switch (keyCode) { case KeyEvent.KEYCODE_VOLUME_UP: case KeyEvent.KEYCODE_VOLUME_DOWN: case KeyEvent.KEYCODE_VOLUME_MUTE: // Volume keys are still wake keys if the device is docked. return mVolumeWakeScreen || mDockMode != Intent.EXTRA_DOCK_STATE_UNDOCKED; } return true; } /** * When the screen is off we ignore some keys that might otherwise typically * be considered wake keys. We filter them out here. Loading Loading
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +17 −1 Original line number Diff line number Diff line Loading @@ -5002,8 +5002,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { // If we're currently dozing with the screen on and the keyguard showing, pass the key // to the application but preserve its wake key status to make sure we still move // from dozing to fully interactive if we would normally go from off to fully // interactive. // interactive, unless the user has explicitly disabled this wake key. result = ACTION_PASS_TO_USER; isWakeKey = isWakeKey && isWakeKeyEnabled(keyCode); } else { // When the screen is off and the key is not injected, determine whether // to wake the device but don't pass the key to the application. Loading Loading @@ -5301,6 +5302,21 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } /** * Check if the given keyCode represents a key that is considered a wake key * and is currently enabled by the user in Settings or for another reason. */ private boolean isWakeKeyEnabled(int keyCode) { switch (keyCode) { case KeyEvent.KEYCODE_VOLUME_UP: case KeyEvent.KEYCODE_VOLUME_DOWN: case KeyEvent.KEYCODE_VOLUME_MUTE: // Volume keys are still wake keys if the device is docked. return mVolumeWakeScreen || mDockMode != Intent.EXTRA_DOCK_STATE_UNDOCKED; } return true; } /** * When the screen is off we ignore some keys that might otherwise typically * be considered wake keys. We filter them out here. Loading