diff options
author | Daniel Sandler <dsandler@google.com> | 2011-02-02 22:00:28 -0500 |
---|---|---|
committer | Daniel Sandler <dsandler@google.com> | 2011-02-03 01:01:20 -0500 |
commit | a31e4190cb44eaa51bb8dee7d715fcd72d6c0b03 (patch) | |
tree | 3f04b4dcc33e4e558c658b589e44cb7fa7fb8032 /core/java/com | |
parent | e9dea7b735fb0fdb1956d96a6e78b1c5cd666316 (diff) | |
download | frameworks_base-a31e4190cb44eaa51bb8dee7d715fcd72d6c0b03.zip frameworks_base-a31e4190cb44eaa51bb8dee7d715fcd72d6c0b03.tar.gz frameworks_base-a31e4190cb44eaa51bb8dee7d715fcd72d6c0b03.tar.bz2 |
Implement priority ordering in notifications.
Ongoings are the only notifications currently given higher
priority (and it's in an internal data structure, not a
public API, so fear not about abuse---this will be no worse
than on the phone where ongoings floated to the top).
The only thing left is to give privileged customers a way to
alter the priority of their notifications.
Bug: 3412807
Bug: 3146719
Change-Id: I9e738cc413982845cf4858faa8ccd0a7dbf3187c
Diffstat (limited to 'core/java/com')
-rw-r--r-- | core/java/com/android/internal/statusbar/StatusBarNotification.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/core/java/com/android/internal/statusbar/StatusBarNotification.java b/core/java/com/android/internal/statusbar/StatusBarNotification.java index 2b96bf6..cb791be 100644 --- a/core/java/com/android/internal/statusbar/StatusBarNotification.java +++ b/core/java/com/android/internal/statusbar/StatusBarNotification.java @@ -35,12 +35,18 @@ if (truncatedTicker != null && truncatedTicker.length() > maxTickerLen) { */ public class StatusBarNotification implements Parcelable { + public static int PRIORITY_JIFFY_EXPRESS = -100; + public static int PRIORITY_NORMAL = 0; + public static int PRIORITY_ONGOING = 100; + public static int PRIORITY_SYSTEM = 200; + public String pkg; public int id; public String tag; public int uid; public int initialPid; public Notification notification; + public int priority = PRIORITY_NORMAL; public StatusBarNotification() { } @@ -56,6 +62,9 @@ public class StatusBarNotification implements Parcelable { this.uid = uid; this.initialPid = initialPid; this.notification = notification; + + this.priority = ((notification.flags & Notification.FLAG_ONGOING_EVENT) != 0) + ? PRIORITY_ONGOING : PRIORITY_NORMAL; } public StatusBarNotification(Parcel in) { @@ -72,6 +81,7 @@ public class StatusBarNotification implements Parcelable { } this.uid = in.readInt(); this.initialPid = in.readInt(); + this.priority = in.readInt(); this.notification = new Notification(in); } @@ -86,6 +96,7 @@ public class StatusBarNotification implements Parcelable { } out.writeInt(this.uid); out.writeInt(this.initialPid); + out.writeInt(this.priority); this.notification.writeToParcel(out, flags); } @@ -114,7 +125,7 @@ public class StatusBarNotification implements Parcelable { public String toString() { return "StatusBarNotification(package=" + pkg + " id=" + id + " tag=" + tag - + " notification=" + notification + ")"; + + " notification=" + notification + " priority=" + priority + ")"; } public boolean isOngoing() { |