Merge "Changing the ordering for heads up notifications" into mnc-dr-dev

am: 688e046bad

* commit '688e046bad87cc722e8571b8f4180604623239a8':
  Changing the ordering for heads up notifications
This commit is contained in:
Selim Cinek
2015-10-21 20:45:17 +00:00
committed by android-build-merger

View File

@@ -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;