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

Commit bdca58ca authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[SB] Never hide status bar if device isn't provisioned.

While a user is still setting up their device, never let the status bar
be hidden. This fix is a workaround for a deeper issue where the shade
is reporting itself as expanded during setup wizard, which is
unexpected.

No unit tests added in this CL because that will make this CL much
harder to cherrypick to the release, will add tests in a followup.

Bug: 418020209
Flag: EXEMPT bugfix
Test: In setup wizard, tap the status bar repeatedly -> verify the
status bar never hides
Test: smoke test of status bar on homescreen, shade, and lockscreen
Test: atest HomeStatusBarViewModelImplTest

Change-Id: I8cf4ceb4355a2c29ab9a5aad2dae64120252b2e0
parent 7f0e1c36
Loading
Loading
Loading
Loading
+18 −5
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ import com.android.systemui.statusbar.pipeline.shared.domain.interactor.HomeStat
import com.android.systemui.statusbar.pipeline.shared.ui.model.ChipsVisibilityModel
import com.android.systemui.statusbar.pipeline.shared.ui.model.SystemInfoCombinedVisibilityModel
import com.android.systemui.statusbar.pipeline.shared.ui.model.VisibilityModel
import com.android.systemui.statusbar.policy.domain.interactor.DeviceProvisioningInteractor
import com.android.systemui.statusbar.systemstatusicons.ui.viewmodel.SystemStatusIconsViewModel
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
@@ -236,6 +237,7 @@ constructor(
    headsUpNotificationInteractor: HeadsUpNotificationInteractor,
    keyguardTransitionInteractor: KeyguardTransitionInteractor,
    keyguardInteractor: KeyguardInteractor,
    deviceProvisioningInteractor: DeviceProvisioningInteractor,
    override val operatorNameViewModel: StatusBarOperatorNameViewModel,
    sceneInteractor: SceneInteractor,
    sceneContainerOcclusionInteractor: SceneContainerOcclusionInteractor,
@@ -411,12 +413,23 @@ constructor(
     * if we shouldn't be showing any part of the home status bar.
     */
    private val isHomeScreenStatusBarAllowedLegacy: Flow<Boolean> =
        combine(keyguardTransitionInteractor.currentKeyguardState, isShadeVisibleOnThisDisplay) {
                currentKeyguardState,
                isShadeVisibleOnThisDisplay ->
        combine(
                keyguardTransitionInteractor.currentKeyguardState,
                isShadeVisibleOnThisDisplay,
                deviceProvisioningInteractor.isDeviceProvisioned,
            ) { currentKeyguardState, isShadeVisibleOnThisDisplay, isDeviceProvisioned ->
                when {
                    // Short-term fix for b/418020209.
                    // `isShadeVisibleOnThisDisplay` is incorrectly reporting that the shade is
                    // visible during setup wizard, causing the status bar to incorrectly hide.
                    // Temporarily prevent that while we work out a safe fix inside shade code.
                    !isDeviceProvisioned -> true
                    else -> {
                        (currentKeyguardState == GONE || currentKeyguardState == OCCLUDED) &&
                            !isShadeVisibleOnThisDisplay
                    }
                }
            }
            .distinctUntilChanged()
            .logDiffsForTable(
                tableLogBuffer = tableLogger,
+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import com.android.systemui.statusbar.pipeline.shared.domain.interactor.homeStat
import com.android.systemui.statusbar.pipeline.shared.domain.interactor.homeStatusBarInteractor
import com.android.systemui.statusbar.pipeline.shared.ui.binder.HomeStatusBarViewBinder
import com.android.systemui.statusbar.pipeline.shared.ui.binder.HomeStatusBarViewBinderImpl
import com.android.systemui.statusbar.policy.domain.interactor.deviceProvisioningInteractor
import com.android.systemui.statusbar.systemstatusicons.ui.viewmodel.systemStatusIconsViewModelFactory

var Kosmos.homeStatusBarViewBinder: HomeStatusBarViewBinder by
@@ -72,6 +73,7 @@ var Kosmos.homeStatusBarViewModelFactory: (Int) -> HomeStatusBarViewModel by
                headsUpNotificationInteractor,
                keyguardTransitionInteractor,
                keyguardInteractor,
                deviceProvisioningInteractor,
                statusBarOperatorNameViewModel,
                sceneInteractor,
                sceneContainerOcclusionInteractor,