Fixed a flicker of group notifications
When replacing a supressed group with it's summary, the icon
would flicker. We're now suppressing icon animations of
replaced notifications.
Test: add notification and children 1 by 1 and observe no flickering
Change-Id: I79440e473296e766ab80832ce74f450aee1af8ea
Fixes: 38459207
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
index c7fbbf9..e489ba7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
@@ -34,6 +34,7 @@
import android.graphics.drawable.Icon;
import android.os.Parcelable;
import android.os.UserHandle;
+import android.service.notification.StatusBarNotification;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.FloatProperty;
@@ -99,7 +100,7 @@
private int mNumberX;
private int mNumberY;
private String mNumberText;
- private Notification mNotification;
+ private StatusBarNotification mNotification;
private final boolean mBlocked;
private int mDensity;
private float mIconScale = 1.0f;
@@ -127,11 +128,11 @@
};
private final NotificationIconDozeHelper mDozer;
- public StatusBarIconView(Context context, String slot, Notification notification) {
- this(context, slot, notification, false);
+ public StatusBarIconView(Context context, String slot, StatusBarNotification sbn) {
+ this(context, slot, sbn, false);
}
- public StatusBarIconView(Context context, String slot, Notification notification,
+ public StatusBarIconView(Context context, String slot, StatusBarNotification sbn,
boolean blocked) {
super(context);
mDozer = new NotificationIconDozeHelper(context);
@@ -141,7 +142,7 @@
mNumberPain.setTextAlign(Paint.Align.CENTER);
mNumberPain.setColor(context.getColor(R.drawable.notification_number_text_color));
mNumberPain.setAntiAlias(true);
- setNotification(notification);
+ setNotification(sbn);
maybeUpdateIconScaleDimens();
setScaleType(ScaleType.CENTER);
mDensity = context.getResources().getDisplayMetrics().densityDpi;
@@ -203,9 +204,11 @@
}
}
- public void setNotification(Notification notification) {
+ public void setNotification(StatusBarNotification notification) {
mNotification = notification;
- setContentDescription(notification);
+ if (notification != null) {
+ setContentDescription(notification.getNotification());
+ }
}
public StatusBarIconView(Context context, AttributeSet attrs) {
@@ -311,6 +314,10 @@
return true;
}
+ public Icon getSourceIcon() {
+ return mIcon.icon;
+ }
+
private Drawable getIcon(StatusBarIcon icon) {
return getIcon(getContext(), icon);
}
@@ -350,7 +357,7 @@
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
if (mNotification != null) {
- event.setParcelableData(mNotification);
+ event.setParcelableData(mNotification.getNotification());
}
}
@@ -452,6 +459,10 @@
+ " notification=" + mNotification + ")";
}
+ public StatusBarNotification getNotification() {
+ return mNotification;
+ }
+
public String getSlot() {
return mSlot;
}