From 521e283d910911f7c7bd2b9b781f1dd8b32a3162 Mon Sep 17 00:00:00 2001 From: Fabian Kozynski Date: Wed, 5 Jun 2019 12:42:06 -0400 Subject: [PATCH] Update KeyguardMonitor when UnlockMethod changes If UnlockMethodChanges but StatusBarState does not, KeyguardMonitor was not updated. This happened when user changed and may have made KeyguardMonitor believe it was not secure. Test: manual: Create another user and and have "Add users on lock screen" off. Switch from secondary to owner without going out of KEYGUARD Fixes: 134447252 Change-Id: Id39bf876d6e573002965d0aa14fd6e54c323aba9 --- .../android/systemui/statusbar/phone/StatusBar.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 05a23fa49922b..cb08f59be5e2f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -1525,6 +1525,8 @@ public class StatusBar extends SystemUI implements DemoMode, @Override // UnlockMethodCache.OnUnlockMethodChangedListener public void onUnlockMethodStateChanged() { + // Unlock method state changed. Notify KeguardMonitor + updateKeyguardState(); logStateToEventlog(); } @@ -3422,9 +3424,7 @@ public class StatusBar extends SystemUI implements DemoMode, updateScrimController(); updateSystemUiStateFlags(); mPresenter.updateMediaMetaData(false, mState != StatusBarState.KEYGUARD); - mKeyguardMonitor.notifyKeyguardState(mStatusBarKeyguardViewManager.isShowing(), - mUnlockMethodCache.isMethodSecure(), - mStatusBarKeyguardViewManager.isOccluded()); + updateKeyguardState(); Trace.endSection(); } @@ -3463,6 +3463,12 @@ public class StatusBar extends SystemUI implements DemoMode, mStatusBarStateController.setIsDozing(dozing); } + private void updateKeyguardState() { + mKeyguardMonitor.notifyKeyguardState(mStatusBarKeyguardViewManager.isShowing(), + mUnlockMethodCache.isMethodSecure(), + mStatusBarKeyguardViewManager.isOccluded()); + } + public void onActivationReset() { mKeyguardIndicationController.hideTransientIndication(); }