From bd5bf5eaa45dfd92f0829d5bb95a14cb0f09f2ce Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Tue, 31 Jan 2017 14:37:14 -0800 Subject: [PATCH] Fixed an issue where heads-upped notifications would stay If a heads up notification was briefly removed right after it was added it could linger around in systemUI until the panel collapsed. We need to make sure not to apply this improvement if reordering isn't allowed, otherwise it will never time out Test: existing tests pass Bug: 34608075 Change-Id: I7768f6111ada30edcb997a42940e5e336efe1cf2 --- .../src/com/android/systemui/statusbar/phone/StatusBar.java | 5 ++++- 1 file changed, 4 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 018d8885842dd..e3149ffad8bff 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -1599,8 +1599,11 @@ public class StatusBar extends SystemUI implements DemoMode, if (mHeadsUpManager.isHeadsUp(key)) { // A cancel() in repsonse to a remote input shouldn't be delayed, as it makes the // sending look longer than it takes. + // Also we should not defer the removal if reordering isn't allowed since otherwise + // some notifications can't disappear before the panel is closed. boolean ignoreEarliestRemovalTime = mRemoteInputController.isSpinning(key) - && !FORCE_REMOTE_INPUT_HISTORY; + && !FORCE_REMOTE_INPUT_HISTORY + || !mVisualStabilityManager.isReorderingAllowed(); deferRemoval = !mHeadsUpManager.removeNotification(key, ignoreEarliestRemovalTime); } if (key.equals(mMediaNotificationKey)) {