Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1570bab authored by Peter Kalauskas's avatar Peter Kalauskas
Browse files

Only delay wake-up animation if AOD is enabled

Bug: 286880921
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
Merged-In: I36707ca64cab8c7c719a9665ae3e494fb3307ee8
parent 0bd2ce4e
Loading
Loading
Loading
Loading
+13 −4
Original line number Original line Diff line number Diff line
@@ -475,6 +475,13 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
     */
     */
    private boolean mShouldDelayWakeUpAnimation = false;
    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 Object mQueueLock = new Object();


    private final PulseExpansionHandler mPulseExpansionHandler;
    private final PulseExpansionHandler mPulseExpansionHandler;
@@ -3242,7 +3249,10 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {


                updateVisibleToUser();
                updateVisibleToUser();
                updateIsKeyguard();
                updateIsKeyguard();
                if (!mFeatureFlags.isEnabled(Flags.ZJ_285570694_LOCKSCREEN_TRANSITION_FROM_AOD)) {
                mShouldDelayLockscreenTransitionFromAod = mDozeParameters.getAlwaysOn()
                        && mFeatureFlags.isEnabled(
                                Flags.ZJ_285570694_LOCKSCREEN_TRANSITION_FROM_AOD);
                if (!mShouldDelayLockscreenTransitionFromAod) {
                    startLockscreenTransitionFromAod();
                    startLockscreenTransitionFromAod();
                }
                }
            });
            });
@@ -3251,8 +3261,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {


        /**
        /**
         * Private helper for starting the LOCKSCREEN_TRANSITION_FROM_AOD animation - only necessary
         * Private helper for starting the LOCKSCREEN_TRANSITION_FROM_AOD animation - only necessary
         * so we can start it from either onFinishedWakingUp() or onFinishedWakingUp() depending
         * so we can start it from either onFinishedWakingUp() or onFinishedWakingUp().
         * on a flag value.
         */
         */
        private void startLockscreenTransitionFromAod() {
        private void startLockscreenTransitionFromAod() {
            // stopDozing() starts the LOCKSCREEN_TRANSITION_FROM_AOD animation.
            // stopDozing() starts the LOCKSCREEN_TRANSITION_FROM_AOD animation.
@@ -3273,7 +3282,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {


        @Override
        @Override
        public void onFinishedWakingUp() {
        public void onFinishedWakingUp() {
            if (mFeatureFlags.isEnabled(Flags.ZJ_285570694_LOCKSCREEN_TRANSITION_FROM_AOD)) {
            if (mShouldDelayLockscreenTransitionFromAod) {
                mNotificationShadeWindowController.batchApplyWindowLayoutParams(
                mNotificationShadeWindowController.batchApplyWindowLayoutParams(
                        this::startLockscreenTransitionFromAod);
                        this::startLockscreenTransitionFromAod);
            }
            }
+2 −0
Original line number Original line Diff line number Diff line
@@ -350,7 +350,9 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
        // For the Shade to animate during the Back gesture, we must enable the animation flag.
        // 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.WM_SHADE_ANIMATE_BACK_GESTURE, true);
        mFeatureFlags.set(Flags.LIGHT_REVEAL_MIGRATION, 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);
        mFeatureFlags.set(Flags.ZJ_285570694_LOCKSCREEN_TRANSITION_FROM_AOD, true);
        when(mDozeParameters.getAlwaysOn()).thenReturn(true);


        IThermalService thermalService = mock(IThermalService.class);
        IThermalService thermalService = mock(IThermalService.class);
        mPowerManager = new PowerManager(mContext, mPowerManagerService, thermalService,
        mPowerManager = new PowerManager(mContext, mPowerManagerService, thermalService,