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

Commit e0a11a0c authored by Yining Liu's avatar Yining Liu
Browse files

Rename flag helper class name for notification_minimalism

Rename the flag helper class name for notification_minimalism.
Original name: NotificationMinimalismPrototype
New name: NotificationMinimalism

Bug: 330387368
Bug: 354047572
Flag: com.android.server.notification.notification_minimalism
Test: atest SystemUITests

Change-Id: Ibded3d68ca56de613373b8872b6d524852a7dc30
parent fbbfe48d
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ import com.android.systemui.statusbar.notification.collection.modifyEntry
import com.android.systemui.statusbar.notification.collection.notifcollection.NotifCollectionListener
import com.android.systemui.statusbar.notification.data.repository.FakeHeadsUpRowRepository
import com.android.systemui.statusbar.notification.data.repository.activeNotificationListRepository
import com.android.systemui.statusbar.notification.shared.NotificationMinimalismPrototype
import com.android.systemui.statusbar.notification.shared.NotificationMinimalism
import com.android.systemui.statusbar.notification.stack.data.repository.headsUpNotificationRepository
import com.android.systemui.testKosmos
import com.android.systemui.util.settings.FakeSettings
@@ -66,7 +66,7 @@ import org.mockito.kotlin.whenever

@SmallTest
@RunWith(AndroidJUnit4::class)
@EnableFlags(NotificationMinimalismPrototype.FLAG_NAME)
@EnableFlags(NotificationMinimalism.FLAG_NAME)
class LockScreenMinimalismCoordinatorTest : SysuiTestCase() {

