diff options
author | Chris Wren <cwren@android.com> | 2013-08-07 16:43:43 -0400 |
---|---|---|
committer | Chris Wren <cwren@android.com> | 2013-08-08 07:16:38 -0400 |
commit | f0048ce66fa7b4859b44badc8e58ea8b27e2356b (patch) | |
tree | 36b8c9926c96d3d61fa653910031041c078968f0 /packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java | |
parent | d4db6cbc0fa5b3b1ff7ea18f7b861f0753518e4f (diff) | |
download | frameworks_base-f0048ce66fa7b4859b44badc8e58ea8b27e2356b.zip frameworks_base-f0048ce66fa7b4859b44badc8e58ea8b27e2356b.tar.gz frameworks_base-f0048ce66fa7b4859b44badc8e58ea8b27e2356b.tar.bz2 |
heads up notifications always take the top spot
If it was important enough to be a heads up, it should get top spot.
Make this sticky so bumping out of the HUN doesn't require a shade sort.
Split view creation and insertion so we can get the shade order correct.
Bug: 10001616
Change-Id: I4c1f2581e11a94241269984a01b92289a8943065
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java index 23950fc..5264998 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java @@ -39,6 +39,7 @@ public class NotificationData { public View expanded; // the inflated RemoteViews public ImageView largeIcon; private View expandedBig; + private boolean interruption; public Entry() {} public Entry(IBinder key, StatusBarNotification n, StatusBarIconView ic) { this.key = key; @@ -58,6 +59,10 @@ public class NotificationData { public void setUserLocked(boolean userLocked) { row.setUserLocked(userLocked); } + + public void setInterruption() { + interruption = true; + } } private final ArrayList<Entry> mEntries = new ArrayList<Entry>(); private final Comparator<Entry> mEntryCmp = new Comparator<Entry>() { @@ -66,9 +71,13 @@ public class NotificationData { final StatusBarNotification na = a.notification; final StatusBarNotification nb = b.notification; int d = na.getScore() - nb.getScore(); - return (d != 0) - ? d - : (int)(na.getNotification().when - nb.getNotification().when); + if (a.interruption != b.interruption) { + return a.interruption ? 1 : -1; + } else if (d != 0) { + return d; + } else { + return (int) (na.getNotification().when - nb.getNotification().when); + } } }; |