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

Commit f45de596 authored by Ioana Alexandru's avatar Ioana Alexandru Committed by Android (Google) Code Review
Browse files

Merge "[Flexiglass] Fix mPulsing not being set in NSSL." into main

parents 1118a75c ab360ffa
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -86,6 +86,9 @@ interface NotificationScrollView {
    /** Sets whether the view is displayed in doze mode. */
    fun setDozing(dozing: Boolean)

    /** Sets whether the view is displayed in pulsing mode. */
    fun setPulsing(pulsing: Boolean, animated: Boolean)

    /** Gets the inset for HUNs when they are not visible */
    fun getHeadsUpInset(): Int

+5 −0
Original line number Diff line number Diff line
@@ -88,6 +88,11 @@ constructor(
            launch { viewModel.qsExpandFraction.collect { view.setQsExpandFraction(it) } }
            launch { viewModel.isScrollable.collect { view.setScrollingEnabled(it) } }
            launch { viewModel.isDozing.collect { isDozing -> view.setDozing(isDozing) } }
            launch {
                viewModel.isPulsing.collect { isPulsing ->
                    view.setPulsing(isPulsing, viewModel.shouldAnimatePulse.value)
                }
            }
            launch {
                viewModel.shouldResetStackTop
                    .filter { it }
+19 −0
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ import dagger.Lazy
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.flowOf
@@ -213,6 +215,23 @@ constructor(
        }
    }

    /** Whether the notification stack is displayed in pulsing mode. */
    val isPulsing: Flow<Boolean> by lazy {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) {
            flowOf(false)
        } else {
            keyguardInteractor.get().isPulsing.dumpWhileCollecting("isPulsing")
        }
    }

    val shouldAnimatePulse: StateFlow<Boolean> by lazy {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) {
            MutableStateFlow(false)
        } else {
            keyguardInteractor.get().isAodAvailable
        }
    }

    @AssistedFactory
    interface Factory {
        fun create(): NotificationScrollViewModel
+6 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import com.android.systemui.doze.DozeHost;
import com.android.systemui.doze.DozeLog;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
import com.android.systemui.scene.shared.flag.SceneContainerFlag;

import javax.inject.Inject;

@@ -124,6 +125,11 @@ public class DozeScrimController implements StateListener {

        // Begin pulse. Note that it's very important that the pulse finished callback
        // be invoked when we're done so that the caller can drop the pulse wakelock.
        if (SceneContainerFlag.isEnabled()) {
            // ScrimController.Callback#onDisplayBlanked is no longer triggered when flexiglass is
            // on, but we still need to signal that pulsing has started.
            callback.onPulseStarted();
        }
        mPulseCallback = callback;
        mPulseReason = reason;
    }