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

Commit 13a8a94c authored by Steve Elliott's avatar Steve Elliott Committed by Android (Google) Code Review
Browse files

Merge "Remove PipelineEntry.getRepresentativeEntry()" into main

parents f5eb359c ec5dc5dc
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -782,6 +782,7 @@ class VisualStabilityCoordinatorTest(flags: FlagsParameterization) : SysuiTestCa
            whenever(nonHeadsUpGroupSummary.key).thenReturn("non_heads_up_group_key")
            whenever(nonHeadsUpGroupSummary.isSummaryWithChildren).thenReturn(true)
            val nonHeadsUpGroupEntry: GroupEntry = mock()
            whenever(nonHeadsUpGroupEntry.asListEntry()).thenReturn(nonHeadsUpGroupEntry)
            whenever(nonHeadsUpGroupEntry.summary).thenReturn(nonHeadsUpGroupSummary)
            whenever(nonHeadsUpGroupEntry.representativeEntry).thenReturn(nonHeadsUpGroupSummary)

@@ -880,6 +881,7 @@ class VisualStabilityCoordinatorTest(flags: FlagsParameterization) : SysuiTestCa
            whenever(groupSummary.isSummaryWithChildren).thenReturn(true)

            val nonHeadsUpGroupEntry: GroupEntry = mock()
            whenever(nonHeadsUpGroupEntry.asListEntry()).thenReturn(nonHeadsUpGroupEntry)
            whenever(nonHeadsUpGroupEntry.summary).thenReturn(groupSummary)
            whenever(nonHeadsUpGroupEntry.representativeEntry).thenReturn(groupSummary)

+1 −2
Original line number Diff line number Diff line
@@ -51,8 +51,7 @@ class BundleEntry(spec: BundleSpec) : PipelineEntry(spec.key) {
        _children.clear()
    }

    /** @return Null because bundles do not have an associated NotificationEntry. */
    override fun getRepresentativeEntry(): NotificationEntry? {
    override fun asListEntry(): ListEntry? {
        return null
    }

+5 −2
Original line number Diff line number Diff line
@@ -119,12 +119,15 @@ public class ListDumper {
                .append(index.length() == 1 ? " " : "")
                .append(logKey(entry));

        final ListEntry listEntry = entry.asListEntry();
        final NotificationEntry notifEntry =
                listEntry == null ? null : listEntry.getRepresentativeEntry();

        if (includeParent) {
            sb.append(" (parent=")
                    .append(logKey(entry.getParent()))
                    .append(")");

            NotificationEntry notifEntry = entry.getRepresentativeEntry();
            if (notifEntry != null) {
                sb.append(" rank=")
                        .append(notifEntry.getRanking().getRank());
@@ -137,7 +140,7 @@ public class ListDumper {
        }

        if (includeRecordKeeping) {
            NotificationEntry notifEntry = requireNonNull(entry.getRepresentativeEntry());
            requireNonNull(notifEntry);
            StringBuilder rksb = new StringBuilder();

            if (!notifEntry.mLifetimeExtenders.isEmpty()) {
+5 −0
Original line number Diff line number Diff line
@@ -54,6 +54,11 @@ public abstract class ListEntry extends PipelineEntry {
     */
    public abstract @Nullable NotificationEntry getRepresentativeEntry();

    @Override
    public final ListEntry asListEntry() {
        return this;
    }

    @Nullable public PipelineEntry getParent() {
        return mAttachState.getParent();
    }
+2 −5
Original line number Diff line number Diff line
@@ -51,12 +51,9 @@ public abstract class PipelineEntry {
    }

    /**
     * @return The representative NotificationEntry:
     *      for NotificationEntry, return itself
     *      for GroupEntry, return the summary NotificationEntry, or null if it does not exist
     *      for BundleEntry, return null
     * @return This {@link PipelineEntry} as a {@link ListEntry}, or {@code null}.
     */
    public abstract @Nullable NotificationEntry getRepresentativeEntry();
    public abstract @Nullable ListEntry asListEntry();

    /**
     * @return NotifSection that ShadeListBuilder assigned to this PipelineEntry.
Loading