From 33259ad52e17096db6586aef0e5379baab2f762b Mon Sep 17 00:00:00 2001 From: Robert Snoeberger Date: Wed, 19 Jun 2019 14:55:49 -0400 Subject: Hold wake lock while animations to bold clock. In the bug, it appears that the phone dozed during the transition. Holding the wake lock will keep the phone awake until the transition ends. This is a speculative change because I wasn't able to reproduce the issue. Bug: 135458132 Test: checked that the transition still works, but I wasn't able to verify the fix because I'm not able to reproduce the issue. Change-Id: Ibfd4ae7522c30882051a41927c1714ace3f08b89 --- .../SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java index 7ec1bda26cf8..3da969c8542e 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java @@ -3,7 +3,6 @@ package com.android.keyguard; import static com.android.systemui.util.InjectionInflationController.VIEW_CONTEXT; import android.animation.Animator; -import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; import android.app.WallpaperManager; import android.content.Context; @@ -34,6 +33,7 @@ import com.android.systemui.colorextraction.SysuiColorExtractor; import com.android.systemui.plugins.ClockPlugin; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.StatusBarState; +import com.android.systemui.util.wakelock.KeepAwakeAnimationListener; import java.io.FileDescriptor; import java.io.PrintWriter; @@ -569,11 +569,16 @@ public class KeyguardClockSwitch extends RelativeLayout { view.setScaleX(scale); view.setScaleY(scale); }); - animator.addListener(new AnimatorListenerAdapter() { + animator.addListener(new KeepAwakeAnimationListener(getContext()) { @Override public void onAnimationStart(Animator animation) { super.onAnimationStart(animation); view.setVisibility(startVisibility); + } + + @Override + public void onAnimationEnd(Animator animation) { + super.onAnimationEnd(animation); animation.removeListener(this); } }); -- cgit v1.2.3-59-g8ed1b