Turn off the screen if no security lock
The lock or sleep power button behavior will lock the screen when the screen is not in keyguard. It should turn off the screen directly if there is no lock screen set. Bug: 220814624 Test: manual Change-Id: I94f7e5dbc15d16ec9e453a9b945d7fadb23ca004
This commit is contained in:
@@ -1023,7 +1023,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
break;
|
||||
}
|
||||
case SHORT_PRESS_POWER_LOCK_OR_SLEEP: {
|
||||
if (keyguardOn()) {
|
||||
if (mKeyguardDelegate == null || !mKeyguardDelegate.hasKeyguard()
|
||||
|| !mKeyguardDelegate.isSecure(mCurrentUserId) || keyguardOn()) {
|
||||
sleepDefaultDisplayFromPowerButton(eventTime, 0);
|
||||
} else {
|
||||
lockNow(null /*options*/);
|
||||
|
||||
Reference in New Issue
Block a user