Update callbacks when initializing to initial state

This fixes a bug where activity manager was not informed about the
lockscreen state if Keyguard was disabled and SystemUI crashed, so
we just displayed a black screen.

Test:
- Set no lockscreen
- Crash SystemUI

Change-Id: I93b8ed74dd12af6903ffdb05b59c78f2f12febb4
This commit is contained in:
Jorim Jaggi
2016-11-07 16:48:31 -08:00
parent 8d5a6e7ce3
commit e8f321e749

View File

@@ -645,9 +645,7 @@ public class KeyguardViewMediator extends SystemUI {
// Assume keyguard is showing (unless it's disabled) until we know for sure...
setShowingLocked(!shouldWaitForProvisioning() && !mLockPatternUtils.isLockScreenDisabled(
KeyguardUpdateMonitor.getCurrentUser()));
updateInputRestrictedLocked();
mTrustManager.reportKeyguardShowingChanged();
KeyguardUpdateMonitor.getCurrentUser()), true /* forceCallbacks */);
mStatusBarKeyguardViewManager =
SystemUIFactory.getInstance().createStatusBarKeyguardViewManager(mContext,
@@ -1980,7 +1978,11 @@ public class KeyguardViewMediator extends SystemUI {
}
private void setShowingLocked(boolean showing) {
if (showing != mShowing) {
setShowingLocked(showing, false /* forceCallbacks */);
}
private void setShowingLocked(boolean showing, boolean forceCallbacks) {
if (showing != mShowing || forceCallbacks) {
mShowing = showing;
int size = mKeyguardStateCallbacks.size();
for (int i = size - 1; i >= 0; i--) {