Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +11 −1 Original line number Original line Diff line number Diff line Loading @@ -618,6 +618,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { private int mPowerButtonSuppressionDelayMillis = POWER_BUTTON_SUPPRESSION_DELAY_DEFAULT_MILLIS; private int mPowerButtonSuppressionDelayMillis = POWER_BUTTON_SUPPRESSION_DELAY_DEFAULT_MILLIS; private boolean mLockNowPending = false; private static final int MSG_DISPATCH_MEDIA_KEY_WITH_WAKE_LOCK = 3; private static final int MSG_DISPATCH_MEDIA_KEY_WITH_WAKE_LOCK = 3; private static final int MSG_DISPATCH_MEDIA_KEY_REPEAT_WITH_WAKE_LOCK = 4; private static final int MSG_DISPATCH_MEDIA_KEY_REPEAT_WITH_WAKE_LOCK = 4; private static final int MSG_KEYGUARD_DRAWN_COMPLETE = 5; private static final int MSG_KEYGUARD_DRAWN_COMPLETE = 5; Loading Loading @@ -4988,6 +4990,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { mKeyguardDelegate.doKeyguardTimeout(options); mKeyguardDelegate.doKeyguardTimeout(options); } } mLockScreenTimerActive = false; mLockScreenTimerActive = false; mLockNowPending = false; options = null; options = null; } } } } Loading @@ -4997,7 +5000,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } } } ScreenLockTimeout mScreenLockTimeout = new ScreenLockTimeout(); final ScreenLockTimeout mScreenLockTimeout = new ScreenLockTimeout(); @Override @Override public void lockNow(Bundle options) { public void lockNow(Bundle options) { Loading @@ -5009,6 +5012,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { mScreenLockTimeout.setLockOptions(options); mScreenLockTimeout.setLockOptions(options); } } mHandler.post(mScreenLockTimeout); mHandler.post(mScreenLockTimeout); synchronized (mScreenLockTimeout) { mLockNowPending = true; } } } // TODO (b/113840485): Move this logic to DisplayPolicy when lockscreen supports multi-display. // TODO (b/113840485): Move this logic to DisplayPolicy when lockscreen supports multi-display. Loading @@ -5024,6 +5030,10 @@ public class PhoneWindowManager implements WindowManagerPolicy { private void updateLockScreenTimeout() { private void updateLockScreenTimeout() { synchronized (mScreenLockTimeout) { synchronized (mScreenLockTimeout) { if (mLockNowPending) { Log.w(TAG, "lockNow pending, ignore updating lockscreen timeout"); return; } final boolean enable = !mAllowLockscreenWhenOnDisplays.isEmpty() final boolean enable = !mAllowLockscreenWhenOnDisplays.isEmpty() && mDefaultDisplayPolicy.isAwake() && mDefaultDisplayPolicy.isAwake() && mKeyguardDelegate != null && mKeyguardDelegate.isSecure(mCurrentUserId); && mKeyguardDelegate != null && mKeyguardDelegate.isSecure(mCurrentUserId); Loading Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +11 −1 Original line number Original line Diff line number Diff line Loading @@ -618,6 +618,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { private int mPowerButtonSuppressionDelayMillis = POWER_BUTTON_SUPPRESSION_DELAY_DEFAULT_MILLIS; private int mPowerButtonSuppressionDelayMillis = POWER_BUTTON_SUPPRESSION_DELAY_DEFAULT_MILLIS; private boolean mLockNowPending = false; private static final int MSG_DISPATCH_MEDIA_KEY_WITH_WAKE_LOCK = 3; private static final int MSG_DISPATCH_MEDIA_KEY_WITH_WAKE_LOCK = 3; private static final int MSG_DISPATCH_MEDIA_KEY_REPEAT_WITH_WAKE_LOCK = 4; private static final int MSG_DISPATCH_MEDIA_KEY_REPEAT_WITH_WAKE_LOCK = 4; private static final int MSG_KEYGUARD_DRAWN_COMPLETE = 5; private static final int MSG_KEYGUARD_DRAWN_COMPLETE = 5; Loading Loading @@ -4988,6 +4990,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { mKeyguardDelegate.doKeyguardTimeout(options); mKeyguardDelegate.doKeyguardTimeout(options); } } mLockScreenTimerActive = false; mLockScreenTimerActive = false; mLockNowPending = false; options = null; options = null; } } } } Loading @@ -4997,7 +5000,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } } } ScreenLockTimeout mScreenLockTimeout = new ScreenLockTimeout(); final ScreenLockTimeout mScreenLockTimeout = new ScreenLockTimeout(); @Override @Override public void lockNow(Bundle options) { public void lockNow(Bundle options) { Loading @@ -5009,6 +5012,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { mScreenLockTimeout.setLockOptions(options); mScreenLockTimeout.setLockOptions(options); } } mHandler.post(mScreenLockTimeout); mHandler.post(mScreenLockTimeout); synchronized (mScreenLockTimeout) { mLockNowPending = true; } } } // TODO (b/113840485): Move this logic to DisplayPolicy when lockscreen supports multi-display. // TODO (b/113840485): Move this logic to DisplayPolicy when lockscreen supports multi-display. Loading @@ -5024,6 +5030,10 @@ public class PhoneWindowManager implements WindowManagerPolicy { private void updateLockScreenTimeout() { private void updateLockScreenTimeout() { synchronized (mScreenLockTimeout) { synchronized (mScreenLockTimeout) { if (mLockNowPending) { Log.w(TAG, "lockNow pending, ignore updating lockscreen timeout"); return; } final boolean enable = !mAllowLockscreenWhenOnDisplays.isEmpty() final boolean enable = !mAllowLockscreenWhenOnDisplays.isEmpty() && mDefaultDisplayPolicy.isAwake() && mDefaultDisplayPolicy.isAwake() && mKeyguardDelegate != null && mKeyguardDelegate.isSecure(mCurrentUserId); && mKeyguardDelegate != null && mKeyguardDelegate.isSecure(mCurrentUserId); Loading