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

Commit 7e21ef8b authored by Yining Liu's avatar Yining Liu Committed by Android (Google) Code Review
Browse files

Merge changes from topic "notif_minimalism_settings" into main

* changes:
  Enable Show Only Unseen Notifs when Minimalism is enabled
  Add New SecureSettings Constant for Notification Minimalism
  Rename flag helper class name for notification_minimalism
  Move aconfig flag NOTIFICATION_MINIMALISM_PROTOTYPE
parents 04b35349 651a6220
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -10749,6 +10749,16 @@ public final class Settings {
        public static final String LOCK_SCREEN_SHOW_ONLY_UNSEEN_NOTIFICATIONS =
                "lock_screen_show_only_unseen_notifications";
        /**
         * Indicates whether to minimalize the number of notifications to show on the lockscreen.
         * <p>
         * Type: int (0 for false, 1 for true)
         *
         * @hide
         */
        public static final String LOCK_SCREEN_NOTIFICATION_MINIMALISM =
                "lock_screen_notification_minimalism";
        /**
         * Indicates whether snooze options should be shown on notifications
         * <p>
+1 −0
Original line number Diff line number Diff line
@@ -164,6 +164,7 @@ public class SecureSettings {
        Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS,
        Settings.Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS,
        Settings.Secure.LOCK_SCREEN_SHOW_ONLY_UNSEEN_NOTIFICATIONS,
        Settings.Secure.LOCK_SCREEN_NOTIFICATION_MINIMALISM,
        Settings.Secure.SHOW_NOTIFICATION_SNOOZE,
        Settings.Secure.NOTIFICATION_HISTORY_ENABLED,
        Settings.Secure.ZEN_DURATION,
+1 −0
Original line number Diff line number Diff line
@@ -243,6 +243,7 @@ public class SecureSettingsValidators {
        VALIDATORS.put(Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.LOCK_SCREEN_SHOW_ONLY_UNSEEN_NOTIFICATIONS, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.LOCK_SCREEN_NOTIFICATION_MINIMALISM, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.SHOW_NOTIFICATION_SNOOZE, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.NOTIFICATION_HISTORY_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.ZEN_DURATION, ANY_INTEGER_VALIDATOR);
+0 −10
Original line number Diff line number Diff line
@@ -39,16 +39,6 @@ flag {
   bug: "343942780"
}

flag {
   name: "notification_minimalism_prototype"
   namespace: "systemui"
   description: "Prototype of notification minimalism; the new 'Intermediate' lockscreen customization proposal."
   bug: "330387368"
   metadata {
        purpose: PURPOSE_BUGFIX
   }
}

flag {
   name: "notification_view_flipper_pausing_v2"
   namespace: "systemui"
+6 −5
Original line number Diff line number Diff line
@@ -42,7 +42,8 @@ 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.domain.interactor.lockScreenNotificationMinimalismSetting
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 +67,7 @@ import org.mockito.kotlin.whenever

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

    private val kosmos =
@@ -76,7 +77,7 @@ class LockScreenMinimalismCoordinatorTest : SysuiTestCase() {
                mock<SysuiStatusBarStateController>().also { mock ->
                    doAnswer { statusBarState.ordinal }.whenever(mock).state
                }
            fakeSettings.putInt(Settings.Secure.LOCK_SCREEN_SHOW_ONLY_UNSEEN_NOTIFICATIONS, 1)
            lockScreenNotificationMinimalismSetting = true
        }
    private val notifPipeline: NotifPipeline = mock()
    private var statusBarState: StatusBarState = StatusBarState.KEYGUARD
@@ -193,7 +194,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 +202,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()
        }
Loading