Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +37 −14 Original line number Diff line number Diff line Loading @@ -2836,7 +2836,11 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { } private void updateDozingState() { Trace.traceCounter(Trace.TRACE_TAG_APP, "dozing", mDozing ? 1 : 0); if (Trace.isTagEnabled(Trace.TRACE_TAG_APP)) { Trace.asyncTraceForTrackEnd(Trace.TRACE_TAG_APP, "Dozing", 0); Trace.asyncTraceForTrackBegin(Trace.TRACE_TAG_APP, "Dozing", String.valueOf(mDozing), 0); } Trace.beginSection("CentralSurfaces#updateDozingState"); boolean keyguardVisible = mKeyguardStateController.isVisible(); Loading Loading @@ -3190,6 +3194,10 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { @Override public void onStartedWakingUp() { // Between onStartedWakingUp() and onFinishedWakingUp(), the system is changing the // display power mode. To avoid jank, animations should NOT run during these power // mode transitions, which means that whenever possible, animations should // start running during the onFinishedWakingUp() callback instead of this callback. String tag = "CentralSurfaces#onStartedWakingUp"; DejankUtils.startDetectingBlockingIpcs(tag); mNotificationShadeWindowController.batchApplyWindowLayoutParams(()-> { Loading Loading @@ -3234,6 +3242,20 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { updateVisibleToUser(); updateIsKeyguard(); if (!mFeatureFlags.isEnabled(Flags.ZJ_285570694_LOCKSCREEN_TRANSITION_FROM_AOD)) { 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() depending * on a flag value. */ 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 Loading @@ -3247,13 +3269,14 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { if (mScreenOffAnimationController.shouldHideLightRevealScrimOnWakeUp()) { mShadeController.makeExpandedInvisible(); } }); DejankUtils.stopDetectingBlockingIpcs(tag); } @Override public void onFinishedWakingUp() { if (mFeatureFlags.isEnabled(Flags.ZJ_285570694_LOCKSCREEN_TRANSITION_FROM_AOD)) { mNotificationShadeWindowController.batchApplyWindowLayoutParams( this::startLockscreenTransitionFromAod); } mWakeUpCoordinator.setFullyAwake(true); mWakeUpCoordinator.setWakingUp(false, false); if (mKeyguardStateController.isOccluded() Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java +6 −1 Original line number Diff line number Diff line Loading @@ -350,6 +350,7 @@ 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); mFeatureFlags.set(Flags.ZJ_285570694_LOCKSCREEN_TRANSITION_FROM_AOD, true); IThermalService thermalService = mock(IThermalService.class); mPowerManager = new PowerManager(mContext, mPowerManagerService, thermalService, Loading Loading @@ -1103,8 +1104,10 @@ public class CentralSurfacesImplTest extends SysuiTestCase { clearInvocations(mNotificationPanelViewController); mCentralSurfaces.mWakefulnessObserver.onStartedWakingUp(); verify(mDozeServiceHost).stopDozing(); verify(mDozeServiceHost, never()).stopDozing(); verify(mNotificationPanelViewController).expand(eq(false)); mCentralSurfaces.mWakefulnessObserver.onFinishedWakingUp(); verify(mDozeServiceHost).stopDozing(); } @Test Loading @@ -1118,6 +1121,8 @@ public class CentralSurfacesImplTest extends SysuiTestCase { mCentralSurfaces.setBouncerShowing(true); mCentralSurfaces.mWakefulnessObserver.onStartedWakingUp(); verify(mNotificationPanelViewController, never()).expand(anyBoolean()); mCentralSurfaces.mWakefulnessObserver.onFinishedWakingUp(); verify(mDozeServiceHost).stopDozing(); } @Test Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +37 −14 Original line number Diff line number Diff line Loading @@ -2836,7 +2836,11 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { } private void updateDozingState() { Trace.traceCounter(Trace.TRACE_TAG_APP, "dozing", mDozing ? 1 : 0); if (Trace.isTagEnabled(Trace.TRACE_TAG_APP)) { Trace.asyncTraceForTrackEnd(Trace.TRACE_TAG_APP, "Dozing", 0); Trace.asyncTraceForTrackBegin(Trace.TRACE_TAG_APP, "Dozing", String.valueOf(mDozing), 0); } Trace.beginSection("CentralSurfaces#updateDozingState"); boolean keyguardVisible = mKeyguardStateController.isVisible(); Loading Loading @@ -3190,6 +3194,10 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { @Override public void onStartedWakingUp() { // Between onStartedWakingUp() and onFinishedWakingUp(), the system is changing the // display power mode. To avoid jank, animations should NOT run during these power // mode transitions, which means that whenever possible, animations should // start running during the onFinishedWakingUp() callback instead of this callback. String tag = "CentralSurfaces#onStartedWakingUp"; DejankUtils.startDetectingBlockingIpcs(tag); mNotificationShadeWindowController.batchApplyWindowLayoutParams(()-> { Loading Loading @@ -3234,6 +3242,20 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { updateVisibleToUser(); updateIsKeyguard(); if (!mFeatureFlags.isEnabled(Flags.ZJ_285570694_LOCKSCREEN_TRANSITION_FROM_AOD)) { 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() depending * on a flag value. */ 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 Loading @@ -3247,13 +3269,14 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { if (mScreenOffAnimationController.shouldHideLightRevealScrimOnWakeUp()) { mShadeController.makeExpandedInvisible(); } }); DejankUtils.stopDetectingBlockingIpcs(tag); } @Override public void onFinishedWakingUp() { if (mFeatureFlags.isEnabled(Flags.ZJ_285570694_LOCKSCREEN_TRANSITION_FROM_AOD)) { mNotificationShadeWindowController.batchApplyWindowLayoutParams( this::startLockscreenTransitionFromAod); } mWakeUpCoordinator.setFullyAwake(true); mWakeUpCoordinator.setWakingUp(false, false); if (mKeyguardStateController.isOccluded() Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java +6 −1 Original line number Diff line number Diff line Loading @@ -350,6 +350,7 @@ 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); mFeatureFlags.set(Flags.ZJ_285570694_LOCKSCREEN_TRANSITION_FROM_AOD, true); IThermalService thermalService = mock(IThermalService.class); mPowerManager = new PowerManager(mContext, mPowerManagerService, thermalService, Loading Loading @@ -1103,8 +1104,10 @@ public class CentralSurfacesImplTest extends SysuiTestCase { clearInvocations(mNotificationPanelViewController); mCentralSurfaces.mWakefulnessObserver.onStartedWakingUp(); verify(mDozeServiceHost).stopDozing(); verify(mDozeServiceHost, never()).stopDozing(); verify(mNotificationPanelViewController).expand(eq(false)); mCentralSurfaces.mWakefulnessObserver.onFinishedWakingUp(); verify(mDozeServiceHost).stopDozing(); } @Test Loading @@ -1118,6 +1121,8 @@ public class CentralSurfacesImplTest extends SysuiTestCase { mCentralSurfaces.setBouncerShowing(true); mCentralSurfaces.mWakefulnessObserver.onStartedWakingUp(); verify(mNotificationPanelViewController, never()).expand(anyBoolean()); mCentralSurfaces.mWakefulnessObserver.onFinishedWakingUp(); verify(mDozeServiceHost).stopDozing(); } @Test Loading