diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 2d7521d09a4a3..b977dd46d27e6 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -1827,11 +1827,11 @@ public class KeyguardViewMediator extends SystemUI { mWakeAndUnlocking = false; setShowingLocked(false); + mDismissCallbackRegistry.notifyDismissSucceeded(); mStatusBarKeyguardViewManager.hide(startTime, fadeoutDuration); resetKeyguardDonePendingLocked(); mHideAnimationRun = false; adjustStatusBarLocked(); - mDismissCallbackRegistry.notifyDismissSucceeded(); sendUserPresentBroadcast(); mUpdateMonitor.setKeyguardGoingAway(false /* goingAway */); } diff --git a/services/core/java/com/android/server/trust/TrustManagerService.java b/services/core/java/com/android/server/trust/TrustManagerService.java index 8e06a51238ee4..e12dc1d59a72f 100644 --- a/services/core/java/com/android/server/trust/TrustManagerService.java +++ b/services/core/java/com/android/server/trust/TrustManagerService.java @@ -795,6 +795,10 @@ public class TrustManagerService extends SystemService { // coalesce refresh messages. mHandler.removeMessages(MSG_KEYGUARD_SHOWING_CHANGED); mHandler.sendEmptyMessage(MSG_KEYGUARD_SHOWING_CHANGED); + + // Make sure handler processes the message before returning, such that isDeviceLocked + // after this call will retrieve the correct value. + mHandler.runWithScissors(() -> {}, 0); } @Override