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

Commit cfc310dd authored by Matías Hernández's avatar Matías Hernández Committed by Android (Google) Code Review
Browse files

Merge "Increase the lifcecyle span for listening in the Modes and DND Tiles" into main

parents d54afdcf a40eaffa
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.qs.QSHost
import com.android.systemui.qs.QsEventLogger
import com.android.systemui.qs.asQSTileIcon
import com.android.systemui.qs.flags.QsInCompose
import com.android.systemui.qs.logging.QSLogger
import com.android.systemui.qs.tileimpl.QSTileImpl
import com.android.systemui.qs.tiles.base.shared.model.QSTileConfigProvider
@@ -88,7 +89,11 @@ constructor(

    init {
        lifecycle.coroutineScope.launch {
            lifecycle.repeatOnLifecycle(Lifecycle.State.RESUMED) {
            lifecycle.repeatOnLifecycle(
                // TODO: b/403434908 - Workaround for "not listening to tile updates". Can be reset
                //   to RESUMED if either b/403434908 is fixed or QsInCompose is inlined.
                if (QsInCompose.isEnabled) Lifecycle.State.RESUMED else Lifecycle.State.CREATED
            ) {
                dataInteractor.tileData().collect { refreshState(it) }
            }
        }
+6 −4
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ import com.android.systemui.animation.Expandable
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.modes.shared.ModesUi
import com.android.systemui.modes.shared.ModesUiIcons
import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.plugins.FalsingManager
import com.android.systemui.plugins.qs.QSTile
@@ -40,6 +39,7 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.qs.QSHost
import com.android.systemui.qs.QsEventLogger
import com.android.systemui.qs.asQSTileIcon
import com.android.systemui.qs.flags.QsInCompose
import com.android.systemui.qs.logging.QSLogger
import com.android.systemui.qs.tileimpl.QSTileImpl
import com.android.systemui.qs.tiles.base.shared.model.QSTileConfigProvider
@@ -88,10 +88,12 @@ constructor(
    private val config = qsTileConfigProvider.getConfig(TILE_SPEC)

    init {
        /* Check if */ ModesUiIcons.isUnexpectedlyInLegacyMode()

        lifecycle.coroutineScope.launch {
            lifecycle.repeatOnLifecycle(Lifecycle.State.RESUMED) {
            lifecycle.repeatOnLifecycle(
                // TODO: b/403434908 - Workaround for "not listening to tile updates". Can be reset
                //   to RESUMED if either b/403434908 is fixed or QsInCompose is inlined.
                if (QsInCompose.isEnabled) Lifecycle.State.RESUMED else Lifecycle.State.CREATED
            ) {
                dataInteractor.tileData().collect { refreshState(it) }
            }
        }