diff options
author | Erik Wolsheimer <ewol@google.com> | 2015-11-30 17:22:56 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-11-30 17:22:56 +0000 |
commit | 1dbb0355dc89a9f878365ee793ec48f6cb0b1426 (patch) | |
tree | 72038128f757838a644660d534a2c91cea7593c2 /services | |
parent | b6ae32162e77d9f11620b6806dec20a0987e2dab (diff) | |
parent | 2242b4d2bda7f83cf7813103ff95d9b4e244126f (diff) | |
download | frameworks_base-1dbb0355dc89a9f878365ee793ec48f6cb0b1426.zip frameworks_base-1dbb0355dc89a9f878365ee793ec48f6cb0b1426.tar.gz frameworks_base-1dbb0355dc89a9f878365ee793ec48f6cb0b1426.tar.bz2 |
fix data race condition BUG: 25819358
am: 2242b4d2bd
* commit '2242b4d2bda7f83cf7813103ff95d9b4e244126f':
fix data race condition BUG: 25819358
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/notification/NotificationManagerService.java | 5 |
1 files changed, 3 insertions, 2 deletions
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<StatusBarNotification> list = new ArrayList<StatusBarNotification>(N); + final ArrayList<StatusBarNotification> list + = new ArrayList<StatusBarNotification>(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) { |