Skip to content

Commit 5e08e69

Browse files
committed
Fix blank Keyguard #4
When we were fading out the preview for phone/camera to crossfade to the real application, it might have been that showKeyguard was called in the middle of this transition. This change makes sure that we cancel this animation when showing the keyguard. Bug: 17439581 Change-Id: I89cacf7ecf43d37ea979418b976390272510a09d
1 parent 449981b commit 5e08e69

3 files changed

Lines changed: 21 additions & 7 deletions

File tree

packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -983,10 +983,12 @@ private void setKeyguardStatusViewVisibility(int statusBarState, boolean keyguar
983983
.withEndAction(mAnimateKeyguardStatusViewVisibleEndRunnable);
984984
} else if (statusBarState == StatusBarState.KEYGUARD) {
985985
mKeyguardStatusView.animate().cancel();
986+
mKeyguardStatusViewAnimating = false;
986987
mKeyguardStatusView.setVisibility(View.VISIBLE);
987988
mKeyguardStatusView.setAlpha(1f);
988989
} else {
989990
mKeyguardStatusView.animate().cancel();
991+
mKeyguardStatusViewAnimating = false;
990992
mKeyguardStatusView.setVisibility(View.GONE);
991993
mKeyguardStatusView.setAlpha(1f);
992994
}

packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3494,6 +3494,15 @@ public int getBarState() {
34943494
}
34953495

34963496
public void showKeyguard() {
3497+
if (mLaunchTransitionFadingAway) {
3498+
mNotificationPanel.animate().cancel();
3499+
mNotificationPanel.setAlpha(1f);
3500+
if (mLaunchTransitionEndRunnable != null) {
3501+
mLaunchTransitionEndRunnable.run();
3502+
}
3503+
mLaunchTransitionEndRunnable = null;
3504+
mLaunchTransitionFadingAway = false;
3505+
}
34973506
setBarState(StatusBarState.KEYGUARD);
34983507
updateKeyguardState(false /* goingToFullShade */, false /* fromShadeLocked */);
34993508
if (!mScreenOnFromKeyguard) {
@@ -3533,7 +3542,8 @@ public boolean isInLaunchTransition() {
35333542
* @param endRunnable the runnable to be run when the transition is done
35343543
*/
35353544
public void fadeKeyguardAfterLaunchTransition(final Runnable beforeFading,
3536-
final Runnable endRunnable) {
3545+
Runnable endRunnable) {
3546+
mLaunchTransitionEndRunnable = endRunnable;
35373547
Runnable hideRunnable = new Runnable() {
35383548
@Override
35393549
public void run() {
@@ -3551,9 +3561,10 @@ public void run() {
35513561
@Override
35523562
public void run() {
35533563
mNotificationPanel.setAlpha(1);
3554-
if (endRunnable != null) {
3555-
endRunnable.run();
3564+
if (mLaunchTransitionEndRunnable != null) {
3565+
mLaunchTransitionEndRunnable.run();
35563566
}
3567+
mLaunchTransitionEndRunnable = null;
35573568
mLaunchTransitionFadingAway = false;
35583569
}
35593570
});

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,11 @@ private void setScrimInFrontColor(float alpha) {
260260
}
261261

262262
private void setScrimColor(ScrimView scrim, float alpha) {
263+
Object runningAnim = scrim.getTag(TAG_KEY_ANIM);
264+
if (runningAnim instanceof ValueAnimator) {
265+
((ValueAnimator) runningAnim).cancel();
266+
scrim.setTag(TAG_KEY_ANIM, null);
267+
}
263268
int color = Color.argb((int) (alpha * 255), 0, 0, 0);
264269
if (mAnimateChange) {
265270
startScrimAnimation(scrim, color);
@@ -274,10 +279,6 @@ private void startScrimAnimation(final ScrimView scrim, int targetColor) {
274279
if (current == targetColor) {
275280
return;
276281
}
277-
Object runningAnim = scrim.getTag(TAG_KEY_ANIM);
278-
if (runningAnim instanceof ValueAnimator) {
279-
((ValueAnimator) runningAnim).cancel();
280-
}
281282
ValueAnimator anim = ValueAnimator.ofInt(current, target);
282283
anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
283284
@Override

0 commit comments

Comments
 (0)