OSDN Git Service

Fix issue with transition cancelling
authorLucas Dupin <dupin@google.com>
Fri, 8 Dec 2017 18:36:28 +0000 (10:36 -0800)
committerLucas Dupin <dupin@google.com>
Fri, 8 Dec 2017 18:54:26 +0000 (10:54 -0800)
Fixes: 69901116
Fixes: 70296214
Test: Double tap power button to launch camera
Test: Unlock with fingerprint, pin, SmartLock
Test: Unlock with fingerprint while changing brightness
Test: Unlock by tapping notification
Change-Id: I487b29c3aa5460cbd120072becb4e0449cffcce6

packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java

index 3a36776..05fcbb0 100644 (file)
@@ -204,12 +204,15 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
             throw new IllegalArgumentException("Cannot change to UNINITIALIZED.");
         }
 
+        final ScrimState oldState = mState;
+        mState = state;
+
         if (mCallback != null) {
             mCallback.onCancelled();
         }
         mCallback = callback;
 
-        state.prepare(mState);
+        state.prepare(oldState);
         mScreenBlankingCallbackCalled = false;
         mAnimationDelay = 0;
         mBlankScreen = state.getBlanksScreen();
@@ -228,8 +231,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
             mKeyguardFadeoutAnimation.cancel();
         }
 
-        mState = state;
-
         // Do not let the device sleep until we're done with all animations
         if (!mWakeLockHeld) {
             if (mWakeLock != null) {
@@ -310,7 +311,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
                     mCurrentInFrontAlpha = 0;
                 }
             } else {
-                Log.w(TAG, "Invalid state, cannot set panel expansion when: " + mState);
                 return;
             }
 
index c967423..271950b 100644 (file)
@@ -659,8 +659,7 @@ public class StatusBar extends SystemUI implements DemoMode,
 
         @Override
         public void onCancelled() {
-            // Transition was cancelled because another one took over.
-            // Nothing to do in here but wait.
+            onFinished();
         }
     };