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

Commit abe0f448 authored by Justin Weir's avatar Justin Weir
Browse files

Disable StatusBarDisableFlagsInteractor with scenes enabled

If scenes are enabled, this produces bad data that disables the
Overview gesture and never re-enables it.

Fixes: 364587871
Test: Manually verified that the gesture works
Flag: com.android.systemui.scene_container
Change-Id: If1f3f58df5452b3ba8307088a06a5249fa85537b
parent 892d60c7
Loading
Loading
Loading
Loading
+53 −47
Original line number Diff line number Diff line
@@ -39,12 +39,14 @@ import com.android.systemui.navigation.domain.interactor.NavigationInteractor
import com.android.systemui.power.domain.interactor.PowerInteractor
import com.android.systemui.power.shared.model.WakeSleepReason
import com.android.systemui.power.shared.model.WakefulnessModel
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.user.domain.interactor.SelectedUserInteractor
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
@@ -75,6 +77,9 @@ constructor(
    private val disableToken: IBinder = Binder()

    private val disableFlagsForUserId =
        if (!KeyguardWmStateRefactor.isEnabled || SceneContainerFlag.isEnabled) {
            flowOf(Pair(0, StatusBarManager.DISABLE_NONE))
        } else {
            combine(
                    selectedUserInteractor.selectedUser,
                    keyguardTransitionInteractor.startedKeyguardTransitionStep.map { it.to },
@@ -127,10 +132,11 @@ constructor(
                    selectedUserId to flags
                }
                .distinctUntilChanged()
        }

    @SuppressLint("WrongConstant", "NonInjectedService")
    override fun start() {
        if (!KeyguardWmStateRefactor.isEnabled) {
        if (!KeyguardWmStateRefactor.isEnabled || SceneContainerFlag.isEnabled) {
            return
        }