Don't wait keyguard drawn if device has no keyguard

Instead, call finishKeyguardDrawn() if device has
no keyguard to avoid redundant waiting times.

Bug: 72972510
Change-Id: Id756de05691be2593fa06d3b55e5e24ad1ea7b19
This commit is contained in:
eddy-sh.chen
2018-02-22 18:10:21 +08:00
parent 1c81aa6375
commit 0df686d2e4
2 changed files with 5 additions and 1 deletions

View File

@@ -6791,7 +6791,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mWindowManagerDrawComplete = false;
mScreenOnListener = screenOnListener;
if (mKeyguardDelegate != null) {
if (mKeyguardDelegate != null && mKeyguardDelegate.hasKeyguard()) {
mHandler.removeMessages(MSG_KEYGUARD_DRAWN_TIMEOUT);
mHandler.sendEmptyMessageDelayed(MSG_KEYGUARD_DRAWN_TIMEOUT,
getKeyguardDrawnTimeout());

View File

@@ -235,6 +235,10 @@ public class KeyguardServiceDelegate {
return false;
}
public boolean hasKeyguard() {
return mKeyguardState.deviceHasKeyguard;
}
public boolean isInputRestricted() {
if (mKeyguardService != null) {
mKeyguardState.inputRestricted = mKeyguardService.isInputRestricted();