OSDN Git Service

Cross fade wake-up from pulsing
authorLucas Dupin <dupin@google.com>
Wed, 27 Jun 2018 20:35:52 +0000 (13:35 -0700)
committerLucas Dupin <dupin@google.com>
Mon, 2 Jul 2018 17:26:45 +0000 (10:26 -0700)
Activate WM animation and remove scrims when
fading keyguard from the pulsing state to prettify
animation on new devices.

Test: wake up with fp from pulsing to launcher
Test: wake up with fp from pulsing to app
Fixes: 110824274
Change-Id: I0446f26939a2e25cd50d0d39f3fc703019196f7a

core/res/res/anim/lock_screen_behind_enter_fade_in.xml
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java

index e9475f5..ff95aea 100644 (file)
@@ -16,7 +16,6 @@
   -->
 
 <alpha xmlns:android="http://schemas.android.com/apk/res/android"
-    android:background="#ff000000"
     android:detachWallpaper="true"
     android:shareInterpolator="false"
     android:interpolator="@interpolator/linear"
index 6809e76..8fc778a 100644 (file)
@@ -344,6 +344,11 @@ public class KeyguardViewMediator extends SystemUI {
      */
     private WorkLockActivityController mWorkLockController;
 
+    /**
+     * @see #setPulsing(boolean)
+     */
+    private boolean mPulsing;
+
     private boolean mLockLater;
 
     private boolean mWakeAndUnlocking;
@@ -1798,10 +1803,12 @@ public class KeyguardViewMediator extends SystemUI {
 
                 int flags = 0;
                 if (mStatusBarKeyguardViewManager.shouldDisableWindowAnimationsForUnlock()
-                        || mWakeAndUnlocking) {
-                    flags |= WindowManagerPolicyConstants.KEYGUARD_GOING_AWAY_FLAG_NO_WINDOW_ANIMATIONS;
+                        || (mWakeAndUnlocking && !mPulsing)) {
+                    flags |= WindowManagerPolicyConstants
+                            .KEYGUARD_GOING_AWAY_FLAG_NO_WINDOW_ANIMATIONS;
                 }
-                if (mStatusBarKeyguardViewManager.isGoingToNotificationShade()) {
+                if (mStatusBarKeyguardViewManager.isGoingToNotificationShade()
+                        || (mWakeAndUnlocking && mPulsing)) {
                     flags |= WindowManagerPolicyConstants.KEYGUARD_GOING_AWAY_FLAG_TO_SHADE;
                 }
                 if (mStatusBarKeyguardViewManager.isUnlockWithWallpaper()) {
@@ -2104,6 +2111,13 @@ public class KeyguardViewMediator extends SystemUI {
         setShowingLocked(mShowing, aodShowing);
     }
 
+    /**
+     * @param pulsing true when device temporarily wakes up to display an incoming notification.
+     */
+    public void setPulsing(boolean pulsing) {
+        mPulsing = pulsing;
+    }
+
     private static class StartKeyguardExitAnimParams {
 
         long startTime;
index cdbad59..19015fc 100644 (file)
@@ -146,7 +146,7 @@ public enum ScrimState {
             mAnimationDuration = StatusBar.FADE_KEYGUARD_DURATION;
             mAnimateChange = !mLaunchingAffordanceWithPreview;
 
-            if (previousState == ScrimState.AOD || previousState == ScrimState.PULSING) {
+            if (previousState == ScrimState.AOD) {
                 // Fade from black to transparent when coming directly from AOD
                 updateScrimColor(mScrimInFront, 1, Color.BLACK);
                 updateScrimColor(mScrimBehind, 1, Color.BLACK);
index cd30104..d5dcdf6 100644 (file)
@@ -4860,6 +4860,7 @@ public class StatusBar extends SystemUI implements DemoMode,
                 }
 
                 private void setPulsing(boolean pulsing) {
+                    mKeyguardViewMediator.setPulsing(pulsing);
                     mNotificationPanel.setPulsing(pulsing);
                     mVisualStabilityManager.setPulsing(pulsing);
                     mIgnoreTouchWhilePulsing = false;