diff options
| author | 2024-11-20 18:41:40 +0000 | |
|---|---|---|
| committer | 2024-11-20 18:41:40 +0000 | |
| commit | 41ea0b0685725479d878131e644e1f33cf263c6e (patch) | |
| tree | 6cde8fdbdcdfaea4cbbe3dc6e7c4dca106571746 | |
| parent | c8eda708afe8a81c6944223ce498ca3bd817fe04 (diff) | |
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
| -rw-r--r-- | core/java/android/app/Notification.java | 1 | ||||
| -rw-r--r-- | core/tests/coretests/src/android/app/NotificationTest.java | 17 |
2 files changed, 15 insertions, 3 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index b84c91b8276b..2bb50fd7b9f6 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -3263,6 +3263,7 @@ public class Notification implements Parcelable public boolean hasPromotableCharacteristics() { return isColorizedRequested() && hasTitle() + && !isGroupSummary() && !containsCustomViews() && hasPromotableStyle(); } diff --git a/core/tests/coretests/src/android/app/NotificationTest.java b/core/tests/coretests/src/android/app/NotificationTest.java index 23a09857032c..63e678d9ee53 100644 --- a/core/tests/coretests/src/android/app/NotificationTest.java +++ b/core/tests/coretests/src/android/app/NotificationTest.java @@ -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(); } |