Rely on the dozeAmount changes for mIsDozing

The large clock view can be attached while the
doze transition is happening, so we don't want to
mistakently set mIsDozing=false from StatusBarStateController#isDozing
when we should be relying on the update from onDozeAmountChanged.

Test: manual
Fixes: 194277812
Change-Id: I202b9d845194f9d97d8ac1d6d1ff7e3f78491fd7
This commit is contained in:
Beverly
2021-07-21 10:49:41 -04:00
parent 72922c8a85
commit 346acd4920

View File

@@ -133,12 +133,16 @@ public class AnimatableClockController extends ViewController<AnimatableClockVie
}
};
@Override
protected void onInit() {
mIsDozing = mStatusBarStateController.isDozing();
}
@Override
protected void onViewAttached() {
updateLocale();
mBroadcastDispatcher.registerReceiver(mLocaleBroadcastReceiver,
new IntentFilter(Intent.ACTION_LOCALE_CHANGED));
mIsDozing = mStatusBarStateController.isDozing();
mDozeAmount = mStatusBarStateController.getDozeAmount();
mBatteryController.addCallback(mBatteryCallback);
mKeyguardUpdateMonitor.registerCallback(mKeyguardUpdateMonitorCallback);