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

Commit e1e61b28 authored by Ioana Alexandru's avatar Ioana Alexandru Committed by Android (Google) Code Review
Browse files

Merge "Fix app icon showing when grouped notif is dismissed via action" into main

parents e7948a42 ee612e21
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -96,6 +96,11 @@ public class NotificationChildrenContainer extends ViewGroup
        }
    }.setDuration(200);
    private static final SourceType FROM_PARENT = SourceType.from("FromParent(NCC)");
    /**
     * Temporary "flag" for a hack that works around an issue where isRemoved is always false for
     * rows.
     */
    private static final boolean USE_IS_CHANGING_POSITION_TO_RESTORE = true;

    private final List<View> mDividers = new ArrayList<>();
    private final List<ExpandableNotificationRow> mAttachedChildren = new ArrayList<>();
@@ -418,7 +423,7 @@ public class NotificationChildrenContainer extends ViewGroup
        row.setSystemChildExpanded(false);
        row.setNotificationFaded(false);
        row.setUserLocked(false);
        if (!row.isRemoved()) {
        if (shouldRestoreChild(row)) {
            mGroupingUtil.restoreChildNotification(row);
        }

@@ -426,6 +431,17 @@ public class NotificationChildrenContainer extends ViewGroup
        applyRoundnessAndInvalidate();
    }

    private static boolean shouldRestoreChild(ExpandableNotificationRow row) {
        // TODO: b/417457086 - We're only checking for isChangingPosition here as a quick-and-dirty
        //  fix for b/415665263, but the real issue is that isRemoved is currently ALWAYS false.
        //  We need to fix that behind a flag, so this hack is temporary.
        if (USE_IS_CHANGING_POSITION_TO_RESTORE) {
            return !row.isRemoved() && row.isChangingPosition();
        } else {
            return !row.isRemoved();
        }
    }

    /**
     * @return The number of notification children in the container.
     */