summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/app/Notification.java178
-rw-r--r--core/java/android/app/notification.aconfig28
-rw-r--r--core/java/com/android/internal/statusbar/StatusBarIcon.java3
-rw-r--r--core/java/com/android/internal/widget/NotificationRowIconView.java60
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationGroupingUtil.java22
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java30
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconBuilder.kt7
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt42
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconPack.java10
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/StatusBarIconViewBinder.kt23
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java6
11 files changed, 34 insertions, 375 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index c6c0395d1b93..0381ee0e25ac 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -155,7 +155,7 @@ public class Notification implements Parcelable
FOREGROUND_SERVICE_IMMEDIATE,
FOREGROUND_SERVICE_DEFERRED
})
- public @interface ServiceNotificationPolicy {};
+ public @interface ServiceNotificationPolicy {}
/**
* If the Notification associated with starting a foreground service has been
@@ -1754,10 +1754,6 @@ public class Notification implements Parcelable
private Icon mSmallIcon;
@UnsupportedAppUsage
private Icon mLargeIcon;
- private Icon mAppIcon;
-
- /** Cache for whether the notification was posted by a headless system app. */
- private Boolean mBelongsToHeadlessSystemApp = null;
@UnsupportedAppUsage
private String mChannelId;
@@ -3247,86 +3243,6 @@ public class Notification implements Parcelable
}
/**
- * Whether this notification was posted by a headless system app.
- *
- * If we don't have enough information to figure this out, this will return false. Therefore,
- * false negatives are possible, but false positives should not be.
- *
- * @hide
- */
- public boolean belongsToHeadlessSystemApp(Context context) {
- Trace.beginSection("Notification#belongsToHeadlessSystemApp");
-
- try {
- if (mBelongsToHeadlessSystemApp != null) {
- return mBelongsToHeadlessSystemApp;
- }
-
- if (context == null) {
- // Without a valid context, we don't know exactly. Let's assume it doesn't belong to
- // a system app, but not cache the value.
- return false;
- }
-
- ApplicationInfo info = getApplicationInfo(context);
- if (info != null) {
- if ((info.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
- // It's not a system app at all.
- mBelongsToHeadlessSystemApp = false;
- } else {
- // If there's no launch intent, it's probably a headless app.
- final PackageManager pm = context.getPackageManager();
- mBelongsToHeadlessSystemApp = pm.getLaunchIntentForPackage(info.packageName)
- == null;
- }
- } else {
- // If for some reason we don't have the app info, we don't know; best assume it's
- // not a system app.
- return false;
- }
- return mBelongsToHeadlessSystemApp;
- } finally {
- Trace.endSection();
- }
- }
-
- /**
- * Get the resource ID of the app icon from application info.
- * @hide
- */
- public int getHeaderAppIconRes(Context context) {
- ApplicationInfo info = getApplicationInfo(context);
- if (info != null) {
- return info.icon;
- }
- return 0;
- }
-
- /**
- * Load the app icon drawable from the package manager. This could result in a binder call.
- * @hide
- */
- public Drawable loadHeaderAppIcon(Context context) {
- Trace.beginSection("Notification#loadHeaderAppIcon");
-
- try {
- if (context == null) {
- Log.e(TAG, "Cannot load the app icon drawable with a null context");
- return null;
- }
- final PackageManager pm = context.getPackageManager();
- ApplicationInfo info = getApplicationInfo(context);
- if (info == null) {
- Log.e(TAG, "Cannot load the app icon drawable: no application info");
- return null;
- }
- return pm.getApplicationIcon(info);
- } finally {
- Trace.endSection();
- }
- }
-
- /**
* Fetch the application info from the notification, or the context if that isn't available.
*/
private ApplicationInfo getApplicationInfo(Context context) {
@@ -4361,55 +4277,6 @@ public class Notification implements Parcelable
}
/**
- * The colored app icon that can replace the small icon in the notification starting in V.
- *
- * Before using this value, you should first check whether it's actually being used by the
- * notification by calling {@link Notification#shouldUseAppIcon()}.
- *
- * @hide
- */
- public Icon getAppIcon() {
- if (mAppIcon != null) {
- return mAppIcon;
- }
- // If the app icon hasn't been loaded yet, check if we can load it without a context.
- if (extras.containsKey(EXTRA_BUILDER_APPLICATION_INFO)) {
- final ApplicationInfo info = extras.getParcelable(
- EXTRA_BUILDER_APPLICATION_INFO,
- ApplicationInfo.class);
- if (info != null) {
- int appIconRes = info.icon;
- if (appIconRes == 0) {
- Log.w(TAG, "Failed to get the app icon: no icon in application info");
- return null;
- }
- mAppIcon = Icon.createWithResource(info.packageName, appIconRes);
- return mAppIcon;
- } else {
- Log.e(TAG, "Failed to get the app icon: "
- + "there's an EXTRA_BUILDER_APPLICATION_INFO in extras but it's null");
- }
- } else {
- Log.w(TAG, "Failed to get the app icon: no application info in extras");
- }
- return null;
- }
-
- /**
- * Whether the notification is using the app icon instead of the small icon.
- * @hide
- */
- public boolean shouldUseAppIcon() {
- if (Flags.notificationsUseAppIconInRow()) {
- if (belongsToHeadlessSystemApp(/* context = */ null)) {
- return false;
- }
- return getAppIcon() != null;
- }
- return false;
- }
-
- /**
* The large icon shown in this notification's content view.
* @see Builder#getLargeIcon()
* @see Builder#setLargeIcon(Icon)
@@ -4566,19 +4433,6 @@ public class Notification implements Parcelable
private static final boolean USE_ONLY_TITLE_IN_LOW_PRIORITY_SUMMARY =
SystemProperties.getBoolean("notifications.only_title", true);
- /**
- * The lightness difference that has to be added to the primary text color to obtain the
- * secondary text color when the background is light.
- */
- private static final int LIGHTNESS_TEXT_DIFFERENCE_LIGHT = 20;
-
- /**
- * The lightness difference that has to be added to the primary text color to obtain the
- * secondary text color when the background is dark.
- * A bit less then the above value, since it looks better on dark backgrounds.
- */
- private static final int LIGHTNESS_TEXT_DIFFERENCE_DARK = -10;
-
private Context mContext;
private Notification mN;
private Bundle mUserExtras = new Bundle();
@@ -6451,36 +6305,12 @@ public class Notification implements Parcelable
}
private void bindSmallIcon(RemoteViews contentView, StandardTemplateParams p) {
- if (Flags.notificationsUseAppIcon()) {
- // Override small icon with app icon
- mN.mSmallIcon = Icon.createWithResource(mContext,
- mN.getHeaderAppIconRes(mContext));
- } else if (mN.mSmallIcon == null && mN.icon != 0) {
+ if (mN.mSmallIcon == null && mN.icon != 0) {
mN.mSmallIcon = Icon.createWithResource(mContext, mN.icon);
}
-
- boolean usingAppIcon = false;
- if (Flags.notificationsUseAppIconInRow() && !mN.belongsToHeadlessSystemApp(mContext)) {
- // Use the app icon in the view
- int appIconRes = mN.getHeaderAppIconRes(mContext);
- if (appIconRes != 0) {
- mN.mAppIcon = Icon.createWithResource(mContext, appIconRes);
- contentView.setImageViewIcon(R.id.icon, mN.mAppIcon);
- contentView.setBoolean(R.id.icon, "setShouldShowAppIcon", true);
- usingAppIcon = true;
- } else {
- Log.w(TAG, "bindSmallIcon: could not get the app icon");
- }
- }
- if (!usingAppIcon) {
- contentView.setImageViewIcon(R.id.icon, mN.mSmallIcon);
- }
+ contentView.setImageViewIcon(R.id.icon, mN.mSmallIcon);
contentView.setInt(R.id.icon, "setImageLevel", mN.iconLevel);
-
- // Don't change color if we're using the app icon.
- if (!Flags.notificationsUseAppIcon() && !usingAppIcon) {
- processSmallIconColor(mN.mSmallIcon, contentView, p);
- }
+ processSmallIconColor(mN.mSmallIcon, contentView, p);
}
/**
diff --git a/core/java/android/app/notification.aconfig b/core/java/android/app/notification.aconfig
index 0fc4291d15ab..ee93870be055 100644
--- a/core/java/android/app/notification.aconfig
+++ b/core/java/android/app/notification.aconfig
@@ -8,8 +8,7 @@ container: "system"
flag {
name: "notifications_redesign_app_icons"
namespace: "systemui"
- description: "Notifications Redesign: Use app icons in notification rows (not to be confused with"
- " notifications_use_app_icons, notifications_use_app_icon_in_row which are just experiments)."
+ description: "Notifications Redesign: Use app icons in notification rows"
bug: "371174789"
}
@@ -110,31 +109,6 @@ flag {
}
}
-# vvv Prototypes for using app icons in notifications vvv
-
-flag {
- name: "notifications_use_app_icon"
- namespace: "systemui"
- description: "Experiment to replace the small icon in a notification with the app icon. This includes the status bar, AOD, shelf and notification row itself."
- bug: "335211019"
-}
-
-flag {
- name: "notifications_use_app_icon_in_row"
- namespace: "systemui"
- description: "Experiment to replace the small icon in a notification row with the app icon."
- bug: "335211019"
-}
-
-flag {
- name: "notifications_use_monochrome_app_icon"
- namespace: "systemui"
- description: "Experiment to replace the notification icon in the status bar and shelf with the monochrome app icon, if available."
- bug: "335211019"
-}
-
-# ^^^ Prototypes for using app icons in notifications ^^^
-
flag {
name: "notification_expansion_optional"
namespace: "systemui"
diff --git a/core/java/com/android/internal/statusbar/StatusBarIcon.java b/core/java/com/android/internal/statusbar/StatusBarIcon.java
index 1938cdb0ba84..40161023eae4 100644
--- a/core/java/com/android/internal/statusbar/StatusBarIcon.java
+++ b/core/java/com/android/internal/statusbar/StatusBarIcon.java
@@ -40,9 +40,6 @@ public class StatusBarIcon implements Parcelable {
public enum Type {
// Notification: the sender avatar for important conversations
PeopleAvatar,
- // Notification: the monochrome version of the app icon if available; otherwise fall back to
- // the small icon
- MaybeMonochromeAppIcon,
// Notification: the small icon from the notification
NotifSmallIcon,
// The wi-fi, cellular or battery icon.
diff --git a/core/java/com/android/internal/widget/NotificationRowIconView.java b/core/java/com/android/internal/widget/NotificationRowIconView.java
index adcc0f64b598..5fc61b00e331 100644
--- a/core/java/com/android/internal/widget/NotificationRowIconView.java
+++ b/core/java/com/android/internal/widget/NotificationRowIconView.java
@@ -22,11 +22,7 @@ import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
-import android.graphics.Color;
-import android.graphics.ColorFilter;
import android.graphics.Paint;
-import android.graphics.PorterDuff;
-import android.graphics.PorterDuffColorFilter;
import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
@@ -35,8 +31,6 @@ import android.util.AttributeSet;
import android.view.RemotableViewMethod;
import android.widget.RemoteViews;
-import com.android.internal.R;
-
/**
* An image view that holds the icon displayed at the start of a notification row.
* This can generally either display the "small icon" of a notification set via
@@ -48,7 +42,6 @@ public class NotificationRowIconView extends CachingIconView {
private NotificationIconProvider mIconProvider;
private boolean mApplyCircularCrop = false;
- private boolean mShouldShowAppIcon = false;
private Drawable mAppIcon = null;
// Padding, background and colors set on the view prior to being overridden when showing the app
@@ -77,17 +70,6 @@ public class NotificationRowIconView extends CachingIconView {
super(context, attrs, defStyleAttr, defStyleRes);
}
- @Override
- protected void onFinishInflate() {
- // If showing the app icon, we don't need background or padding.
- if (Flags.notificationsUseAppIcon()) {
- setPadding(0, 0, 0, 0);
- setBackground(null);
- }
-
- super.onFinishInflate();
- }
-
/**
* Sets the icon provider for this view. This is used to determine whether we should show the
* app icon instead of the small icon, and to fetch the app icon if needed.
@@ -153,37 +135,12 @@ public class NotificationRowIconView extends CachingIconView {
return super.setImageIconAsync(icon);
}
- /** Whether the icon represents the app icon (instead of the small icon). */
- @RemotableViewMethod
- public void setShouldShowAppIcon(boolean shouldShowAppIcon) {
- if (Flags.notificationsUseAppIconInRow()) {
- if (mShouldShowAppIcon == shouldShowAppIcon) {
- return; // no change
- }
-
- mShouldShowAppIcon = shouldShowAppIcon;
- if (mShouldShowAppIcon) {
- adjustViewForAppIcon();
- } else {
- // Restore original padding and background if needed
- restoreViewForSmallIcon();
- }
- }
- }
-
/**
* Override padding and background from the view to display the app icon.
*/
private void adjustViewForAppIcon() {
removePadding();
-
- if (Flags.notificationsUseAppIconInRow()) {
- addWhiteBackground();
- } else {
- // No need to set the background for notification redesign, since the icon
- // factory already does that for us.
- removeBackground();
- }
+ removeBackground();
}
/**
@@ -221,21 +178,6 @@ public class NotificationRowIconView extends CachingIconView {
setBackground(null);
}
- private void addWhiteBackground() {
- if (mOriginalBackground == null) {
- mOriginalBackground = getBackground();
- }
-
- // Make the background white in case the icon itself doesn't have one.
- ColorFilter colorFilter = new PorterDuffColorFilter(Color.WHITE,
- PorterDuff.Mode.SRC_ATOP);
-
- if (mOriginalBackground == null) {
- setBackground(getContext().getDrawable(R.drawable.notification_icon_circle));
- }
- getBackground().mutate().setColorFilter(colorFilter);
- }
-
private void restoreBackground() {
// NOTE: This will not work if the original background was null, but that's better than
// accidentally clearing the background. We expect that there's generally going to be one
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationGroupingUtil.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationGroupingUtil.java
index 3a24ec9408ad..c1b8d9d123b9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationGroupingUtil.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationGroupingUtil.java
@@ -383,34 +383,20 @@ public class NotificationGroupingUtil {
}
protected boolean hasSameIcon(Object parentData, Object childData) {
- Icon parentIcon = getIcon((Notification) parentData);
- Icon childIcon = getIcon((Notification) childData);
+ Icon parentIcon = ((Notification) parentData).getSmallIcon();
+ Icon childIcon = ((Notification) childData).getSmallIcon();
return parentIcon.sameAs(childIcon);
}
- private static Icon getIcon(Notification notification) {
- if (notification.shouldUseAppIcon()) {
- return notification.getAppIcon();
- }
- return notification.getSmallIcon();
- }
-
/**
* @return whether two ImageViews have the same colorFilterSet or none at all
*/
protected boolean hasSameColor(Object parentData, Object childData) {
- int parentColor = getColor((Notification) parentData);
- int childColor = getColor((Notification) childData);
+ int parentColor = ((Notification) parentData).color;
+ int childColor = ((Notification) childData).color;
return parentColor == childColor;
}
- private static int getColor(Notification notification) {
- if (notification.shouldUseAppIcon()) {
- return 0; // the color filter isn't applied if using the app icon
- }
- return notification.color;
- }
-
@Override
public boolean isEmpty(View view) {
return false;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
index ad3afd4d1756..33f0c64269cc 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java
@@ -27,7 +27,6 @@ import android.app.ActivityManager;
import android.app.Notification;
import android.content.Context;
import android.content.pm.ActivityInfo;
-import android.content.pm.PackageManager;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.content.res.Resources;
@@ -36,7 +35,6 @@ import android.graphics.Color;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.Paint;
import android.graphics.Rect;
-import android.graphics.drawable.AdaptiveIconDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
import android.os.Trace;
@@ -520,34 +518,8 @@ public class StatusBarIconView extends AnimatedImageView implements StatusIconDi
userId = UserHandle.USER_SYSTEM;
}
- // Try to load the monochrome app icon if applicable
- Drawable icon = maybeGetMonochromeAppIcon(context, statusBarIcon);
- // Otherwise, just use the icon normally
- if (icon == null) {
- icon = statusBarIcon.icon.loadDrawableAsUser(context, userId);
- }
- return icon;
- }
- }
-
- @Nullable
- private Drawable maybeGetMonochromeAppIcon(Context context,
- StatusBarIcon statusBarIcon) {
- if (android.app.Flags.notificationsUseMonochromeAppIcon()
- && statusBarIcon.type == StatusBarIcon.Type.MaybeMonochromeAppIcon) {
- // Check if we have a monochrome app icon
- PackageManager pm = context.getPackageManager();
- Drawable appIcon = context.getApplicationInfo().loadIcon(pm);
- if (appIcon instanceof AdaptiveIconDrawable) {
- Drawable monochrome = ((AdaptiveIconDrawable) appIcon).getMonochrome();
- if (monochrome != null) {
- setCropToPadding(true);
- setScaleType(ScaleType.CENTER);
- return new ScalingDrawableWrapper(monochrome, APP_ICON_SCALE);
- }
- }
+ return statusBarIcon.icon.loadDrawableAsUser(context, userId);
}
- return null;
}
public StatusBarIcon getStatusBarIcon() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconBuilder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconBuilder.kt
index 16d0cc42db7f..3c8c42f6b29d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconBuilder.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconBuilder.kt
@@ -18,7 +18,6 @@ package com.android.systemui.statusbar.notification.icon
import android.app.Notification
import android.content.Context
-import android.graphics.drawable.Drawable
import com.android.systemui.statusbar.StatusBarIconView
import com.android.systemui.statusbar.notification.collection.NotificationEntry
import com.android.systemui.statusbar.notification.contentDescForNotification
@@ -30,15 +29,11 @@ class IconBuilder @Inject constructor(private val context: Context) {
return StatusBarIconView(
context,
"${entry.sbn.packageName}/0x${Integer.toHexString(entry.sbn.id)}",
- entry.sbn
+ entry.sbn,
)
}
fun getIconContentDescription(n: Notification): CharSequence {
return contentDescForNotification(context, n)
}
-
- fun getAppIcon(n: Notification): Drawable {
- return n.loadHeaderAppIcon(context)
- }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt
index db804835f260..47171948f395 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt
@@ -26,6 +26,7 @@ import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.ImageView
+import com.android.app.tracing.coroutines.launchTraced as launch
import com.android.app.tracing.traceSection
import com.android.internal.statusbar.StatusBarIcon
import com.android.systemui.Flags
@@ -44,7 +45,6 @@ import javax.inject.Inject
import kotlin.coroutines.CoroutineContext
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
-import com.android.app.tracing.coroutines.launchTraced as launch
import kotlinx.coroutines.withContext
/**
@@ -152,13 +152,7 @@ constructor(
setIcon(entry, sensitiveIconDescriptor, shelfIcon)
setIcon(entry, sensitiveIconDescriptor, aodIcon)
entry.icons =
- IconPack.buildPack(
- sbIcon,
- sbChipIcon,
- shelfIcon,
- aodIcon,
- entry.icons,
- )
+ IconPack.buildPack(sbIcon, sbChipIcon, shelfIcon, aodIcon, entry.icons)
} catch (e: InflationException) {
entry.icons = IconPack.buildEmptyPack(entry.icons)
throw e
@@ -182,7 +176,7 @@ constructor(
Log.wtf(
TAG,
"Updating using the cache is not supported when the " +
- "notifications_background_icons flag is off"
+ "notifications_background_icons flag is off",
)
}
if (!usingCache || !Flags.notificationsBackgroundIcons()) {
@@ -249,10 +243,6 @@ constructor(
val (icon: Icon?, type: StatusBarIcon.Type) =
if (showPeopleAvatar) {
createPeopleAvatar(entry) to StatusBarIcon.Type.PeopleAvatar
- } else if (
- android.app.Flags.notificationsUseMonochromeAppIcon() && n.shouldUseAppIcon()
- ) {
- n.smallIcon to StatusBarIcon.Type.MaybeMonochromeAppIcon
} else {
n.smallIcon to StatusBarIcon.Type.NotifSmallIcon
}
@@ -267,33 +257,25 @@ constructor(
private fun getCachedIconDescriptor(
entry: NotificationEntry,
- showPeopleAvatar: Boolean
+ showPeopleAvatar: Boolean,
): StatusBarIcon? {
val peopleAvatarDescriptor = entry.icons.peopleAvatarDescriptor
- val appIconDescriptor = entry.icons.appIconDescriptor
val smallIconDescriptor = entry.icons.smallIconDescriptor
// If cached, return corresponding cached values
return when {
showPeopleAvatar && peopleAvatarDescriptor != null -> peopleAvatarDescriptor
- android.app.Flags.notificationsUseMonochromeAppIcon() && appIconDescriptor != null ->
- appIconDescriptor
smallIconDescriptor != null -> smallIconDescriptor
else -> null
}
}
private fun cacheIconDescriptor(entry: NotificationEntry, descriptor: StatusBarIcon) {
- if (
- android.app.Flags.notificationsUseAppIcon() ||
- android.app.Flags.notificationsUseMonochromeAppIcon()
- ) {
- // If either of the new icon flags is enabled, we cache the icon all the time.
+ if (android.app.Flags.notificationsRedesignAppIcons()) {
+ // Although we're not actually using the app icon in the status bar, let's make sure
+ // we cache the icon all the time when the flag is on.
when (descriptor.type) {
StatusBarIcon.Type.PeopleAvatar -> entry.icons.peopleAvatarDescriptor = descriptor
- // When notificationsUseMonochromeAppIcon is enabled, we use the appIconDescriptor.
- StatusBarIcon.Type.MaybeMonochromeAppIcon ->
- entry.icons.appIconDescriptor = descriptor
// When notificationsUseAppIcon is enabled, the app icon overrides the small icon.
// But either way, it's a good idea to cache the descriptor.
else -> entry.icons.smallIconDescriptor = descriptor
@@ -312,7 +294,7 @@ constructor(
private fun setIcon(
entry: NotificationEntry,
iconDescriptor: StatusBarIcon,
- iconView: StatusBarIconView
+ iconView: StatusBarIconView,
) {
iconView.setShowsConversation(showsConversation(entry, iconView, iconDescriptor))
iconView.setTag(R.id.icon_is_pre_L, entry.targetSdk < Build.VERSION_CODES.LOLLIPOP)
@@ -323,7 +305,7 @@ constructor(
private fun Icon.toStatusBarIcon(
entry: NotificationEntry,
- type: StatusBarIcon.Type
+ type: StatusBarIcon.Type,
): StatusBarIcon {
val n = entry.sbn.notification
return StatusBarIcon(
@@ -333,7 +315,7 @@ constructor(
n.iconLevel,
n.number,
iconBuilder.getIconContentDescription(n),
- type
+ type,
)
}
@@ -347,7 +329,7 @@ constructor(
} catch (e: Exception) {
Log.e(
TAG,
- "Error calling LauncherApps#getShortcutIcon for notification $entry: $e"
+ "Error calling LauncherApps#getShortcutIcon for notification $entry: $e",
)
}
}
@@ -431,7 +413,7 @@ constructor(
private fun showsConversation(
entry: NotificationEntry,
iconView: StatusBarIconView,
- iconDescriptor: StatusBarIcon
+ iconDescriptor: StatusBarIcon,
): Boolean {
val usedInSensitiveContext =
iconView === entry.icons.shelfIcon || iconView === entry.icons.aodIcon
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconPack.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconPack.java
index 611cebcf6427..cb6be661c7f1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconPack.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconPack.java
@@ -34,7 +34,6 @@ public final class IconPack {
@Nullable private final StatusBarIconView mAodIcon;
@Nullable private StatusBarIcon mSmallIconDescriptor;
- @Nullable private StatusBarIcon mAppIconDescriptor;
@Nullable private StatusBarIcon mPeopleAvatarDescriptor;
private boolean mIsImportantConversation;
@@ -127,15 +126,6 @@ public final class IconPack {
mPeopleAvatarDescriptor = peopleAvatarDescriptor;
}
- @Nullable
- StatusBarIcon getAppIconDescriptor() {
- return mAppIconDescriptor;
- }
-
- void setAppIconDescriptor(@Nullable StatusBarIcon appIconDescriptor) {
- mAppIconDescriptor = appIconDescriptor;
- }
-
boolean isImportantConversation() {
return mIsImportantConversation;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/StatusBarIconViewBinder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/StatusBarIconViewBinder.kt
index 6b5642af3f10..83f56a092bc6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/StatusBarIconViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/ui/viewbinder/StatusBarIconViewBinder.kt
@@ -20,7 +20,6 @@ import android.graphics.Rect
import android.view.View
import com.android.app.tracing.traceSection
import com.android.internal.util.ContrastColorUtil
-import com.android.systemui.Flags
import com.android.systemui.res.R
import com.android.systemui.statusbar.StatusBarIconView
import com.android.systemui.statusbar.StatusBarIconView.NO_COLOR
@@ -36,11 +35,9 @@ object StatusBarIconViewBinder {
suspend fun bindColor(view: StatusBarIconView, color: Flow<Int>) {
color.collectTracingEach("SBIV#bindColor") { color ->
- // Don't change the icon color if an app icon experiment is enabled.
- if (!android.app.Flags.notificationsUseAppIcon()) {
- view.staticDrawableColor = color
- }
- // Continue changing the overflow dot color
+ // Set the color for the icons
+ view.staticDrawableColor = color
+ // Set the color for the overflow dot
view.setDecorColor(color)
}
}
@@ -59,14 +56,12 @@ object StatusBarIconViewBinder {
contrastColorUtil: ContrastColorUtil,
) {
iconColors.collectTracingEach("SBIV#bindIconColors") { colors ->
- // Don't change the icon color if an app icon experiment is enabled.
- if (!android.app.Flags.notificationsUseAppIcon()) {
- val isPreL = java.lang.Boolean.TRUE == view.getTag(R.id.icon_is_pre_L)
- val isColorized = !isPreL || NotificationUtils.isGrayscale(view, contrastColorUtil)
- view.staticDrawableColor =
- if (isColorized) colors.staticDrawableColor(view.viewBounds) else NO_COLOR
- }
- // Continue changing the overflow dot color
+ // Set the icon color
+ val isPreL = java.lang.Boolean.TRUE == view.getTag(R.id.icon_is_pre_L)
+ val isColorized = !isPreL || NotificationUtils.isGrayscale(view, contrastColorUtil)
+ view.staticDrawableColor =
+ if (isColorized) colors.staticDrawableColor(view.viewBounds) else NO_COLOR
+ // Set the color for the overflow dot
view.setDecorColor(colors.tint)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java
index f3521234e67a..b622defbef98 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java
@@ -203,11 +203,7 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper imple
addRemainingTransformTypes();
updateCropToPaddingForImageViews();
Notification n = row.getEntry().getSbn().getNotification();
- if (n.shouldUseAppIcon()) {
- mIcon.setTag(ImageTransformState.ICON_TAG, n.getAppIcon());
- } else {
- mIcon.setTag(ImageTransformState.ICON_TAG, n.getSmallIcon());
- }
+ mIcon.setTag(ImageTransformState.ICON_TAG, n.getSmallIcon());
// We need to reset all views that are no longer transforming in case a view was previously
// transformed, but now we decided to transform its container instead.