am d7eece34: Merge "Clear identity when requesting current user." into jb-mr1-dev

* commit 'd7eece3448122fa668cdb386cd47cd1402d12012':
  Clear identity when requesting current user.
This commit is contained in:
Jeff Sharkey
2012-10-05 16:16:00 -07:00
committed by Android Git Automerger

View File

@@ -1029,12 +1029,20 @@ 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
&& (notification.flags & Notification.FLAG_ONLY_ALERT_ONCE) != 0 ))
&& (r.userId == UserHandle.USER_ALL ||
(r.userId == userId && r.userId == ActivityManager.getCurrentUser()))
(r.userId == userId && r.userId == currentUser))
&& mSystemReady) {
final AudioManager audioManager = (AudioManager) mContext