Skip to content

Commit 6139855

Browse files
notif: Enable autoCancel flag for summary notification
On older Android versions, if autoCancel is not specified, the summary notification may linger even after all child notifications have been opened and cleared.
1 parent 365f9da commit 6139855

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/notifications/display.dart

+4
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ class NotificationDisplayManager {
158158
inboxStyle: InboxStyle(
159159
// TODO(#570) Show organization name, not URL
160160
summaryText: data.realmUri.toString()),
161+
// On older Android versions, if autoCancel is not specified,
162+
// the summary notification may linger even after all child
163+
// notifications have been opened and cleared.
164+
autoCancel: true,
161165
);
162166
}
163167

test/notifications/display_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void main() {
150150
..isGroupSummary.equals(true)
151151
..inboxStyle.which((it) => it.isNotNull()
152152
..summaryText.equals(data.realmUri.toString()))
153-
..autoCancel.isNull()
153+
..autoCancel.equals(true)
154154
..contentIntent.isNull()
155155
]);
156156
}

0 commit comments

Comments
 (0)