Merge "Process only app initiated removals in onEntryRemoved callback" into tm-dev am: 9095108312

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17546148

Change-Id: I0293390b64b2a89166761b1a9df41a1e03f20f55
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Sergey Serokurov
2022-04-05 17:16:25 +00:00
committed by Automerger Merge Worker
2 changed files with 5 additions and 3 deletions

View File

@@ -576,7 +576,9 @@ public class BubblesManager implements Dumpable {
@Override
public void onEntryRemoved(NotificationEntry entry,
@NotifCollection.CancellationReason int reason) {
BubblesManager.this.onEntryRemoved(entry);
if (reason == REASON_APP_CANCEL || reason == REASON_APP_CANCEL_ALL) {
BubblesManager.this.onEntryRemoved(entry);
}
}
@Override

View File

@@ -807,7 +807,7 @@ public class NewNotifPipelineBubblesTest extends SysuiTestCase {
assertTrue(mBubbleController.hasBubbles());
// Removes the notification
mEntryListener.onEntryRemoved(mRow, 0);
mEntryListener.onEntryRemoved(mRow, REASON_APP_CANCEL);
assertFalse(mBubbleController.hasBubbles());
}
@@ -938,7 +938,7 @@ public class NewNotifPipelineBubblesTest extends SysuiTestCase {
mBubblesManager.handleDismissalInterception(groupSummary.getEntry());
// WHEN the summary is cancelled by the app
mEntryListener.onEntryRemoved(groupSummary.getEntry(), 0);
mEntryListener.onEntryRemoved(groupSummary.getEntry(), REASON_APP_CANCEL);
// THEN the summary and its children are removed from bubble data
assertFalse(mBubbleData.hasBubbleInStackWithKey(groupedBubble.getEntry().getKey()));