Fix issue where notifications should not animate

Displays that take a long time to turn off should not animate
the notification panel expanding and collapsing when pressing
power.

In this case, onDozeChanged was arriving before animations
could be disabled, causing NSSL to create position animstions
instead of just setting them atommically.

Test: press power from LS or home on two different types of devices
Fixes: 132719955
Change-Id: I51fa046d38835866f6890f44bb6bacd4d5ff2a95
This commit is contained in:
Lucas Dupin
2019-05-22 18:04:03 -07:00
parent f36fee3cf7
commit 9dfca59fe7

View File

@@ -3623,6 +3623,7 @@ public class StatusBar extends SystemUI implements DemoMode,
@Override
public void onStartedGoingToSleep() {
updateNotificationPanelTouchState();
notifyHeadsUpGoingToSleep();
dismissVolumeDialog();
}
@@ -3655,7 +3656,10 @@ public class StatusBar extends SystemUI implements DemoMode,
* Keyguard.
*/
private void updateNotificationPanelTouchState() {
mNotificationPanel.setTouchAndAnimationDisabled(!mDeviceInteractive && !mPulsing);
boolean goingToSleepWithoutAnimation = isGoingToSleep()
&& !DozeParameters.getInstance(mContext).shouldControlScreenOff();
mNotificationPanel.setTouchAndAnimationDisabled((!mDeviceInteractive && !mPulsing)
|| goingToSleepWithoutAnimation);
}
final ScreenLifecycle.Observer mScreenObserver = new ScreenLifecycle.Observer() {