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

Commit 3dc2102a authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove the "ungroupTopUnseen" prototype setting" into main

parents f838137d a7d91592
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -196,16 +196,14 @@ class LockScreenMinimalismCoordinatorTest : SysuiTestCase() {
            kosmos.activeNotificationListRepository.topOngoingNotificationKey.value = null
            kosmos.activeNotificationListRepository.topUnseenNotificationKey.value = child2.key
            assertThat(promoter.shouldPromoteToTopLevel(child1)).isFalse()
            assertThat(promoter.shouldPromoteToTopLevel(child2))
                .isEqualTo(NotificationMinimalism.ungroupTopUnseen)
            assertThat(promoter.shouldPromoteToTopLevel(child2)).isFalse()
            assertThat(promoter.shouldPromoteToTopLevel(child3)).isFalse()
            assertThat(promoter.shouldPromoteToTopLevel(parent)).isFalse()

            kosmos.activeNotificationListRepository.topOngoingNotificationKey.value = child1.key
            kosmos.activeNotificationListRepository.topUnseenNotificationKey.value = child2.key
            assertThat(promoter.shouldPromoteToTopLevel(child1)).isTrue()
            assertThat(promoter.shouldPromoteToTopLevel(child2))
                .isEqualTo(NotificationMinimalism.ungroupTopUnseen)
            assertThat(promoter.shouldPromoteToTopLevel(child2)).isFalse()
            assertThat(promoter.shouldPromoteToTopLevel(child3)).isFalse()
            assertThat(promoter.shouldPromoteToTopLevel(parent)).isFalse()
        }
+1 −2
Original line number Diff line number Diff line
@@ -219,8 +219,7 @@ constructor(
                    NotificationMinimalism.isUnexpectedlyInLegacyMode() -> false
                    !minimalismEnabled -> false
                    seenNotificationsInteractor.isTopOngoingNotification(child) -> true
                    !NotificationMinimalism.ungroupTopUnseen -> false
                    else -> seenNotificationsInteractor.isTopUnseenNotification(child)
                    else -> false
                }
        }

+0 −13
Original line number Diff line number Diff line
@@ -35,19 +35,6 @@ object NotificationMinimalism {
    inline val isEnabled
        get() = Flags.notificationMinimalism()

    /**
     * The prototype will (by default) use a promoter to ensure that the top unseen notification is
     * not grouped, but this property read allows that behavior to be disabled.
     */
    val ungroupTopUnseen: Boolean
        get() =
            if (isUnexpectedlyInLegacyMode()) false
            else
                SystemProperties.getBoolean(
                    "persist.notification_minimalism_prototype.ungroup_top_unseen",
                    false
                )

    /**
     * Called to ensure code is only run when the flag is enabled. This protects users from the
     * unintended behaviors caused by accidentally running new logic, while also crashing on an eng