am 2323ec7e: Merge "Notifications: Hide ticker updates from background users." into jb-mr1-dev

* commit '2323ec7ee1fb614950f2f6891514964d07fd0bd4':
  Notifications: Hide ticker updates from background users.
This commit is contained in:
John Spurlock
2012-09-10 11:09:21 -07:00
committed by Android Git Automerger
2 changed files with 8 additions and 1 deletions

View File

@@ -1041,8 +1041,12 @@ public abstract class BaseStatusBar extends SystemUI implements
// swipe-dismissable) // swipe-dismissable)
updateNotificationVetoButton(oldEntry.row, notification); updateNotificationVetoButton(oldEntry.row, notification);
// Is this for you?
boolean isForCurrentUser = notificationIsForCurrentUser(notification);
if (DEBUG) Slog.d(TAG, "notification is " + (isForCurrentUser ? "" : "not ") + "for you");
// Restart the ticker if it's still running // Restart the ticker if it's still running
if (updateTicker) { if (updateTicker && isForCurrentUser) {
haltTicker(); haltTicker();
tick(key, notification, false); tick(key, notification, false);
} }

View File

@@ -1426,6 +1426,9 @@ public class PhoneStatusBar extends BaseStatusBar {
// no ticking in Setup // no ticking in Setup
if (!isDeviceProvisioned()) return; if (!isDeviceProvisioned()) return;
// not for you
if (!notificationIsForCurrentUser(n)) return;
// Show the ticker if one is requested. Also don't do this // Show the ticker if one is requested. Also don't do this
// until status bar window is attached to the window manager, // until status bar window is attached to the window manager,
// because... well, what's the point otherwise? And trying to // because... well, what's the point otherwise? And trying to