diff options
| author | 2012-10-10 14:58:28 -0700 | |
|---|---|---|
| committer | 2012-10-10 14:58:33 -0700 | |
| commit | c31ed39e7a5a8c709aa5f356cb5bcb563b059d65 (patch) | |
| tree | 8cb471188d538b5a3765bc331965c943709fa8ef | |
| parent | 96179213ba1b2b3fc0e7d527ac606eba511bc558 (diff) | |
Send accessibility notification events only for the current user.
1. The notification manager service is firing accessibility events
for notification for a background user. Events for the current
user's notifications should be sent.
bug:7326302
Change-Id: I00665385ba2106f161928dad1b76536c93c17f27
| -rwxr-xr-x | services/java/com/android/server/NotificationManagerService.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java index 85b488c9e1a2..93ae0295e297 100755 --- a/services/java/com/android/server/NotificationManagerService.java +++ b/services/java/com/android/server/NotificationManagerService.java @@ -991,6 +991,14 @@ public class NotificationManagerService extends INotificationManager.Stub | Notification.FLAG_NO_CLEAR; } + final int currentUser; + final long token = Binder.clearCallingIdentity(); + try { + currentUser = ActivityManager.getCurrentUser(); + } finally { + Binder.restoreCallingIdentity(token); + } + if (notification.icon != 0) { final StatusBarNotification n = new StatusBarNotification( pkg, id, tag, r.uid, r.initialPid, score, notification, user); @@ -1015,7 +1023,10 @@ public class NotificationManagerService extends INotificationManager.Stub Binder.restoreCallingIdentity(identity); } } - sendAccessibilityEvent(notification, pkg); + // Send accessibility events only for the current user. + if (currentUser == userId) { + sendAccessibilityEvent(notification, pkg); + } } else { Slog.e(TAG, "Ignoring notification with icon==0: " + notification); if (old != null && old.statusBarKey != null) { @@ -1029,14 +1040,6 @@ public class NotificationManagerService extends INotificationManager.Stub } } - final int currentUser; - final long token = Binder.clearCallingIdentity(); - try { - currentUser = ActivityManager.getCurrentUser(); - } finally { - Binder.restoreCallingIdentity(token); - } - // If we're not supposed to beep, vibrate, etc. then don't. if (((mDisabledNotifications & StatusBarManager.DISABLE_NOTIFICATION_ALERTS) == 0) && (!(old != null |