Remove FILTER_UNSEEN_NOTIFS_ON_KEYGUARD flag

Test: atest SystemUITests
Fixes: 276962801
Change-Id: Id451d0adddf20a7f84793ca8ea62e9b9667bc3d0
This commit is contained in:
Jeff DeCew
2023-04-04 17:41:04 -04:00
parent c9b630899d
commit 502350b9f6
6 changed files with 7 additions and 50 deletions

View File

@@ -93,9 +93,6 @@ object Flags {
val NOTIFICATION_INLINE_REPLY_ANIMATION =
releasedFlag(174148361, "notification_inline_reply_animation")
val FILTER_UNSEEN_NOTIFS_ON_KEYGUARD =
releasedFlag(254647461, "filter_unseen_notifs_on_keyguard")
// TODO(b/277338665): Tracking Bug
@JvmField
val NOTIFICATION_SHELF_REFACTOR =

View File

@@ -33,21 +33,12 @@ class NotifPipelineFlags @Inject constructor(
fun fsiOnDNDUpdate(): Boolean = featureFlags.isEnabled(Flags.FSI_ON_DND_UPDATE)
fun forceDemoteFsi(): Boolean =
sysPropFlags.isEnabled(NotificationFlags.FSI_FORCE_DEMOTE)
fun showStickyHunForDeniedFsi(): Boolean =
sysPropFlags.isEnabled(NotificationFlags.SHOW_STICKY_HUN_FOR_DENIED_FSI)
fun allowDismissOngoing(): Boolean =
sysPropFlags.isEnabled(NotificationFlags.ALLOW_DISMISS_ONGOING)
fun isOtpRedactionEnabled(): Boolean =
sysPropFlags.isEnabled(NotificationFlags.OTP_REDACTION)
val shouldFilterUnseenNotifsOnKeyguard: Boolean
get() = featureFlags.isEnabled(Flags.FILTER_UNSEEN_NOTIFS_ON_KEYGUARD)
val isNoHunForOldWhenEnabled: Boolean
get() = featureFlags.isEnabled(Flags.NO_HUN_FOR_OLD_WHEN)
}

View File

@@ -95,9 +95,7 @@ constructor(
pipeline.addFinalizeFilter(notifFilter)
keyguardNotificationVisibilityProvider.addOnStateChangedListener(::invalidateListFromFilter)
updateSectionHeadersVisibility()
if (notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard) {
attachUnseenFilter(pipeline)
}
attachUnseenFilter(pipeline)
}
private fun attachUnseenFilter(pipeline: NotifPipeline) {

View File

@@ -1942,8 +1942,7 @@ public class NotificationStackScrollLayoutController {
public void setNotifStats(@NonNull NotifStats notifStats) {
mNotifStats = notifStats;
mView.setHasFilteredOutSeenNotifications(
mNotifPipelineFlags.getShouldFilterUnseenNotifsOnKeyguard()
&& mSeenNotificationsProvider.getHasFilteredOutSeenNotifications());
mSeenNotificationsProvider.getHasFilteredOutSeenNotifications());
updateFooter();
updateShowEmptyShadeView();
}

View File

@@ -97,8 +97,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenFilterSuppressesSeenNotifWhileKeyguardShowing() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is not showing, shade is expanded, and a notification is present
keyguardRepository.setKeyguardShowing(false)
whenever(statusBarStateController.isExpanded).thenReturn(true)
@@ -124,8 +122,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenFilterStopsMarkingSeenNotifWhenTransitionToAod() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is not showing, shade is not expanded, and a notification is present
keyguardRepository.setKeyguardShowing(false)
whenever(statusBarStateController.isExpanded).thenReturn(false)
@@ -151,8 +147,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenFilter_headsUpMarkedAsSeen() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is not showing, shade is not expanded
keyguardRepository.setKeyguardShowing(false)
whenever(statusBarStateController.isExpanded).thenReturn(false)
@@ -183,14 +177,12 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenFilterDoesNotSuppressSeenOngoingNotifWhileKeyguardShowing() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is not showing, shade is expanded, and an ongoing notification is present
keyguardRepository.setKeyguardShowing(false)
whenever(statusBarStateController.isExpanded).thenReturn(true)
runKeyguardCoordinatorTest {
val fakeEntry = NotificationEntryBuilder()
.setNotification(Notification.Builder(mContext).setOngoing(true).build())
.setNotification(Notification.Builder(mContext, "id").setOngoing(true).build())
.build()
collectionListener.onEntryAdded(fakeEntry)
@@ -205,8 +197,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenFilterDoesNotSuppressSeenMediaNotifWhileKeyguardShowing() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is not showing, shade is expanded, and a media notification is present
keyguardRepository.setKeyguardShowing(false)
whenever(statusBarStateController.isExpanded).thenReturn(true)
@@ -229,8 +219,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenFilterUpdatesSeenProviderWhenSuppressing() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is not showing, shade is expanded, and a notification is present
keyguardRepository.setKeyguardShowing(false)
whenever(statusBarStateController.isExpanded).thenReturn(true)
@@ -255,8 +243,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenFilterInvalidatesWhenSettingChanges() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is not showing, and shade is expanded
keyguardRepository.setKeyguardShowing(false)
whenever(statusBarStateController.isExpanded).thenReturn(true)
@@ -292,8 +278,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenFilterAllowsNewNotif() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is showing, no notifications present
keyguardRepository.setKeyguardShowing(true)
runKeyguardCoordinatorTest {
@@ -308,8 +292,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenFilterSeenGroupSummaryWithUnseenChild() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is not showing, shade is expanded, and a notification is present
keyguardRepository.setKeyguardShowing(false)
whenever(statusBarStateController.isExpanded).thenReturn(true)
@@ -342,8 +324,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenNotificationIsMarkedAsSeenWhenKeyguardGoesAway() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is showing, not dozing, unseen notification is present
keyguardRepository.setKeyguardShowing(true)
keyguardRepository.setDozing(false)
@@ -370,8 +350,6 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
@Test
fun unseenNotificationIsNotMarkedAsSeenIfShadeNotExpanded() {
whenever(notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard).thenReturn(true)
// GIVEN: Keyguard is showing, unseen notification is present
keyguardRepository.setKeyguardShowing(true)
runKeyguardCoordinatorTest {
@@ -441,20 +419,15 @@ class KeyguardCoordinatorTest : SysuiTestCase() {
val unseenFilter: NotifFilter
get() = keyguardCoordinator.unseenNotifFilter
// TODO(254647461): Remove lazy from these properties once
// Flags.FILTER_UNSEEN_NOTIFS_ON_KEYGUARD is enabled and removed
val collectionListener: NotifCollectionListener by lazy {
withArgCaptor { verify(notifPipeline).addCollectionListener(capture()) }
val collectionListener: NotifCollectionListener = withArgCaptor {
verify(notifPipeline).addCollectionListener(capture())
}
val onHeadsUpChangedListener: OnHeadsUpChangedListener by lazy {
val onHeadsUpChangedListener: OnHeadsUpChangedListener get() =
withArgCaptor { verify(headsUpManager).addListener(capture()) }
}
val statusBarStateListener: StatusBarStateController.StateListener by lazy {
val statusBarStateListener: StatusBarStateController.StateListener get() =
withArgCaptor { verify(statusBarStateController).addCallback(capture()) }
}
var showOnlyUnseenNotifsOnKeyguardSetting: Boolean
get() =

View File

@@ -403,7 +403,6 @@ public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase {
@Test
public void testSetNotifStats_updatesHasFilteredOutSeenNotifications() {
when(mNotifPipelineFlags.getShouldFilterUnseenNotifsOnKeyguard()).thenReturn(true);
mSeenNotificationsProvider.setHasFilteredOutSeenNotifications(true);
mController.attach(mNotificationStackScrollLayout);
mController.getNotifStackController().setNotifStats(NotifStats.getEmpty());