SysUI: Fix notification leak
Fix bug where we kept a reference to the old Notification when
we re-use notification entries on updates.
Bug: 16513124
Change-Id: I066ff7447952516e27e122df57d4e6e67ee1cea3
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
index 6f839bd..20dd3e7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
@@ -57,8 +57,7 @@
mNumberPain.setTextAlign(Paint.Align.CENTER);
mNumberPain.setColor(res.getColor(R.drawable.notification_number_text_color));
mNumberPain.setAntiAlias(true);
- mNotification = notification;
- setContentDescription(notification);
+ setNotification(notification);
// We do not resize and scale system icons (on the right), only notification icons (on the
// left).
@@ -73,6 +72,11 @@
setScaleType(ImageView.ScaleType.CENTER);
}
+ public void setNotification(Notification notification) {
+ mNotification = notification;
+ setContentDescription(notification);
+ }
+
public StatusBarIconView(Context context, AttributeSet attrs) {
super(context, attrs);
final Resources res = context.getResources();