Only delay wake-up animation if AOD is enabled

Also, use ZJ_285570694_LOCKSCREEN_TRANSITION_FROM_AOD flag for
LOCKSCREEN_TRANSITION_FROM_AOD zero jank fixes.

Bug: 286880921
Bug: 285623104
Bug: 285570694
Bug: 193615254
Test: Disable AOD, use analog clock, turn screen off then on. Ensure
      that analog AOD clock does not briefly flicker on display.
Change-Id: I36707ca64cab8c7c719a9665ae3e494fb3307ee8
This commit is contained in:
Peter Kalauskas
2023-05-16 17:09:24 -07:00
parent f312e919f8
commit 7734c763ed
2 changed files with 41 additions and 16 deletions

View File

@@ -456,6 +456,13 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
*/
private boolean mShouldDelayWakeUpAnimation = false;
/**
* Whether we should delay the AOD->Lockscreen animation.
* If false, the animation will start in onStartedWakingUp().
* If true, the animation will start in onFinishedWakingUp().
*/
private boolean mShouldDelayLockscreenTransitionFromAod = false;
private final Object mQueueLock = new Object();
private final PulseExpansionHandler mPulseExpansionHandler;
@@ -3077,28 +3084,43 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
updateVisibleToUser();
updateIsKeyguard();
mShouldDelayLockscreenTransitionFromAod = mDozeParameters.getAlwaysOn()
&& mFeatureFlags.isEnabled(
Flags.ZJ_285570694_LOCKSCREEN_TRANSITION_FROM_AOD);
if (!mShouldDelayLockscreenTransitionFromAod) {
startLockscreenTransitionFromAod();
}
});
DejankUtils.stopDetectingBlockingIpcs(tag);
}
/**
* Private helper for starting the LOCKSCREEN_TRANSITION_FROM_AOD animation - only necessary
* so we can start it from either onFinishedWakingUp() or onFinishedWakingUp().
*/
private void startLockscreenTransitionFromAod() {
// stopDozing() starts the LOCKSCREEN_TRANSITION_FROM_AOD animation.
mDozeServiceHost.stopDozing();
// This is intentionally below the stopDozing call above, since it avoids that we're
// unnecessarily animating the wakeUp transition. Animations should only be enabled
// once we fully woke up.
updateRevealEffect(true /* wakingUp */);
updateNotificationPanelTouchState();
mStatusBarTouchableRegionManager.updateTouchableRegion();
// If we are waking up during the screen off animation, we should undo making the
// expanded visible (we did that so the LightRevealScrim would be visible).
if (mScreenOffAnimationController.shouldHideLightRevealScrimOnWakeUp()) {
mShadeController.makeExpandedInvisible();
}
}
@Override
public void onFinishedWakingUp() {
mNotificationShadeWindowController.batchApplyWindowLayoutParams(()-> {
// stopDozing() starts the LOCKSCREEN_TRANSITION_FROM_AOD animation.
mDozeServiceHost.stopDozing();
// This is intentionally below the stopDozing call above, since it avoids that we're
// unnecessarily animating the wakeUp transition. Animations should only be enabled
// once we fully woke up.
updateRevealEffect(true /* wakingUp */);
updateNotificationPanelTouchState();
mStatusBarTouchableRegionManager.updateTouchableRegion();
// If we are waking up during the screen off animation, we should undo making the
// expanded visible (we did that so the LightRevealScrim would be visible).
if (mScreenOffAnimationController.shouldHideLightRevealScrimOnWakeUp()) {
mShadeController.makeExpandedInvisible();
}
});
if (mShouldDelayLockscreenTransitionFromAod) {
mNotificationShadeWindowController.batchApplyWindowLayoutParams(
this::startLockscreenTransitionFromAod);
}
mWakeUpCoordinator.setFullyAwake(true);
mWakeUpCoordinator.setWakingUp(false, false);
if (mKeyguardStateController.isOccluded()

View File

@@ -353,6 +353,9 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
// For the Shade to animate during the Back gesture, we must enable the animation flag.
mFeatureFlags.set(Flags.WM_SHADE_ANIMATE_BACK_GESTURE, true);
mFeatureFlags.set(Flags.LIGHT_REVEAL_MIGRATION, true);
// Turn AOD on and toggle feature flag for jank fixes
mFeatureFlags.set(Flags.ZJ_285570694_LOCKSCREEN_TRANSITION_FROM_AOD, true);
when(mDozeParameters.getAlwaysOn()).thenReturn(true);
IThermalService thermalService = mock(IThermalService.class);
mPowerManager = new PowerManager(mContext, mPowerManagerService, thermalService,