Loading packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java +16 −4 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ import com.android.systemui.scene.shared.flag.SceneContainerFlag; import com.android.systemui.statusbar.notification.NotificationContentDescription; import com.android.systemui.statusbar.notification.NotificationDozeHelper; import com.android.systemui.statusbar.notification.NotificationUtils; import com.android.systemui.statusbar.notification.collection.BundleEntry; import com.android.systemui.util.drawable.DrawableSize; import java.lang.annotation.Retention; Loading Loading @@ -147,7 +148,8 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi private StatusBarIcon mIcon; private int mLayoutDirectionForLoadedDrawable = LayoutDirection.UNDEFINED; @ViewDebug.ExportedProperty private String mSlot; private StatusBarNotification mNotification; @Nullable private StatusBarNotification mNotification; @Nullable private BundleEntry mBundleEntry; private final boolean mBlocked; private Configuration mConfiguration; private boolean mNightMode; Loading Loading @@ -187,6 +189,12 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi this(context, slot, sbn, false); } public StatusBarIconView(Context context, String slot, StatusBarNotification sbn, BundleEntry entry) { this(context, slot, sbn, false); mBundleEntry = entry; } public StatusBarIconView(Context context, String slot, StatusBarNotification sbn, boolean blocked) { super(context); Loading @@ -210,7 +218,7 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi public void maybeUpdateIconScaleDimens() { // We scale notification icons (on the left) plus icons on the right that explicitly // want FIXED_SPACE. boolean useNonSystemIconScaling = isNotification() boolean useNonSystemIconScaling = isShownWithNotifications() || (mIcon != null && mIcon.shape == Shape.FIXED_SPACE); if (useNonSystemIconScaling) { Loading Loading @@ -377,6 +385,10 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi return mNotification != null; } private boolean isShownWithNotifications() { return mNotification != null || mBundleEntry != null; } public boolean equalIcons(Icon a, Icon b) { if (a == b) return true; if (a.getType() != b.getType()) return false; Loading Loading @@ -545,7 +557,7 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); if (!isNotification()) { if (!isShownWithNotifications()) { // for system icons, calculated measured width from super is for image drawable real // width (17dp). We may scale the image with font scale, so we also need to scale the // measured width so that scaled measured width and image width would be fit. Loading Loading @@ -627,7 +639,7 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi } private void initializeDecorColor() { if (isNotification()) { if (isShownWithNotifications()) { setDecorColor(getContext().getColor(mNightMode ? com.android.internal.R.color.notification_default_color_dark : com.android.internal.R.color.notification_default_color_light)); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconBuilder.kt +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ class IconBuilder @Inject constructor(@StatusBarMain private val context: Contex @JvmOverloads fun createIconView(entry: BundleEntry, context: Context = this.context): StatusBarIconView { return StatusBarIconView(context, entry.key, null) return StatusBarIconView(context, entry.key, null, entry) } fun getIconContentDescription(n: Notification): CharSequence { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java +16 −4 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ import com.android.systemui.scene.shared.flag.SceneContainerFlag; import com.android.systemui.statusbar.notification.NotificationContentDescription; import com.android.systemui.statusbar.notification.NotificationDozeHelper; import com.android.systemui.statusbar.notification.NotificationUtils; import com.android.systemui.statusbar.notification.collection.BundleEntry; import com.android.systemui.util.drawable.DrawableSize; import java.lang.annotation.Retention; Loading Loading @@ -147,7 +148,8 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi private StatusBarIcon mIcon; private int mLayoutDirectionForLoadedDrawable = LayoutDirection.UNDEFINED; @ViewDebug.ExportedProperty private String mSlot; private StatusBarNotification mNotification; @Nullable private StatusBarNotification mNotification; @Nullable private BundleEntry mBundleEntry; private final boolean mBlocked; private Configuration mConfiguration; private boolean mNightMode; Loading Loading @@ -187,6 +189,12 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi this(context, slot, sbn, false); } public StatusBarIconView(Context context, String slot, StatusBarNotification sbn, BundleEntry entry) { this(context, slot, sbn, false); mBundleEntry = entry; } public StatusBarIconView(Context context, String slot, StatusBarNotification sbn, boolean blocked) { super(context); Loading @@ -210,7 +218,7 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi public void maybeUpdateIconScaleDimens() { // We scale notification icons (on the left) plus icons on the right that explicitly // want FIXED_SPACE. boolean useNonSystemIconScaling = isNotification() boolean useNonSystemIconScaling = isShownWithNotifications() || (mIcon != null && mIcon.shape == Shape.FIXED_SPACE); if (useNonSystemIconScaling) { Loading Loading @@ -377,6 +385,10 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi return mNotification != null; } private boolean isShownWithNotifications() { return mNotification != null || mBundleEntry != null; } public boolean equalIcons(Icon a, Icon b) { if (a == b) return true; if (a.getType() != b.getType()) return false; Loading Loading @@ -545,7 +557,7 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); if (!isNotification()) { if (!isShownWithNotifications()) { // for system icons, calculated measured width from super is for image drawable real // width (17dp). We may scale the image with font scale, so we also need to scale the // measured width so that scaled measured width and image width would be fit. Loading Loading @@ -627,7 +639,7 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi } private void initializeDecorColor() { if (isNotification()) { if (isShownWithNotifications()) { setDecorColor(getContext().getColor(mNightMode ? com.android.internal.R.color.notification_default_color_dark : com.android.internal.R.color.notification_default_color_light)); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconBuilder.kt +1 −1 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ class IconBuilder @Inject constructor(@StatusBarMain private val context: Contex @JvmOverloads fun createIconView(entry: BundleEntry, context: Context = this.context): StatusBarIconView { return StatusBarIconView(context, entry.key, null) return StatusBarIconView(context, entry.key, null, entry) } fun getIconContentDescription(n: Notification): CharSequence { Loading