diff --git a/packages/SystemUI/src/com/android/keyguard/AnimatableClockController.java b/packages/SystemUI/src/com/android/keyguard/AnimatableClockController.java index 08076c17dc3ad..4b3af34b1df1f 100644 --- a/packages/SystemUI/src/com/android/keyguard/AnimatableClockController.java +++ b/packages/SystemUI/src/com/android/keyguard/AnimatableClockController.java @@ -94,7 +94,9 @@ public class AnimatableClockController extends ViewController { + return mStatusBarStateController.isDozing(); + }); } mIsCharging = charging; } diff --git a/packages/SystemUI/src/com/android/keyguard/AnimatableClockView.java b/packages/SystemUI/src/com/android/keyguard/AnimatableClockView.java index 63867c0f7308d..58b3865facbc1 100644 --- a/packages/SystemUI/src/com/android/keyguard/AnimatableClockView.java +++ b/packages/SystemUI/src/com/android/keyguard/AnimatableClockView.java @@ -196,20 +196,20 @@ public class AnimatableClockView extends TextView { null /* onAnimationEnd */); } - void animateCharge(boolean isDozing) { + void animateCharge(DozeStateGetter dozeStateGetter) { if (mTextAnimator == null || mTextAnimator.isRunning()) { // Skip charge animation if dozing animation is already playing. return; } Runnable startAnimPhase2 = () -> setTextStyle( - isDozing ? mDozingWeight : mLockScreenWeight/* weight */, + dozeStateGetter.isDozing() ? mDozingWeight : mLockScreenWeight/* weight */, -1, null, true /* animate */, CHARGE_ANIM_DURATION_PHASE_1, 0 /* delay */, null /* onAnimationEnd */); - setTextStyle(isDozing ? mLockScreenWeight : mDozingWeight/* weight */, + setTextStyle(dozeStateGetter.isDozing() ? mLockScreenWeight : mDozingWeight/* weight */, -1, null, true /* animate */, @@ -279,4 +279,8 @@ public class AnimatableClockView extends TextView { context.getResources().getConfiguration().locale); return dtpg.getBestPattern(skeleton); } + + interface DozeStateGetter { + boolean isDozing(); + } }