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

Commit 88086e71 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed a stackoverflow in notifications

Change-Id: I29ce76593af81ad6e326d2e273fd872a4d9d4a89
Fixes: 29464060
parent e5ec413c
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -213,18 +213,18 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged
        return isGroupSuppressed(getGroupKey(sbn)) && sbn.getNotification().isGroupSummary();
    }

    public boolean isOnlyChildInSuppressedGroup(StatusBarNotification sbn) {
        return isGroupSuppressed(sbn.getGroupKey())
                && isOnlyChild(sbn);
    }

    private boolean isOnlyChild(StatusBarNotification sbn) {
        return !sbn.getNotification().isGroupSummary()
                && getTotalNumberOfChildren(sbn) == 1;
    }

    public boolean isOnlyChildInGroup(StatusBarNotification sbn) {
        return isOnlyChild(sbn) && getLogicalGroupSummary(sbn) != null;
        if (!isOnlyChild(sbn)) {
            return false;
        }
        ExpandableNotificationRow logicalGroupSummary = getLogicalGroupSummary(sbn);
        return logicalGroupSummary != null
                && !logicalGroupSummary.getStatusBarNotification().equals(sbn);
    }

    private int getTotalNumberOfChildren(StatusBarNotification sbn) {