From 2ae7107d0e9cde3e88c7313cf4dbcebbd171597e Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Tue, 20 Oct 2015 16:07:12 -0700 Subject: Changing the ordering for heads up notifications In the new ranking, notifications with fullscreen intents always take priority over those without, such that when you get a call and a message in succession, you would always see the call on top and are able to pick it up. Bug: 22778349 Change-Id: Ia9aaf009998fc9493f513dc71f2649d38ccf7a79 --- .../src/com/android/systemui/statusbar/policy/HeadsUpManager.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'packages') diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java index 299f20e..4a95d3a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java @@ -582,6 +582,13 @@ public class HeadsUpManager implements ViewTreeObserver.OnComputeInternalInsetsL @Override public int compareTo(HeadsUpEntry o) { + boolean selfFullscreen = hasFullScreenIntent(entry); + boolean otherFullscreen = hasFullScreenIntent(o.entry); + if (selfFullscreen && !otherFullscreen) { + return -1; + } else if (!selfFullscreen && otherFullscreen) { + return 1; + } return postTime < o.postTime ? 1 : postTime == o.postTime ? entry.key.compareTo(o.entry.key) : -1; -- cgit v1.1