From 2242b4d2bda7f83cf7813103ff95d9b4e244126f Mon Sep 17 00:00:00 2001 From: Erik Wolsheimer Date: Tue, 24 Nov 2015 13:22:04 -0800 Subject: fix data race condition BUG: 25819358 Change-Id: I9d9978c92d084e93ccb41ea1d0fe33ffe3e17e3d --- .../com/android/server/notification/NotificationManagerService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'services') diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 4351798..288810c 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -1289,10 +1289,11 @@ public class NotificationManagerService extends SystemService { Binder.getCallingUid(), incomingUserId, true, false, "getAppActiveNotifications", pkg); - final int N = mNotificationList.size(); - final ArrayList list = new ArrayList(N); + final ArrayList list + = new ArrayList(mNotificationList.size()); synchronized (mNotificationList) { + final int N = mNotificationList.size(); for (int i = 0; i < N; i++) { final StatusBarNotification sbn = mNotificationList.get(i).sbn; if (sbn.getPackageName().equals(pkg) && sbn.getUserId() == userId) { -- cgit v1.1