diff options
author | Selim Cinek <cinek@google.com> | 2015-05-22 12:38:44 -0700 |
---|---|---|
committer | Selim Cinek <cinek@google.com> | 2015-05-22 19:45:46 +0000 |
commit | 37c110fa14aed2bb54f685f3855feb30000322fa (patch) | |
tree | bc1ac6ded1c50e69162d4e877329ca2154df0ac6 /packages/SystemUI/src | |
parent | fa4d547d5813a8f5c298efd089890b5b502df76d (diff) | |
download | frameworks_base-37c110fa14aed2bb54f685f3855feb30000322fa.zip frameworks_base-37c110fa14aed2bb54f685f3855feb30000322fa.tar.gz frameworks_base-37c110fa14aed2bb54f685f3855feb30000322fa.tar.bz2 |
Fixed a flash when launching keyguard affordances
When media artwork was present the screen would briefly
show the artwork and the scrim when launching the affordances
on the keyguard.
Bug: 21379150
Change-Id: Ica36e7f7ef11beef9b2351af4cf43ab4e20151ac
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java | 23 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java | 9 |
2 files changed, 25 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 9fe591e..50cdbb6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -1600,6 +1600,11 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, if (mBackdrop == null) return; // called too early + if (mLaunchTransitionFadingAway) { + mBackdrop.setVisibility(View.INVISIBLE); + return; + } + if (DEBUG_MEDIA) { Log.v(TAG, "DEBUG_MEDIA: updating album art for notification " + mMediaNotificationKey + " metadata=" + mMediaMetadata @@ -3186,9 +3191,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, public void showKeyguard() { if (mLaunchTransitionFadingAway) { mNotificationPanel.animate().cancel(); - mNotificationPanel.setAlpha(1f); - runLaunchTransitionEndRunnable(); - mLaunchTransitionFadingAway = false; + onLaunchTransitionFadingEnded(); } mHandler.removeMessages(MSG_LAUNCH_TRANSITION_TIMEOUT); setBarState(StatusBarState.KEYGUARD); @@ -3209,6 +3212,14 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } } + private void onLaunchTransitionFadingEnded() { + mNotificationPanel.setAlpha(1.0f); + runLaunchTransitionEndRunnable(); + mLaunchTransitionFadingAway = false; + mScrimController.forceHideScrims(false /* hide */); + updateMediaMetaData(true /* metaDataChanged */); + } + public boolean isCollapsing() { return mNotificationPanel.isCollapsing(); } @@ -3240,6 +3251,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, if (beforeFading != null) { beforeFading.run(); } + mScrimController.forceHideScrims(true /* hide */); + updateMediaMetaData(false); mNotificationPanel.setAlpha(1); mNotificationPanel.animate() .alpha(0) @@ -3249,9 +3262,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, .withEndAction(new Runnable() { @Override public void run() { - mNotificationPanel.setAlpha(1); - runLaunchTransitionEndRunnable(); - mLaunchTransitionFadingAway = false; + onLaunchTransitionFadingEnded(); } }); mIconController.appTransitionStarting(SystemClock.uptimeMillis(), diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java index 450fdd9..c3719d4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java @@ -83,6 +83,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, private int mPinnedHeadsUpCount; private float mTopHeadsUpDragAmount; private View mDraggedHeadsUpView; + private boolean mForceHideScrims; public ScrimController(ScrimView scrimBehind, ScrimView scrimInFront, View headsUpScrim, boolean scrimSrcEnabled) { @@ -176,7 +177,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, } private void updateScrims() { - if (mAnimateKeyguardFadingOut) { + if (mAnimateKeyguardFadingOut || mForceHideScrims) { setScrimInFrontColor(0f); setScrimBehindColor(0f); } else if (!mKeyguardShowing && !mBouncerShowing) { @@ -440,4 +441,10 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, expandFactor = Math.max(expandFactor, 0.0f); return alpha * expandFactor; } + + public void forceHideScrims(boolean hide) { + mForceHideScrims = hide; + mAnimateChange = false; + scheduleUpdate(); + } } |