Loading core/java/android/app/NotificationManager.java +6 −1 Original line number Diff line number Diff line Loading @@ -1838,12 +1838,17 @@ public class NotificationManager { * Recover a list of active notifications: ones that have been posted by the calling app that * have not yet been dismissed by the user or {@link #cancel(String, int)}ed by the app. * * Each notification is embedded in a {@link StatusBarNotification} object, including the * <p><Each notification is embedded in a {@link StatusBarNotification} object, including the * original <code>tag</code> and <code>id</code> supplied to * {@link #notify(String, int, Notification) notify()} * (via {@link StatusBarNotification#getTag() getTag()} and * {@link StatusBarNotification#getId() getId()}) as well as a copy of the original * {@link Notification} object (via {@link StatusBarNotification#getNotification()}). * </p> * <p>From {@link Build.VERSION_CODES#Q}, will also return notifications you've posted as an * app's notification delegate via * {@link NotificationManager#notifyAsPackage(String, String, int, Notification)}. * </p> * * @return An array of {@link StatusBarNotification}. */ Loading services/core/java/com/android/server/notification/NotificationManagerService.java +16 −10 Original line number Diff line number Diff line Loading @@ -2647,6 +2647,10 @@ public class NotificationManagerService extends SystemService { * Note that since notification posting is done asynchronously, this will not return * notifications that are in the process of being posted. * * From {@link Build.VERSION_CODES#Q}, will also return notifications you've posted as * an app's notification delegate via * {@link NotificationManager#notifyAsPackage(String, String, int, Notification)}. * * @returns A list of all the package's notifications, in natural order. */ @Override Loading Loading @@ -2689,7 +2693,8 @@ public class NotificationManagerService extends SystemService { private StatusBarNotification sanitizeSbn(String pkg, int userId, StatusBarNotification sbn) { if (sbn.getPackageName().equals(pkg) && sbn.getUserId() == userId) { if (sbn.getUserId() == userId) { if (sbn.getPackageName().equals(pkg) || sbn.getOpPkg().equals(pkg)) { // We could pass back a cloneLight() but clients might get confused and // try to send this thing back to notify() again, which would not work // very well. Loading @@ -2700,6 +2705,7 @@ public class NotificationManagerService extends SystemService { sbn.getNotification().clone(), sbn.getUser(), sbn.getOverrideGroupKey(), sbn.getPostTime()); } } return null; } Loading Loading
core/java/android/app/NotificationManager.java +6 −1 Original line number Diff line number Diff line Loading @@ -1838,12 +1838,17 @@ public class NotificationManager { * Recover a list of active notifications: ones that have been posted by the calling app that * have not yet been dismissed by the user or {@link #cancel(String, int)}ed by the app. * * Each notification is embedded in a {@link StatusBarNotification} object, including the * <p><Each notification is embedded in a {@link StatusBarNotification} object, including the * original <code>tag</code> and <code>id</code> supplied to * {@link #notify(String, int, Notification) notify()} * (via {@link StatusBarNotification#getTag() getTag()} and * {@link StatusBarNotification#getId() getId()}) as well as a copy of the original * {@link Notification} object (via {@link StatusBarNotification#getNotification()}). * </p> * <p>From {@link Build.VERSION_CODES#Q}, will also return notifications you've posted as an * app's notification delegate via * {@link NotificationManager#notifyAsPackage(String, String, int, Notification)}. * </p> * * @return An array of {@link StatusBarNotification}. */ Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +16 −10 Original line number Diff line number Diff line Loading @@ -2647,6 +2647,10 @@ public class NotificationManagerService extends SystemService { * Note that since notification posting is done asynchronously, this will not return * notifications that are in the process of being posted. * * From {@link Build.VERSION_CODES#Q}, will also return notifications you've posted as * an app's notification delegate via * {@link NotificationManager#notifyAsPackage(String, String, int, Notification)}. * * @returns A list of all the package's notifications, in natural order. */ @Override Loading Loading @@ -2689,7 +2693,8 @@ public class NotificationManagerService extends SystemService { private StatusBarNotification sanitizeSbn(String pkg, int userId, StatusBarNotification sbn) { if (sbn.getPackageName().equals(pkg) && sbn.getUserId() == userId) { if (sbn.getUserId() == userId) { if (sbn.getPackageName().equals(pkg) || sbn.getOpPkg().equals(pkg)) { // We could pass back a cloneLight() but clients might get confused and // try to send this thing back to notify() again, which would not work // very well. Loading @@ -2700,6 +2705,7 @@ public class NotificationManagerService extends SystemService { sbn.getNotification().clone(), sbn.getUser(), sbn.getOverrideGroupKey(), sbn.getPostTime()); } } return null; } Loading