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

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

[SB] Add more logs around status bar visibility.

Bug: 412724385
Flag: com.android.systemui.status_bar_root_modernization
Test: Verify status bar correctly hides on lockscreen, shows on
homescreen, hides on secure camera launch. Verify log statements during
those transitions
Test: atest HomeStatusBarViewModelImplTest KeyguardInteractorTest

Change-Id: Ief4acc64ef7338cabecda84118eaf767db29b180
parent 349582e8
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.merge
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.flow.onStart
import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.flow.transform
@@ -318,8 +319,13 @@ constructor(
                    SecureCameraRelatedEventType.InGoneState -> false
                }
            }
            .onStart { emit(false) }
            .distinctUntilChanged()
            .onEach { Log.v(TAG, "isSecureCameraActive: $it") }
            .stateIn(
                scope = applicationScope,
                started = SharingStarted.WhileSubscribed(),
                initialValue = false,
            )

    /** The approximate location on the screen of the fingerprint sensor, if one is available. */
    val fingerprintSensorLocation: Flow<Point?> = repository.fingerprintSensorLocation
@@ -547,6 +553,13 @@ constructor(
                initialValue = isDozing.value,
            )
            .collect()
        isSecureCameraActive
            .logDiffsForTable(
                tableLogBuffer = tableLogBuffer,
                columnName = "isSecureCameraActive",
                initialValue = false,
            )
            .collect()
    }

    companion object {
+24 −8
Original line number Diff line number Diff line
@@ -283,7 +283,15 @@ constructor(
        // Keep the status bar visible while the shade is just starting to open, but otherwise
        // hide it so that the status bar doesn't draw while it can't be seen.
        // See b/394257529#comment24.
        shadeInteractor.anyExpansion.map { it >= 0.2 }.distinctUntilChanged()
        shadeInteractor.anyExpansion
            .map { it >= 0.2 }
            .distinctUntilChanged()
            .logDiffsForTable(
                tableLogBuffer = tableLogger,
                columnName = COL_SHADE_EXPANDED_ENOUGH,
                initialValue = false,
            )
            .stateIn(bgScope, SharingStarted.WhileSubscribed(), initialValue = false)

    /**
     * Whether the display of this statusbar has the shade window (that is hosting shade container
@@ -391,8 +399,14 @@ constructor(
                isShadeVisibleOnThisDisplay ->
                (currentKeyguardState == GONE || currentKeyguardState == OCCLUDED) &&
                    !isShadeVisibleOnThisDisplay
            // TODO(b/364360986): Add edge cases, like secure camera launch.
            }
            .distinctUntilChanged()
            .logDiffsForTable(
                tableLogBuffer = tableLogger,
                columnName = COL_ALLOWED_LEGACY,
                initialValue = false,
            )
            .stateIn(bgScope, SharingStarted.WhileSubscribed(), initialValue = false)

    // "Compat" to cover both legacy and Scene container case in one flow.
    private val isHomeStatusBarAllowedCompat =
@@ -436,7 +450,7 @@ constructor(
                columnName = COL_VISIBLE,
                initialValue = false,
            )
            .flowOn(bgDispatcher)
            .stateIn(bgScope, SharingStarted.WhileSubscribed(), initialValue = false)

    /**
     * True if we need to hide the usual start side content in order to show the heads up
@@ -632,7 +646,9 @@ constructor(

    companion object {
        private const val COL_LOCK_TO_OCCLUDED = "Lock->Occluded"
        private const val COL_ALLOWED_LEGACY = "allowedLegacy"
        private const val COL_ALLOWED_BY_SCENE = "allowedByScene"
        private const val COL_SHADE_EXPANDED_ENOUGH = "shadeExpandedEnough"
        private const val COL_NOTIF_LIGHTS_OUT = "notifLightsOut"
        private const val COL_SHOW_OPERATOR_NAME = "showOperatorName"
        private const val COL_VISIBLE = "visible"