fix data race condition
BUG: 25819358 Change-Id: I9d9978c92d084e93ccb41ea1d0fe33ffe3e17e3d
This commit is contained in:
@@ -1289,10 +1289,11 @@ public class NotificationManagerService extends SystemService {
|
|||||||
Binder.getCallingUid(), incomingUserId, true, false,
|
Binder.getCallingUid(), incomingUserId, true, false,
|
||||||
"getAppActiveNotifications", pkg);
|
"getAppActiveNotifications", pkg);
|
||||||
|
|
||||||
final int N = mNotificationList.size();
|
final ArrayList<StatusBarNotification> list
|
||||||
final ArrayList<StatusBarNotification> list = new ArrayList<StatusBarNotification>(N);
|
= new ArrayList<StatusBarNotification>(mNotificationList.size());
|
||||||
|
|
||||||
synchronized (mNotificationList) {
|
synchronized (mNotificationList) {
|
||||||
|
final int N = mNotificationList.size();
|
||||||
for (int i = 0; i < N; i++) {
|
for (int i = 0; i < N; i++) {
|
||||||
final StatusBarNotification sbn = mNotificationList.get(i).sbn;
|
final StatusBarNotification sbn = mNotificationList.get(i).sbn;
|
||||||
if (sbn.getPackageName().equals(pkg) && sbn.getUserId() == userId) {
|
if (sbn.getPackageName().equals(pkg) && sbn.getUserId() == userId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user