commit | 2f439763bd4ce8b38ab66ed45e3d8ed4a31e9a33 | [log] [tgz] |
---|---|---|
author | Griff Hazen <griff@google.com> | Tue Sep 09 18:35:53 2014 +0000 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Tue Sep 09 18:35:54 2014 +0000 |
tree | b16803773b79f18cf4930ec242772809e5f7f8a1 | |
parent | 69fb8a23990fd8948be6f0045c2b0b988b6ca6d6 [diff] | |
parent | e9aac5f44d7bf8c4a523773e57c30fd8340850eb [diff] |
Merge "Remove reference to StatusBarNotification after the value is accessed." into lmp-dev
diff --git a/core/java/android/service/notification/IStatusBarNotificationHolder.aidl b/core/java/android/service/notification/IStatusBarNotificationHolder.aidl index fd6b59e..c25cdb2 100644 --- a/core/java/android/service/notification/IStatusBarNotificationHolder.aidl +++ b/core/java/android/service/notification/IStatusBarNotificationHolder.aidl
@@ -20,5 +20,6 @@ /** @hide */ interface IStatusBarNotificationHolder { + /** Fetch the held StatusBarNotification. This method should only be called once per Holder */ StatusBarNotification get(); }
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index a56f783..280db73 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -2965,15 +2965,18 @@ */ private static final class StatusBarNotificationHolder extends IStatusBarNotificationHolder.Stub { - private final StatusBarNotification mValue; + private StatusBarNotification mValue; public StatusBarNotificationHolder(StatusBarNotification value) { mValue = value; } + /** Get the held value and clear it. This function should only be called once per holder */ @Override public StatusBarNotification get() { - return mValue; + StatusBarNotification value = mValue; + mValue = null; + return value; } } }