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

Commit 41ea0b06 authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Notification.hasPromotableCharacteristics() requires that notification is not a group summary.

Also changed NotificationTest to stop adding FLAG_CAN_COLORIZE, which brings those tests in line with the changes from I6202e0c10f7481ef88656d154b7b3a57aac2ebd7.

Change-Id: I2c2271d92e1cfd8198aa56a9fe06701df7330c89
Flag: android.app.ui_rich_ongoing
Test: atest NotificationTest
Bug: 379335139
parent c8eda708
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3263,6 +3263,7 @@ public class Notification implements Parcelable
    public boolean hasPromotableCharacteristics() {
        return isColorizedRequested()
                && hasTitle()
                && !isGroupSummary()
                && !containsCustomViews()
                && hasPromotableStyle();
    }
+14 −3
Original line number Diff line number Diff line
@@ -467,7 +467,6 @@ public class NotificationTest {
                .setStyle(new Notification.BigTextStyle().setBigContentTitle("BIG"))
                .setColor(Color.WHITE)
                .setColorized(true)
                .setFlag(FLAG_CAN_COLORIZE, true)
                .build();
        assertThat(n.hasPromotableCharacteristics()).isTrue();
    }
@@ -481,7 +480,6 @@ public class NotificationTest {
                .setContentTitle("TITLE")
                .setColor(Color.WHITE)
                .setColorized(true)
                .setFlag(FLAG_CAN_COLORIZE, true)
                .build();
        assertThat(n.hasPromotableCharacteristics()).isFalse();
    }
@@ -505,7 +503,20 @@ public class NotificationTest {
                .setStyle(new Notification.BigTextStyle())
                .setColor(Color.WHITE)
                .setColorized(true)
                .setFlag(FLAG_CAN_COLORIZE, true)
                .build();
        assertThat(n.hasPromotableCharacteristics()).isFalse();
    }

    @Test
    @EnableFlags(Flags.FLAG_UI_RICH_ONGOING)
    public void testHasPromotableCharacteristics_groupSummary() {
        Notification n = new Notification.Builder(mContext, "test")
                .setSmallIcon(android.R.drawable.sym_def_app_icon)
                .setStyle(new Notification.BigTextStyle().setBigContentTitle("BIG"))
                .setColor(Color.WHITE)
                .setColorized(true)
                .setGroup("someGroup")
                .setGroupSummary(true)
                .build();
        assertThat(n.hasPromotableCharacteristics()).isFalse();
    }