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

Commit 043b15d3 authored by Beverly's avatar Beverly
Browse files

Add null check for notifEntry's repEntry

The representative entry of a ListEntry can be null if
ListEntry is a GroupEntry without a summary. Therefore, add a null check
for a null representative entry.

Test: atest SystemUITests
Fixes: 148386837
Change-Id: If5622c4ae04b887a5a7744d2ee5998ad6874904b
parent a6983622
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -44,10 +44,11 @@ public abstract class ListEntry {

    /**
     * Should return the "representative entry" for this ListEntry. For NotificationEntries, its
     * the entry itself. For groups, it should be the summary. This method exists to interface with
     * the entry itself. For groups, it should be the summary (but if a summary doesn't exist,
     * this can return null). This method exists to interface with
     * legacy code that expects groups to also be NotificationEntries.
     */
    public abstract NotificationEntry getRepresentativeEntry();
    public abstract @Nullable NotificationEntry getRepresentativeEntry();

    @Nullable public GroupEntry getParent() {
        return mParent;
+4 −0
Original line number Diff line number Diff line
@@ -63,6 +63,10 @@ public class HighPriorityProvider {
        }

        final NotificationEntry notifEntry = entry.getRepresentativeEntry();
        if (notifEntry == null) {
            return false;
        }

        return notifEntry.getRanking().getImportance() >= NotificationManager.IMPORTANCE_DEFAULT
                || hasHighPriorityCharacteristics(notifEntry)
                || hasHighPriorityChild(entry);