OSDN Git Service

Merge "Fix ordering of notifying dismiss callback" into oc-dev am: e85f8eb0ca
authorJorim Jaggi <jjaggi@google.com>
Thu, 18 May 2017 22:47:12 +0000 (22:47 +0000)
committerandroid-build-merger <android-build-merger@google.com>
Thu, 18 May 2017 22:47:12 +0000 (22:47 +0000)
am: a55a662600

Change-Id: Ic24eaca241ddc2c84395a1d2bdaf6dd554b0e55b

packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
services/core/java/com/android/server/trust/TrustManagerService.java

index 2d7521d..b977dd4 100644 (file)
@@ -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 */);
         }
index 5bd485c..6801230 100644 (file)
@@ -830,6 +830,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