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

Commit ded65cc2 authored by Alejandro Nijamkin's avatar Alejandro Nijamkin
Browse files

[flexiglass] Adds tracing to bouncer view-models

The scene view-model in BouncerSceneContentViewModel activates its child
view-models depending on the current authentication method (PIN,
password, or pattern). This CL adds a traceCoroutine around that.

Bug: 354270224
Test: changed bouncer auth methods back and forth
Flag: com.android.systemui.scene_container
Change-Id: I51f3b43992d39c8a52afd07ee0d31ecdb5a5b6a0
parent d6161f27
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -39,6 +39,9 @@ sealed class AuthMethodBouncerViewModel(
     * being able to attempt to unlock the device.
     */
    val isInputEnabled: StateFlow<Boolean>,

    /** Name to use for performance tracing purposes. */
    val traceName: String,
) : ExclusiveActivatable() {

    private val _animateFailure = MutableStateFlow(false)
+2 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.graphics.Bitmap
import androidx.compose.ui.input.key.KeyEvent
import androidx.compose.ui.input.key.type
import androidx.core.graphics.drawable.toBitmap
import com.android.app.tracing.coroutines.traceCoroutine
import com.android.systemui.authentication.domain.interactor.AuthenticationInteractor
import com.android.systemui.authentication.shared.model.AuthenticationMethodModel
import com.android.systemui.authentication.shared.model.AuthenticationWipeModel
@@ -146,7 +147,7 @@ constructor(
                    .map(::getChildViewModel)
                    .collectLatest { childViewModelOrNull ->
                        _authMethodViewModel.value = childViewModelOrNull
                        childViewModelOrNull?.activate()
                        childViewModelOrNull?.let { traceCoroutine(it.traceName) { it.activate() } }
                    }
            }

+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ constructor(
    AuthMethodBouncerViewModel(
        interactor = interactor,
        isInputEnabled = isInputEnabled,
        traceName = "PasswordBouncerViewModel",
    ) {

    private val _password = MutableStateFlow("")
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ constructor(
    AuthMethodBouncerViewModel(
        interactor = interactor,
        isInputEnabled = isInputEnabled,
        traceName = "PatternBouncerViewModel",
    ) {

    /** The number of columns in the dot grid. */
+1 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ constructor(
    AuthMethodBouncerViewModel(
        interactor = interactor,
        isInputEnabled = isInputEnabled,
        traceName = "PinBouncerViewModel",
    ) {
    /**
     * Whether the sim-related UI in the pin view is showing.