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

Commit 49bff38a authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Ignore summary time if it has children

We don't show the summary time if there are children, and even when the
time of them is explicitly set, it's often wrong.

Test: RankingHelperTest
Bug: 330193582
Fixes: 334945760
Flag: android.app.sort_section_by_time STAGING
Change-Id: I720fdb65ad5bd2bad1532f44f54780264b529b85
parent 4efcb55d
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -147,11 +147,9 @@ public class RankingHelper {
                if (sortSectionByTime()) {
                    final String groupKey = record.getGroupKey();
                    NotificationRecord existingProxy = mProxyByGroupTmp.get(groupKey);
                    // summaries are mostly hidden in systemui - if there is a child notification
                    // with better information, use its rank
                    if (existingProxy == null
                            || (existingProxy.getNotification().isGroupSummary()
                            && !existingProxy.getNotification().hasAppProvidedWhen())) {
                    // summaries are mostly hidden in systemui - if there is a child notification,
                    // use its rank
                    if (existingProxy == null || existingProxy.getNotification().isGroupSummary()) {
                        mProxyByGroupTmp.put(groupKey, record);
                    }
                } else {
+1 −1
Original line number Diff line number Diff line
@@ -517,10 +517,10 @@ public class RankingHelperTest extends UiServiceTestCase {
                        mUser, null, System.currentTimeMillis()), getLowChannel());

        ArrayList<NotificationRecord> expected = new ArrayList<>();
        expected.add(unrelated);
        expected.add(summary);
        expected.add(child2);
        expected.add(child1);
        expected.add(unrelated);

        ArrayList<NotificationRecord> actual = new ArrayList<>();
        actual.addAll(expected);