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

Commit fa5b96f6 authored by Jeff DeCew's avatar Jeff DeCew Committed by Android (Google) Code Review
Browse files

Merge "Notification.hasPromotableCharacteristics() requires that notification...

Merge "Notification.hasPromotableCharacteristics() requires that notification is not a group summary." into main
parents d2dba03e 41ea0b06
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();
    }