From 9dfca59fe7e5eae92bc6fa72882cbb1462cc31ef Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Wed, 22 May 2019 18:04:03 -0700 Subject: [PATCH] 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 --- .../src/com/android/systemui/statusbar/phone/StatusBar.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 3146595f35927..0185ca442da27 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -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() {