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

Commit aeff15f7 authored by Gus Prevas's avatar Gus Prevas
Browse files

Checks child importance when determining high priority-ness.

This change modifies the logic that locates the divider between high
priority and low priority notifications to consider a group summary
high priority if any of its children meet the criteria.

Test: manual
Bug: 120601946
Change-Id: Ic3d6ac3f1293073a32c90246fa9c702cf9adcbb1
parent 4f48e9a2
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -815,9 +815,18 @@ public class NotificationData {
    public boolean isHighPriority(StatusBarNotification statusBarNotification) {
        if (mRankingMap != null) {
            getRanking(statusBarNotification.getKey(), mTmpRanking);
            return mTmpRanking.getImportance() >= NotificationManager.IMPORTANCE_DEFAULT
            if (mTmpRanking.getImportance() >= NotificationManager.IMPORTANCE_DEFAULT
                    || statusBarNotification.getNotification().isForegroundService()
                    || statusBarNotification.getNotification().hasMediaSession();
                    || statusBarNotification.getNotification().hasMediaSession()) {
                return true;
            }
            if (mGroupManager.isSummaryOfGroup(statusBarNotification)) {
                for (Entry child : mGroupManager.getLogicalChildren(statusBarNotification)) {
                    if (isHighPriority(child.notification)) {
                        return true;
                    }
                }
            }
        }
        return false;
    }