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

Commit 40f88765 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed a potential heads up crash

If a group became suppressed with a summary that is
heads-upped, while also being in the process of being
removed, it could lead to a crash.

Test: isolate a HUN that was being removed and is a child
Change-Id: I943b63529778a3c85b03da033837f5a677b2d352
Fixes: 33645653
parent 9bb05631
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -416,6 +416,10 @@ public class NotificationGroupManager implements OnHeadsUpChangedListener {
                child = getIsolatedChild(sbn.getGroupKey());
            }
            if (child != null) {
                if (child.row.keepInParent() || child.row.isRemoved() || child.row.isDismissed()) {
                    // the notification is actually already removed, no need to do heads-up on it.
                    return;
                }
                if (mHeadsUpManager.isHeadsUp(child.key)) {
                    mHeadsUpManager.updateNotification(child, true);
                } else {
+7 −0
Original line number Diff line number Diff line
@@ -1929,6 +1929,13 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                    childIndex++) {
                ExpandableNotificationRow childView = orderedChildren.get(childIndex);
                if (children == null || !children.contains(childView)) {
                    if (childView.getParent() != null) {
                        Log.wtf(TAG, "trying to add a notification child that already has " +
                                "a parent. class:" + childView.getParent().getClass() +
                                "\n child: " + childView);
                        // This shouldn't happen. We can recover by removing it though.
                        ((ViewGroup) childView.getParent()).removeView(childView);
                    }
                    mVisualStabilityManager.notifyViewAddition(childView);
                    parent.addChildNotification(childView, childIndex);
                    mStackScroller.notifyGroupChildAdded(childView);