From 766b4077fb85630c30ae428fae1a4799e6d4d8c6 Mon Sep 17 00:00:00 2001 From: Steve Elliott Date: Tue, 28 Jun 2022 17:20:30 -0400 Subject: [PATCH] Inline notif pipeline flag in NotifInterruptPrvdr This change is a no-op; the flag is now enabled-by-default, so all removed code paths here are effectively dead. Bug: 200269355 Test: atest SystemUITests Change-Id: I8e56a88eb0a03a4a3d5991ea238c22746be6ad1f --- .../NotificationInterruptStateProviderImpl.java | 5 ----- .../NotificationInterruptStateProviderImplTest.java | 8 ++++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java index 8378b69bee9a0..2dd95a3cbab89 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java @@ -294,11 +294,6 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter * @return true if these checks pass, false if the notification should not alert */ private boolean canAlertCommon(NotificationEntry entry) { - if (!mFlags.isNewPipelineEnabled() && mNotificationFilter.shouldFilterOut(entry)) { - mLogger.logNoAlertingFilteredOut(entry); - return false; - } - for (int i = 0; i < mSuppressors.size(); i++) { if (mSuppressors.get(i).suppressInterruptions(entry)) { mLogger.logNoAlertingSuppressedBy(entry, mSuppressors.get(i), /* awake */ false); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java index 3f56cf9cb8ad0..54cbe24df732f 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java @@ -206,11 +206,9 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { @Test public void testDoNotRunFilterOnNewPipeline() { - when(mFlags.isNewPipelineEnabled()).thenReturn(true); // WHEN this entry should be filtered out NotificationEntry entry = createNotification(IMPORTANCE_DEFAULT); mNotifInterruptionStateProvider.shouldHeadsUp(entry); - verify(mFlags, times(1)).isNewPipelineEnabled(); verify(mNotificationFilter, times(0)).shouldFilterOut(eq(entry)); } @@ -326,7 +324,8 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { public void testShouldNotHeadsUp_filtered() throws RemoteException { ensureStateForHeadsUpWhenAwake(); // Make canAlertCommon false by saying it's filtered out - when(mNotificationFilter.shouldFilterOut(any())).thenReturn(true); + when(mKeyguardNotificationVisibilityProvider.shouldHideNotification(any())) + .thenReturn(true); NotificationEntry entry = createNotification(IMPORTANCE_HIGH); assertThat(mNotifInterruptionStateProvider.shouldHeadsUp(entry)).isFalse(); @@ -504,7 +503,8 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { ensureStateForBubbleUp(); // Make canAlertCommon false by saying it's filtered out - when(mNotificationFilter.shouldFilterOut(any())).thenReturn(true); + when(mKeyguardNotificationVisibilityProvider.shouldHideNotification(any())) + .thenReturn(true); assertThat(mNotifInterruptionStateProvider.shouldBubbleUp(createBubble())).isFalse(); }