Skip to content

Commit 8637bd9

Browse files
committed
Only play notification sounds for active user.
Bug: 7298302 Change-Id: I1e176f7b17bb51b878f2e8b345804780df92d487
1 parent 26bf1a7 commit 8637bd9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

services/java/com/android/server/NotificationManagerService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,8 @@ public void enqueueNotificationInternal(String pkg, int callingUid, int callingP
10331033
if (((mDisabledNotifications & StatusBarManager.DISABLE_NOTIFICATION_ALERTS) == 0)
10341034
&& (!(old != null
10351035
&& (notification.flags & Notification.FLAG_ONLY_ALERT_ONCE) != 0 ))
1036-
&& (r.userId == UserHandle.USER_ALL || r.userId == userId)
1036+
&& (r.userId == UserHandle.USER_ALL ||
1037+
(r.userId == userId && r.userId == ActivityManager.getCurrentUser()))
10371038
&& mSystemReady) {
10381039

10391040
final AudioManager audioManager = (AudioManager) mContext

0 commit comments

Comments
 (0)