Merge "Move doze animation until finished waking up" into udc-qpr-dev am: 46a3050cbf

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23416276

Change-Id: Ic4792ddc459cb5a5af75d969d01a984d1871f02a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2023-05-26 16:36:48 +00:00
committed by Automerger Merge Worker
2 changed files with 22 additions and 8 deletions

View File

@@ -2844,7 +2844,11 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
} }
private void updateDozingState() { 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"); Trace.beginSection("CentralSurfaces#updateDozingState");
boolean keyguardVisible = mKeyguardStateController.isVisible(); boolean keyguardVisible = mKeyguardStateController.isVisible();
@@ -3198,6 +3202,10 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
@Override @Override
public void onStartedWakingUp() { 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"; String tag = "CentralSurfaces#onStartedWakingUp";
DejankUtils.startDetectingBlockingIpcs(tag); DejankUtils.startDetectingBlockingIpcs(tag);
mNotificationShadeWindowController.batchApplyWindowLayoutParams(()-> { mNotificationShadeWindowController.batchApplyWindowLayoutParams(()-> {
@@ -3242,6 +3250,14 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
updateVisibleToUser(); updateVisibleToUser();
updateIsKeyguard(); updateIsKeyguard();
});
DejankUtils.stopDetectingBlockingIpcs(tag);
}
@Override
public void onFinishedWakingUp() {
mNotificationShadeWindowController.batchApplyWindowLayoutParams(()-> {
// stopDozing() starts the LOCKSCREEN_TRANSITION_FROM_AOD animation.
mDozeServiceHost.stopDozing(); mDozeServiceHost.stopDozing();
// This is intentionally below the stopDozing call above, since it avoids that we're // This is intentionally below the stopDozing call above, since it avoids that we're
// unnecessarily animating the wakeUp transition. Animations should only be enabled // unnecessarily animating the wakeUp transition. Animations should only be enabled
@@ -3255,13 +3271,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
if (mScreenOffAnimationController.shouldHideLightRevealScrimOnWakeUp()) { if (mScreenOffAnimationController.shouldHideLightRevealScrimOnWakeUp()) {
mShadeController.makeExpandedInvisible(); mShadeController.makeExpandedInvisible();
} }
}); });
DejankUtils.stopDetectingBlockingIpcs(tag);
}
@Override
public void onFinishedWakingUp() {
mWakeUpCoordinator.setFullyAwake(true); mWakeUpCoordinator.setFullyAwake(true);
mWakeUpCoordinator.setWakingUp(false, false); mWakeUpCoordinator.setWakingUp(false, false);
if (mKeyguardStateController.isOccluded() if (mKeyguardStateController.isOccluded()

View File

@@ -1103,8 +1103,10 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
clearInvocations(mNotificationPanelViewController); clearInvocations(mNotificationPanelViewController);
mCentralSurfaces.mWakefulnessObserver.onStartedWakingUp(); mCentralSurfaces.mWakefulnessObserver.onStartedWakingUp();
verify(mDozeServiceHost).stopDozing(); verify(mDozeServiceHost, never()).stopDozing();
verify(mNotificationPanelViewController).expand(eq(false)); verify(mNotificationPanelViewController).expand(eq(false));
mCentralSurfaces.mWakefulnessObserver.onFinishedWakingUp();
verify(mDozeServiceHost).stopDozing();
} }
@Test @Test
@@ -1118,6 +1120,8 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
mCentralSurfaces.setBouncerShowing(true); mCentralSurfaces.setBouncerShowing(true);
mCentralSurfaces.mWakefulnessObserver.onStartedWakingUp(); mCentralSurfaces.mWakefulnessObserver.onStartedWakingUp();
verify(mNotificationPanelViewController, never()).expand(anyBoolean()); verify(mNotificationPanelViewController, never()).expand(anyBoolean());
mCentralSurfaces.mWakefulnessObserver.onFinishedWakingUp();
verify(mDozeServiceHost).stopDozing();
} }
@Test @Test