Skip to content
Snippets Groups Projects
Commit 2f52f7c7 authored by Jeff DeCew's avatar Jeff DeCew Committed by Android (Google) Code Review
Browse files

Merge "Remove unused CenteredIcon from IconPack" into main

parents e64aff5b 28a03b26
No related branches found
No related tags found
No related merge requests found
......@@ -112,15 +112,6 @@ class IconManager @Inject constructor(
aodIcon.scaleType = ImageView.ScaleType.CENTER_INSIDE
aodIcon.setIncreasedSize(true)
// Construct the centered icon view.
val centeredIcon = if (entry.sbn.notification.isMediaNotification) {
iconBuilder.createIconView(entry).apply {
scaleType = ImageView.ScaleType.CENTER_INSIDE
}
} else {
null
}
// Set the icon views' icons
val (normalIconDescriptor, sensitiveIconDescriptor) = getIconDescriptors(entry)
......@@ -128,10 +119,7 @@ class IconManager @Inject constructor(
setIcon(entry, normalIconDescriptor, sbIcon)
setIcon(entry, sensitiveIconDescriptor, shelfIcon)
setIcon(entry, sensitiveIconDescriptor, aodIcon)
if (centeredIcon != null) {
setIcon(entry, normalIconDescriptor, centeredIcon)
}
entry.icons = IconPack.buildPack(sbIcon, shelfIcon, aodIcon, centeredIcon, entry.icons)
entry.icons = IconPack.buildPack(sbIcon, shelfIcon, aodIcon, entry.icons)
} catch (e: InflationException) {
entry.icons = IconPack.buildEmptyPack(entry.icons)
throw e
......@@ -171,11 +159,6 @@ class IconManager @Inject constructor(
it.setNotification(entry.sbn, notificationContentDescription)
setIcon(entry, sensitiveIconDescriptor, it)
}
entry.icons.centeredIcon?.let {
it.setNotification(entry.sbn, notificationContentDescription)
setIcon(entry, sensitiveIconDescriptor, it)
}
}
private fun updateIconsSafe(entry: NotificationEntry) {
......
......@@ -31,7 +31,6 @@ public final class IconPack {
@Nullable private final StatusBarIconView mStatusBarIcon;
@Nullable private final StatusBarIconView mShelfIcon;
@Nullable private final StatusBarIconView mAodIcon;
@Nullable private final StatusBarIconView mCenteredIcon;
@Nullable private StatusBarIcon mSmallIconDescriptor;
@Nullable private StatusBarIcon mPeopleAvatarDescriptor;
......@@ -43,7 +42,7 @@ public final class IconPack {
* haven't been inflated yet or there was an error while inflating them).
*/
public static IconPack buildEmptyPack(@Nullable IconPack fromSource) {
return new IconPack(false, null, null, null, null, fromSource);
return new IconPack(false, null, null, null, fromSource);
}
/**
......@@ -53,9 +52,8 @@ public final class IconPack {
@NonNull StatusBarIconView statusBarIcon,
@NonNull StatusBarIconView shelfIcon,
@NonNull StatusBarIconView aodIcon,
@Nullable StatusBarIconView centeredIcon,
@Nullable IconPack source) {
return new IconPack(true, statusBarIcon, shelfIcon, aodIcon, centeredIcon, source);
return new IconPack(true, statusBarIcon, shelfIcon, aodIcon, source);
}
private IconPack(
......@@ -63,12 +61,10 @@ public final class IconPack {
@Nullable StatusBarIconView statusBarIcon,
@Nullable StatusBarIconView shelfIcon,
@Nullable StatusBarIconView aodIcon,
@Nullable StatusBarIconView centeredIcon,
@Nullable IconPack source) {
mAreIconsAvailable = areIconsAvailable;
mStatusBarIcon = statusBarIcon;
mShelfIcon = shelfIcon;
mCenteredIcon = centeredIcon;
mAodIcon = aodIcon;
if (source != null) {
mIsImportantConversation = source.mIsImportantConversation;
......@@ -91,11 +87,6 @@ public final class IconPack {
return mShelfIcon;
}
@Nullable
public StatusBarIconView getCenteredIcon() {
return mCenteredIcon;
}
/** The version of the icon that's shown when pulsing (in AOD). */
@Nullable
public StatusBarIconView getAodIcon() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment