Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28a03b26 authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Remove unused CenteredIcon from IconPack

Bug: 196412082
Flag: NA
Test: atest SystemUITests
Change-Id: I816d0d3ccc9645559fafbb5e2233d5265d45c474
parent 4f265be7
Loading
Loading
Loading
Loading
+1 −18
Original line number Diff line number Diff line
@@ -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) {
+2 −11
Original line number Diff line number Diff line
@@ -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() {