diff options
author | Joe Onorato <joeo@android.com> | 2010-05-17 22:26:12 -0700 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2010-06-02 14:48:43 -0700 |
commit | 18e69dfc7235f8a4bfe257f9d1c43539049a22ce (patch) | |
tree | da47804d8acd8680cfdd0fb8fa33dad6e01889c1 /services/java/com/android/server/NotificationManagerService.java | |
parent | 6528b35585020fafe7e39dfa416f728df5158c63 (diff) | |
download | frameworks_base-18e69dfc7235f8a4bfe257f9d1c43539049a22ce.zip frameworks_base-18e69dfc7235f8a4bfe257f9d1c43539049a22ce.tar.gz frameworks_base-18e69dfc7235f8a4bfe257f9d1c43539049a22ce.tar.bz2 |
Checkpoint. Data structures for Notifications in place.
Change-Id: I146fb9bc1d349112541368e2c99a667821dfdf6e
Diffstat (limited to 'services/java/com/android/server/NotificationManagerService.java')
-rwxr-xr-x | services/java/com/android/server/NotificationManagerService.java | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java index 327e18b..d3fbd6d 100755 --- a/services/java/com/android/server/NotificationManagerService.java +++ b/services/java/com/android/server/NotificationManagerService.java @@ -17,7 +17,7 @@ package com.android.server; import com.android.server.status.IconData; -import com.android.server.status.NotificationData; +import com.android.internal.statusbar.StatusBarNotification; import com.android.server.status.StatusBarManagerService; import android.app.ActivityManagerNative; @@ -705,36 +705,12 @@ class NotificationManagerService extends INotificationManager.Stub } if (notification.icon != 0) { - IconData icon = IconData.makeIcon(null, pkg, notification.icon, - notification.iconLevel, - notification.number); - CharSequence truncatedTicker = notification.tickerText; - - // TODO: make this restriction do something smarter like never fill - // more than two screens. "Why would anyone need more than 80 characters." :-/ - final int maxTickerLen = 80; - if (truncatedTicker != null && truncatedTicker.length() > maxTickerLen) { - truncatedTicker = truncatedTicker.subSequence(0, maxTickerLen); - } - - NotificationData n = new NotificationData(); - n.pkg = pkg; - n.tag = tag; - n.id = id; - n.when = notification.when; - n.tickerText = truncatedTicker; - n.ongoingEvent = (notification.flags & Notification.FLAG_ONGOING_EVENT) != 0; - if (!n.ongoingEvent && (notification.flags & Notification.FLAG_NO_CLEAR) == 0) { - n.clearable = true; - } - n.contentView = notification.contentView; - n.contentIntent = notification.contentIntent; - n.deleteIntent = notification.deleteIntent; + StatusBarNotification n = new StatusBarNotification(pkg, id, tag, notification); if (old != null && old.statusBarKey != null) { r.statusBarKey = old.statusBarKey; long identity = Binder.clearCallingIdentity(); try { - mStatusBar.updateNotification(r.statusBarKey, icon, n); + mStatusBar.updateNotification(r.statusBarKey, n); } finally { Binder.restoreCallingIdentity(identity); @@ -742,16 +718,14 @@ class NotificationManagerService extends INotificationManager.Stub } else { long identity = Binder.clearCallingIdentity(); try { - r.statusBarKey = mStatusBar.addNotification(icon, n); + r.statusBarKey = mStatusBar.addNotification(n); mAttentionLight.pulse(); } finally { Binder.restoreCallingIdentity(identity); } } - sendAccessibilityEvent(notification, pkg); - } else { if (old != null && old.statusBarKey != null) { long identity = Binder.clearCallingIdentity(); |