    private val kosmos =
@@ -193,7 +193,7 @@ class LockScreenMinimalismCoordinatorTest : SysuiTestCase() {
            kosmos.activeNotificationListRepository.topUnseenNotificationKey.value = child2.key
            assertThat(promoter.shouldPromoteToTopLevel(child1)).isFalse()
            assertThat(promoter.shouldPromoteToTopLevel(child2))
                .isEqualTo(NotificationMinimalismPrototype.ungroupTopUnseen)
                .isEqualTo(NotificationMinimalism.ungroupTopUnseen)
            assertThat(promoter.shouldPromoteToTopLevel(child3)).isFalse()
            assertThat(promoter.shouldPromoteToTopLevel(parent)).isFalse()

@@ -201,7 +201,7 @@ class LockScreenMinimalismCoordinatorTest : SysuiTestCase() {
            kosmos.activeNotificationListRepository.topUnseenNotificationKey.value = child2.key
            assertThat(promoter.shouldPromoteToTopLevel(child1)).isTrue()
            assertThat(promoter.shouldPromoteToTopLevel(child2))
                .isEqualTo(NotificationMinimalismPrototype.ungroupTopUnseen)
                .isEqualTo(NotificationMinimalism.ungroupTopUnseen)
            assertThat(promoter.shouldPromoteToTopLevel(child3)).isFalse()
            assertThat(promoter.shouldPromoteToTopLevel(parent)).isFalse()
        }
+2 −2
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder
import com.android.systemui.statusbar.notification.shared.NotificationMinimalismPrototype
import com.android.systemui.statusbar.notification.shared.NotificationMinimalism
import com.android.systemui.testKosmos
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.test.runTest
@@ -57,7 +57,7 @@ class SeenNotificationsInteractorTest : SysuiTestCase() {
    }

    @Test
    @EnableFlags(NotificationMinimalismPrototype.FLAG_NAME)
    @EnableFlags(NotificationMinimalism.FLAG_NAME)
    fun topOngoingAndUnseenNotification() = runTest {
        val entry1 = NotificationEntryBuilder().setTag("entry1").build()
        val entry2 = NotificationEntryBuilder().setTag("entry2").build()
+2 −2
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ import com.android.systemui.statusbar.notification.emptyshade.shared.ModesEmptyS
import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor
import com.android.systemui.statusbar.notification.interruption.VisualInterruptionRefactor
import com.android.systemui.statusbar.notification.shared.NotificationAvalancheSuppression
import com.android.systemui.statusbar.notification.shared.NotificationMinimalismPrototype
import com.android.systemui.statusbar.notification.shared.NotificationMinimalism
import com.android.systemui.statusbar.notification.shared.NotificationThrottleHun
import com.android.systemui.statusbar.notification.shared.PriorityPeopleSection
import javax.inject.Inject
@@ -57,7 +57,7 @@ class FlagDependencies @Inject constructor(featureFlags: FeatureFlagsClassic, ha
        // Internal notification frontend dependencies
        NotificationAvalancheSuppression.token dependsOn VisualInterruptionRefactor.token
        PriorityPeopleSection.token dependsOn SortBySectionTimeFlag.token
        NotificationMinimalismPrototype.token dependsOn NotificationThrottleHun.token
        NotificationMinimalism.token dependsOn NotificationThrottleHun.token
        ModesEmptyShadeFix.token dependsOn FooterViewRefactor.token
        ModesEmptyShadeFix.token dependsOn modesUi

+2 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ import com.android.internal.annotations.VisibleForTesting
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags.NOTIFICATIONS_USE_PEOPLE_FILTERING
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.statusbar.notification.collection.NotificationClassificationFlag
import com.android.systemui.statusbar.notification.shared.NotificationMinimalismPrototype
import com.android.systemui.statusbar.notification.shared.NotificationMinimalism
import com.android.systemui.statusbar.notification.shared.PriorityPeopleSection
import com.android.systemui.statusbar.notification.stack.BUCKET_ALERTING
import com.android.systemui.statusbar.notification.stack.BUCKET_FOREGROUND_SERVICE
@@ -54,7 +54,7 @@ constructor(val proxy: DeviceConfigProxy, val context: Context) {
    fun getNotificationBuckets(): IntArray {
        if (
            PriorityPeopleSection.isEnabled ||
                NotificationMinimalismPrototype.isEnabled ||
                NotificationMinimalism.isEnabled ||
                NotificationClassificationFlag.isEnabled
        ) {
            // We don't need this list to be adaptive, it can be the superset of all features.
+8 −8
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ import com.android.systemui.statusbar.notification.collection.listbuilder.plugga
import com.android.systemui.statusbar.notification.collection.notifcollection.NotifCollectionListener
import com.android.systemui.statusbar.notification.domain.interactor.HeadsUpNotificationInteractor
import com.android.systemui.statusbar.notification.domain.interactor.SeenNotificationsInteractor
import com.android.systemui.statusbar.notification.shared.NotificationMinimalismPrototype
import com.android.systemui.statusbar.notification.shared.NotificationMinimalism
import com.android.systemui.statusbar.notification.stack.BUCKET_TOP_ONGOING
import com.android.systemui.statusbar.notification.stack.BUCKET_TOP_UNSEEN
import com.android.systemui.util.asIndenting
@@ -77,7 +77,7 @@ constructor(
    private var unseenFilterEnabled = false

    override fun attach(pipeline: NotifPipeline) {
        if (NotificationMinimalismPrototype.isUnexpectedlyInLegacyMode()) {
        if (NotificationMinimalism.isUnexpectedlyInLegacyMode()) {
            return
        }
        pipeline.addPromoter(unseenNotifPromoter)
@@ -132,7 +132,7 @@ constructor(
    private fun unseenFeatureEnabled(): Flow<Boolean> {
        // TODO(b/330387368): create LOCK_SCREEN_NOTIFICATION_MINIMALISM setting to use here?
        //  Or should we actually just repurpose using the existing setting?
        if (NotificationMinimalismPrototype.isEnabled) {
        if (NotificationMinimalism.isEnabled) {
            return flowOf(true)
        }
        return seenNotificationsInteractor.isLockScreenShowOnlyUnseenNotificationsEnabled()
@@ -178,7 +178,7 @@ constructor(
        }

    private fun pickOutTopUnseenNotifs(list: List<ListEntry>) {
        if (NotificationMinimalismPrototype.isUnexpectedlyInLegacyMode()) return
        if (NotificationMinimalism.isUnexpectedlyInLegacyMode()) return
        if (!unseenFilterEnabled) return
        // Only ever elevate a top unseen notification on keyguard, not even locked shade
        if (statusBarStateController.state != StatusBarState.KEYGUARD) {
@@ -215,9 +215,9 @@ constructor(
        object : NotifPromoter(TAG) {
            override fun shouldPromoteToTopLevel(child: NotificationEntry): Boolean =
                when {
                    NotificationMinimalismPrototype.isUnexpectedlyInLegacyMode() -> false
                    NotificationMinimalism.isUnexpectedlyInLegacyMode() -> false
                    seenNotificationsInteractor.isTopOngoingNotification(child) -> true
                    !NotificationMinimalismPrototype.ungroupTopUnseen -> false
                    !NotificationMinimalism.ungroupTopUnseen -> false
                    else -> seenNotificationsInteractor.isTopUnseenNotification(child)
                }
        }
@@ -225,7 +225,7 @@ constructor(
    val topOngoingSectioner =
        object : NotifSectioner("TopOngoing", BUCKET_TOP_ONGOING) {
            override fun isInSection(entry: ListEntry): Boolean {
                if (NotificationMinimalismPrototype.isUnexpectedlyInLegacyMode()) return false
                if (NotificationMinimalism.isUnexpectedlyInLegacyMode()) return false
                return entry.anyEntry { notificationEntry ->
                    seenNotificationsInteractor.isTopOngoingNotification(notificationEntry)
                }
@@ -235,7 +235,7 @@ constructor(
    val topUnseenSectioner =
        object : NotifSectioner("TopUnseen", BUCKET_TOP_UNSEEN) {
            override fun isInSection(entry: ListEntry): Boolean {
                if (NotificationMinimalismPrototype.isUnexpectedlyInLegacyMode()) return false
                if (NotificationMinimalism.isUnexpectedlyInLegacyMode()) return false
                return entry.anyEntry { notificationEntry ->
                    seenNotificationsInteractor.isTopUnseenNotification(notificationEntry)
                }
Loading