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
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user