summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff DeCew <jeffdq@google.com> 2023-04-04 17:41:04 -0400
committer Jeff DeCew <jeffdq@google.com> 2023-04-13 15:51:34 -0400
commit502350b9f644c4c40f3bf6e1ec15113ae6edbe3c (patch)
tree80d41d7dd369bbdda0c06a74b45b3b916b10b098
parentc9b630899d8868366e74f0cb887cb0131f042e36 (diff)
Remove FILTER_UNSEEN_NOTIFS_ON_KEYGUARD flag
Test: atest SystemUITests Fixes: 276962801 Change-Id: Id451d0adddf20a7f84793ca8ea62e9b9667bc3d0
-rw-r--r--packages/SystemUI/src/com/android/systemui/flags/Flags.kt3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt9
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinator.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java3
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinatorTest.kt37
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java1
6 files changed, 7 insertions, 50 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt
index 6aaad6fea157..d143c1660658 100644
--- a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt
+++ b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt
@@ -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 =
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt
index d2d623b73d44..fb8704750304 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotifPipelineFlags.kt
@@ -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)
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinator.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinator.kt
index 6322edf5a1b4..4cbbefe1cd73 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinator.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinator.kt
@@ -95,9 +95,7 @@ constructor(
pipeline.addFinalizeFilter(notifFilter)
keyguardNotificationVisibilityProvider.addOnStateChangedListener(::invalidateListFromFilter)
updateSectionHeadersVisibility()
- if (notifPipelineFlags.shouldFilterUnseenNotifsOnKeyguard) {
- attachUnseenFilter(pipeline)
- }
+ attachUnseenFilter(pipeline)
}
private fun attachUnseenFilter(pipeline: NotifPipeline) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
index 1c8727f1b092..88899a1753f0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
@@ -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();
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinatorTest.kt
index c2a2a40b7e5d..8f07f8d1a099 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinatorTest.kt
@@ -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() =
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java
index 485f2be99642..45b1f4d898a6 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java
@@ -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());