Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e9aac5f4 authored by Griff Hazen's avatar Griff Hazen
Browse files

Remove reference to StatusBarNotification after the value is accessed.

StatusBarNotificationHolder values are fetched exactly once.

Bug: 15426276
Bug: 16575857
Change-Id: I3d11aba717d17426d31e7b1a07560f6b7e79c4ec
parent c6bd32e9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -20,5 +20,6 @@ import android.service.notification.StatusBarNotification;

/** @hide */
interface IStatusBarNotificationHolder {
    /** Fetch the held StatusBarNotification. This method should only be called once per Holder */
    StatusBarNotification get();
}
+5 −2
Original line number Diff line number Diff line
@@ -2960,15 +2960,18 @@ public class NotificationManagerService extends SystemService {
     */
    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;
        }
    }
}