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

Commit c6bc0570 authored by Julia Tuttle's avatar Julia Tuttle Committed by Android (Google) Code Review
Browse files

Merge "Add FlowPreview @OptIns" into main

parents eb06ce14 9adb9a0c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import javax.inject.Inject
import kotlin.time.Duration.Companion.milliseconds
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.flow.debounce

@SysUISingleton
@@ -80,6 +81,7 @@ constructor(
    /**
     * Listen for the signal that we're waking up and figure what state we need to transition to.
     */
    @OptIn(FlowPreview::class)
    private fun listenForAodToAwake() {
        // Use PowerInteractor's wakefulness, which is the earliest wake signal available. We
        // have all of the information we need at this time to make a decision about where to
+2 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import javax.inject.Inject
import kotlin.time.Duration.Companion.milliseconds
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.flow.debounce

@SysUISingleton
@@ -114,6 +115,7 @@ constructor(
        }
    }

    @OptIn(FlowPreview::class)
    @SuppressLint("MissingPermission")
    private fun listenForDozingToAny() {
        if (KeyguardWmStateRefactor.isEnabled) {
+1 −0
Original line number Diff line number Diff line
@@ -125,6 +125,7 @@ constructor(
     * the power button is pressed quickly, we may need to go directly from DREAMING to
     * GLANCEABLE_HUB as the transition to DOZING has not occurred yet.
     */
    @OptIn(FlowPreview::class)
    @SuppressLint("MissingPermission")
    private fun listenForDreamingToGlanceableHubFromPowerButton() {
        if (!communalSettingsInteractor.isCommunalFlagEnabled()) return
+2 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ import javax.inject.Inject
import javax.inject.Provider
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
@@ -203,6 +204,7 @@ constructor(
     * examining the value of this flow, to let other consumers have enough time to also see that
     * same new value.
     */
    @OptIn(FlowPreview::class)
    val isAbleToDream: Flow<Boolean> =
        dozeTransitionModel
            .flatMapLatest { dozeTransitionModel ->
+2 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.SharedNotificationContainerViewModel
import javax.inject.Inject
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.flow.debounce

private val TAG = KeyguardTransitionAuditLogger::class.simpleName!!
@@ -52,6 +53,7 @@ constructor(
    private val deviceEntryInteractor: DeviceEntryInteractor,
) {

    @OptIn(FlowPreview::class)
    fun start() {
        scope.launch {
            powerInteractor.detailedWakefulness.collect {