Dont clear Notifs with FLAG_NO_CLEAR
Fixes: 206842750 Test: NotifCollectionTest Change-Id: Ic43e605560e2d158e72dce070e92d1ffc08b0d96
This commit is contained in:
@@ -56,7 +56,6 @@ import android.service.notification.NotificationListenerService.RankingMap;
|
||||
import android.service.notification.StatusBarNotification;
|
||||
import android.util.ArrayMap;
|
||||
import android.util.Pair;
|
||||
import android.util.Slog;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -756,6 +755,7 @@ public class NotifCollection implements Dumpable {
|
||||
&& !entry.getSbn().getNotification().isGroupSummary()
|
||||
&& !hasFlag(entry, Notification.FLAG_ONGOING_EVENT)
|
||||
&& !hasFlag(entry, Notification.FLAG_BUBBLE)
|
||||
&& !hasFlag(entry, Notification.FLAG_NO_CLEAR)
|
||||
&& entry.getDismissState() != DISMISSED;
|
||||
}
|
||||
|
||||
|
||||
@@ -1468,6 +1468,18 @@ public class NotifCollectionTest extends SysuiTestCase {
|
||||
container, container.getSbn().getGroupKey()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCannotDismissNoClearNotifications() {
|
||||
// GIVEN an no-clear notification
|
||||
final NotificationEntry container = new NotificationEntryBuilder()
|
||||
.setFlag(mContext, FLAG_NO_CLEAR, true)
|
||||
.build();
|
||||
|
||||
// THEN its children are not dismissible
|
||||
assertFalse(mCollection.shouldAutoDismissChildren(
|
||||
container, container.getSbn().getGroupKey()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCanDismissFgsNotificationChildren() {
|
||||
// GIVEN an FGS but not ongoing notification
|
||||
|
||||
Reference in New Issue
Block a user