Merge "Update light reveal effect on wake/sleep so that the screen off animation works too." into sc-dev
This commit is contained in:
@@ -3896,15 +3896,6 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
updateQsExpansionEnabled();
|
updateQsExpansionEnabled();
|
||||||
mKeyguardViewMediator.setDozing(mDozing);
|
mKeyguardViewMediator.setDozing(mDozing);
|
||||||
|
|
||||||
if ((isDozing && mWakefulnessLifecycle.getLastSleepReason()
|
|
||||||
== PowerManager.GO_TO_SLEEP_REASON_POWER_BUTTON)
|
|
||||||
|| (!isDozing && mWakefulnessLifecycle.getLastWakeReason()
|
|
||||||
== PowerManager.WAKE_REASON_POWER_BUTTON)) {
|
|
||||||
mLightRevealScrim.setRevealEffect(mPowerButtonReveal);
|
|
||||||
} else if (!(mLightRevealScrim.getRevealEffect() instanceof CircleReveal)) {
|
|
||||||
mLightRevealScrim.setRevealEffect(LiftReveal.INSTANCE);
|
|
||||||
}
|
|
||||||
|
|
||||||
mNotificationsController.requestNotificationUpdate("onDozingChanged");
|
mNotificationsController.requestNotificationUpdate("onDozingChanged");
|
||||||
updateDozingState();
|
updateDozingState();
|
||||||
mDozeServiceHost.updateDozing();
|
mDozeServiceHost.updateDozing();
|
||||||
@@ -3913,6 +3904,27 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
Trace.endSection();
|
Trace.endSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the light reveal effect to reflect the reason we're waking or sleeping (for example,
|
||||||
|
* from the power button).
|
||||||
|
* @param wakingUp Whether we're updating because we're waking up (true) or going to sleep
|
||||||
|
* (false).
|
||||||
|
*/
|
||||||
|
private void updateRevealEffect(boolean wakingUp) {
|
||||||
|
if (mLightRevealScrim == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wakingUp && mWakefulnessLifecycle.getLastWakeReason()
|
||||||
|
== PowerManager.WAKE_REASON_POWER_BUTTON
|
||||||
|
|| !wakingUp && mWakefulnessLifecycle.getLastSleepReason()
|
||||||
|
== PowerManager.GO_TO_SLEEP_REASON_POWER_BUTTON) {
|
||||||
|
mLightRevealScrim.setRevealEffect(mPowerButtonReveal);
|
||||||
|
} else if (!(mLightRevealScrim.getRevealEffect() instanceof CircleReveal)) {
|
||||||
|
mLightRevealScrim.setRevealEffect(LiftReveal.INSTANCE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public LightRevealScrim getLightRevealScrim() {
|
public LightRevealScrim getLightRevealScrim() {
|
||||||
return mLightRevealScrim;
|
return mLightRevealScrim;
|
||||||
}
|
}
|
||||||
@@ -4045,6 +4057,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
public void onStartedGoingToSleep() {
|
public void onStartedGoingToSleep() {
|
||||||
String tag = "StatusBar#onStartedGoingToSleep";
|
String tag = "StatusBar#onStartedGoingToSleep";
|
||||||
DejankUtils.startDetectingBlockingIpcs(tag);
|
DejankUtils.startDetectingBlockingIpcs(tag);
|
||||||
|
updateRevealEffect(false /* wakingUp */);
|
||||||
updateNotificationPanelTouchState();
|
updateNotificationPanelTouchState();
|
||||||
notifyHeadsUpGoingToSleep();
|
notifyHeadsUpGoingToSleep();
|
||||||
dismissVolumeDialog();
|
dismissVolumeDialog();
|
||||||
@@ -4076,6 +4089,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
|||||||
// 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
|
||||||
// once we fully woke up.
|
// once we fully woke up.
|
||||||
|
updateRevealEffect(true /* wakingUp */);
|
||||||
updateNotificationPanelTouchState();
|
updateNotificationPanelTouchState();
|
||||||
mPulseExpansionHandler.onStartedWakingUp();
|
mPulseExpansionHandler.onStartedWakingUp();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user