Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0bb97ed9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes Ieab0c35e,I98c54787 into tm-qpr-dev

* changes:
  Delete REMOVE_UNRANKED_NOTIFICATIONS flag.
  Delete SMARTSPACE_DEDUPING flag
parents 15e32921 f9d66aee
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -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);
@@ -158,9 +154,6 @@ public class Flags {

    /***************************************/
    // 400 - smartspace
    // TODO(b/254513080): Tracking Bug
    public static final ReleasedFlag SMARTSPACE_DEDUPING =
            new ReleasedFlag(400);

    // TODO(b/254513100): Tracking Bug
    public static final ReleasedFlag SMARTSPACE_SHARED_ELEMENT_TRANSITION_ENABLED =
+1 −6
Original line number Diff line number Diff line
@@ -28,12 +28,7 @@ class NotifPipelineFlags @Inject constructor(
    fun isDevLoggingEnabled(): Boolean =
        featureFlags.isEnabled(Flags.NOTIFICATION_PIPELINE_DEVELOPER_LOGGING)

    fun isSmartspaceDedupingEnabled(): Boolean =
            featureFlags.isEnabled(Flags.SMARTSPACE) &&
                    featureFlags.isEnabled(Flags.SMARTSPACE_DEDUPING)

    fun removeUnrankedNotifs(): Boolean =
        featureFlags.isEnabled(Flags.REMOVE_UNRANKED_NOTIFICATIONS)
    fun isSmartspaceDedupingEnabled(): Boolean = featureFlags.isEnabled(Flags.SMARTSPACE)

    fun fullScreenIntentRequiresKeyguard(): Boolean =
        featureFlags.isEnabled(Flags.FSI_REQUIRES_KEYGUARD)
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −38
Original line number Diff line number Diff line
@@ -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);