From d89188d68e678f1f7bcfdae9a9a9fa5b946bfc32 Mon Sep 17 00:00:00 2001 From: Christoph Studer Date: Thu, 3 Apr 2014 00:02:39 +0200 Subject: [PATCH] NoManService: More efficient notification update Instead of removing the old notification and inserting the updated notification afterwards, replace the old notification in-place. Change-Id: I88962fd2452de191c1d63c142719194282568dcc --- .../server/notification/NotificationManagerService.java | 4 ++-- 1 file changed, 2 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 3b6d2886df7fd..663501d86e5e3 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -1915,8 +1915,8 @@ public class NotificationManagerService extends SystemService { mNotificationList.add(r); mUsageStats.registerPostedByApp(r); } else { - old = mNotificationList.remove(index); - mNotificationList.add(index, r); + old = mNotificationList.get(index); + mNotificationList.set(index, r); mUsageStats.registerUpdatedByApp(r); // Make sure we don't lose the foreground service state. if (old != null) {