Skip to content

Commit 5ec00e9

Browse files
author
Amith Yamasani
committed
Don't cancel any notifications that are meant for all users, if no package is specified.
Bug: 7490028 Otherwise notifications such as the USB debugging and OTA notifications will be dismissed when any user is stopped. Change-Id: I0ae0c1136a999dd3aade99ca9e71c714b359eab4
1 parent 512950a commit 5ec00e9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,10 @@ boolean cancelAllNotificationsInt(String pkg, int mustHaveFlags,
12611261
if (!notificationMatchesUserId(r, userId)) {
12621262
continue;
12631263
}
1264+
// Don't remove notifications to all, if there's no package name specified
1265+
if (r.userId == UserHandle.USER_ALL && pkg == null) {
1266+
continue;
1267+
}
12641268
if ((r.notification.flags & mustHaveFlags) != mustHaveFlags) {
12651269
continue;
12661270
}

0 commit comments

Comments
 (0)