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

Commit fc49c4e6 authored by Matt Pietal's avatar Matt Pietal Committed by Android (Google) Code Review
Browse files

Merge "Recalculate max notifications on lockscreen" into main

parents 2764910b 31c421da
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel
import com.android.systemui.res.R
import com.android.systemui.shade.NotificationPanelView
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController
import com.android.systemui.statusbar.notification.stack.NotificationStackSizeCalculator
import com.android.systemui.statusbar.notification.stack.ui.view.SharedNotificationContainer
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.SharedNotificationContainerViewModel
import javax.inject.Inject
@@ -44,6 +45,7 @@ constructor(
    sharedNotificationContainer: SharedNotificationContainer,
    sharedNotificationContainerViewModel: SharedNotificationContainerViewModel,
    controller: NotificationStackScrollLayoutController,
    notificationStackSizeCalculator: NotificationStackSizeCalculator,
    private val smartspaceViewModel: KeyguardSmartspaceViewModel,
) :
    NotificationStackScrollLayoutSection(
@@ -53,6 +55,7 @@ constructor(
        sharedNotificationContainer,
        sharedNotificationContainerViewModel,
        controller,
        notificationStackSizeCalculator,
    ) {
    override fun applyConstraints(constraintSet: ConstraintSet) {
        if (!featureFlags.isEnabled(Flags.MIGRATE_NSSL)) {
+3 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import com.android.systemui.keyguard.shared.model.KeyguardSection
import com.android.systemui.res.R
import com.android.systemui.shade.NotificationPanelView
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController
import com.android.systemui.statusbar.notification.stack.NotificationStackSizeCalculator
import com.android.systemui.statusbar.notification.stack.ui.view.SharedNotificationContainer
import com.android.systemui.statusbar.notification.stack.ui.viewbinder.SharedNotificationContainerBinder
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.SharedNotificationContainerViewModel
@@ -40,6 +41,7 @@ constructor(
    private val sharedNotificationContainer: SharedNotificationContainer,
    private val sharedNotificationContainerViewModel: SharedNotificationContainerViewModel,
    private val controller: NotificationStackScrollLayoutController,
    private val notificationStackSizeCalculator: NotificationStackSizeCalculator,
) : KeyguardSection() {
    private val placeHolderId = R.id.nssl_placeholder
    private var disposableHandle: DisposableHandle? = null
@@ -69,6 +71,7 @@ constructor(
                sharedNotificationContainer,
                sharedNotificationContainerViewModel,
                controller,
                notificationStackSizeCalculator,
            )
    }

+3 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel
import com.android.systemui.res.R
import com.android.systemui.shade.NotificationPanelView
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController
import com.android.systemui.statusbar.notification.stack.NotificationStackSizeCalculator
import com.android.systemui.statusbar.notification.stack.ui.view.SharedNotificationContainer
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.SharedNotificationContainerViewModel
import javax.inject.Inject
@@ -44,6 +45,7 @@ constructor(
    sharedNotificationContainer: SharedNotificationContainer,
    sharedNotificationContainerViewModel: SharedNotificationContainerViewModel,
    controller: NotificationStackScrollLayoutController,
    notificationStackSizeCalculator: NotificationStackSizeCalculator,
    private val smartspaceViewModel: KeyguardSmartspaceViewModel,
) :
    NotificationStackScrollLayoutSection(
@@ -53,6 +55,7 @@ constructor(
        sharedNotificationContainer,
        sharedNotificationContainerViewModel,
        controller,
        notificationStackSizeCalculator,
    ) {
    override fun applyConstraints(constraintSet: ConstraintSet) {
        if (!featureFlags.isEnabled(Flags.MIGRATE_NSSL)) {
+4 −4
Original line number Diff line number Diff line
@@ -1483,16 +1483,16 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
    }

    private void updateMaxDisplayedNotifications(boolean recompute) {
        if (mFeatureFlags.isEnabled(Flags.MIGRATE_NSSL)) {
            return;
        }

        if (recompute) {
            setMaxDisplayedNotifications(Math.max(computeMaxKeyguardNotifications(), 1));
        } else {
            if (SPEW_LOGCAT) Log.d(TAG, "Skipping computeMaxKeyguardNotifications() by request");
        }

        if (mFeatureFlags.isEnabled(Flags.MIGRATE_NSSL)) {
            return;
        }

        if (isKeyguardShowing() && !mKeyguardBypassController.getBypassEnabled()) {
            mNotificationStackScrollLayoutController.setMaxDisplayedNotifications(
                    mMaxAllowedKeyguardNotifications);
+14 −0
Original line number Diff line number Diff line
@@ -65,6 +65,10 @@ interface ShadeRepository {
     */
    @Deprecated("Use ShadeInteractor instead") val legacyShadeTracking: StateFlow<Boolean>

    /** Specifically tracks the user expanding the shade on the lockscreen only */
    @Deprecated("Use ShadeInteractor.isUserInteractingWithShade instead")
    val legacyLockscreenShadeTracking: MutableStateFlow<Boolean>

    /**
     * QuickSettingsController.mTracking as a flow. "Tracking" means that the user is moving quick
     * settings up or down with a pointer. Going forward, this concept will be replaced by checks
@@ -106,6 +110,9 @@ interface ShadeRepository {
    /** Sets whether the user is moving the shade with a pointer */
    fun setLegacyShadeTracking(tracking: Boolean)

    /** Sets whether the user is moving the shade with a pointer, on lockscreen only */
    fun setLegacyLockscreenShadeTracking(tracking: Boolean)

    /** Amount shade has expanded with regard to the UDFPS location */
    val udfpsTransitionToFullShadeProgress: StateFlow<Float>

@@ -177,6 +184,8 @@ constructor(shadeExpansionStateManager: ShadeExpansionStateManager) : ShadeRepos
    @Deprecated("Use ShadeInteractor instead")
    override val legacyShadeTracking: StateFlow<Boolean> = _legacyShadeTracking.asStateFlow()

    override val legacyLockscreenShadeTracking = MutableStateFlow(false)

    private val _legacyQsTracking = MutableStateFlow(false)
    @Deprecated("Use ShadeInteractor instead")
    override val legacyQsTracking: StateFlow<Boolean> = _legacyQsTracking.asStateFlow()
@@ -212,6 +221,11 @@ constructor(shadeExpansionStateManager: ShadeExpansionStateManager) : ShadeRepos
        _legacyShadeTracking.value = tracking
    }

    @Deprecated("Should only be called by NPVC and tests")
    override fun setLegacyLockscreenShadeTracking(tracking: Boolean) {
        legacyLockscreenShadeTracking.value = tracking
    }

    override fun setQsExpansion(qsExpansion: Float) {
        _qsExpansion.value = qsExpansion
    }
Loading