Delete REMOVE_UNRANKED_NOTIFICATIONS flag.

Bug: 216384850
Fixes: 254512703
Test: NotifCollectionTest
Change-Id: Ieab0c35e8f95533e2c20766b4f484ca15f7061ce
This commit is contained in:
Jeff DeCew
2022-10-20 19:46:03 +00:00
parent 1d1326485f
commit f9d66aee5d
4 changed files with 2 additions and 46 deletions

View File

@@ -61,10 +61,6 @@ public class Flags {
public static final ResourceBooleanFlag NOTIFICATION_DRAG_TO_CONTENTS =
new ResourceBooleanFlag(108, R.bool.config_notificationToContents);
// TODO(b/254512703): Tracking Bug
public static final ReleasedFlag REMOVE_UNRANKED_NOTIFICATIONS =
new ReleasedFlag(109);
// TODO(b/254512517): Tracking Bug
public static final UnreleasedFlag FSI_REQUIRES_KEYGUARD =
new UnreleasedFlag(110, true);

View File

@@ -30,9 +30,6 @@ class NotifPipelineFlags @Inject constructor(
fun isSmartspaceDedupingEnabled(): Boolean = featureFlags.isEnabled(Flags.SMARTSPACE)
fun removeUnrankedNotifs(): Boolean =
featureFlags.isEnabled(Flags.REMOVE_UNRANKED_NOTIFICATIONS)
fun fullScreenIntentRequiresKeyguard(): Boolean =
featureFlags.isEnabled(Flags.FSI_REQUIRES_KEYGUARD)

View File

@@ -602,7 +602,7 @@ public class NotifCollection implements Dumpable, PipelineDumpable {
mInconsistencyTracker.logNewMissingNotifications(rankingMap);
mInconsistencyTracker.logNewInconsistentRankings(currentEntriesWithoutRankings, rankingMap);
if (currentEntriesWithoutRankings != null && mNotifPipelineFlags.removeUnrankedNotifs()) {
if (currentEntriesWithoutRankings != null) {
for (NotificationEntry entry : currentEntriesWithoutRankings.values()) {
entry.mCancellationReason = REASON_UNKNOWN;
tryRemoveNotification(entry);

View File

@@ -1498,45 +1498,8 @@ public class NotifCollectionTest extends SysuiTestCase {
}
@Test
public void testMissingRankingWhenRemovalFeatureIsDisabled() {
public void testMissingRanking() {
// GIVEN a pipeline with one two notifications
when(mNotifPipelineFlags.removeUnrankedNotifs()).thenReturn(false);
String key1 = mNoMan.postNotif(buildNotif(TEST_PACKAGE, 1, "myTag")).key;
String key2 = mNoMan.postNotif(buildNotif(TEST_PACKAGE, 2, "myTag")).key;
NotificationEntry entry1 = mCollectionListener.getEntry(key1);
NotificationEntry entry2 = mCollectionListener.getEntry(key2);
clearInvocations(mCollectionListener);
// GIVEN the message for removing key1 gets does not reach NotifCollection
Ranking ranking1 = mNoMan.removeRankingWithoutEvent(key1);
// WHEN the message for removing key2 arrives
mNoMan.retractNotif(entry2.getSbn(), REASON_APP_CANCEL);
// THEN only entry2 gets removed
verify(mCollectionListener).onEntryRemoved(eq(entry2), eq(REASON_APP_CANCEL));
verify(mCollectionListener).onEntryCleanUp(eq(entry2));
verify(mCollectionListener).onRankingApplied();
verifyNoMoreInteractions(mCollectionListener);
verify(mLogger).logMissingRankings(eq(List.of(entry1)), eq(1), any());
verify(mLogger, never()).logRecoveredRankings(any(), anyInt());
clearInvocations(mCollectionListener, mLogger);
// WHEN a ranking update includes key1 again
mNoMan.setRanking(key1, ranking1);
mNoMan.issueRankingUpdate();
// VERIFY that we do nothing but log the 'recovery'
verify(mCollectionListener).onRankingUpdate(any());
verify(mCollectionListener).onRankingApplied();
verifyNoMoreInteractions(mCollectionListener);
verify(mLogger, never()).logMissingRankings(any(), anyInt(), any());
verify(mLogger).logRecoveredRankings(eq(List.of(key1)), eq(0));
}
@Test
public void testMissingRankingWhenRemovalFeatureIsEnabled() {
// GIVEN a pipeline with one two notifications
when(mNotifPipelineFlags.removeUnrankedNotifs()).thenReturn(true);
String key1 = mNoMan.postNotif(buildNotif(TEST_PACKAGE, 1, "myTag")).key;
String key2 = mNoMan.postNotif(buildNotif(TEST_PACKAGE, 2, "myTag")).key;
NotificationEntry entry1 = mCollectionListener.getEntry(key1);