diff options
| author | 2024-05-16 19:00:27 +0000 | |
|---|---|---|
| committer | 2024-05-17 16:29:15 +0000 | |
| commit | b92a138e18e7acec23e4ef2cc81f76159a527430 (patch) | |
| tree | f644a128a9a23b9c0c17fb24ca7819850d98aa84 | |
| parent | f0a7446d26c3ef6731296dbcd969d0c01178f347 (diff) | |
Add debug logging to sfps indicator code
Add debug logging for refactor enabled sfps indicator logic
Flag: NONE
Bug: 340227038
Test: N/A
Change-Id: I6495b567bef60de7ec01aa5396b56a3424f891c9
Merged-In: Icc25cd08fa1cd7ee1f9d80aa9863c982bd6ea291
4 files changed, 38 insertions, 9 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/data/repository/BiometricStatusRepository.kt b/packages/SystemUI/src/com/android/systemui/biometrics/data/repository/BiometricStatusRepository.kt index 27bb023e3366..26e247f8167c 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/data/repository/BiometricStatusRepository.kt +++ b/packages/SystemUI/src/com/android/systemui/biometrics/data/repository/BiometricStatusRepository.kt @@ -25,6 +25,7 @@ import android.hardware.biometrics.BiometricRequestConstants.REASON_AUTH_SETTING import android.hardware.biometrics.BiometricRequestConstants.REASON_ENROLL_ENROLLING import android.hardware.biometrics.BiometricRequestConstants.REASON_ENROLL_FIND_SENSOR import android.hardware.biometrics.BiometricSourceType +import android.util.Log import com.android.systemui.biometrics.shared.model.AuthenticationReason import com.android.systemui.biometrics.shared.model.AuthenticationReason.SettingsOperations import com.android.systemui.biometrics.shared.model.AuthenticationState @@ -42,6 +43,7 @@ import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.filterIsInstance import kotlinx.coroutines.flow.map +import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.flow.shareIn /** A repository for the state of biometric authentication. */ @@ -67,6 +69,7 @@ constructor( private val authenticationState: Flow<AuthenticationState> = conflatedCallbackFlow { val updateAuthenticationState = { state: AuthenticationState -> + Log.d(TAG, "authenticationState updated: $state") trySendWithFailureLogging(state, TAG, "Error sending AuthenticationState state") } @@ -121,7 +124,9 @@ constructor( .shareIn(applicationScope, started = SharingStarted.Eagerly, replay = 1) override val fingerprintAuthenticationReason: Flow<AuthenticationReason> = - authenticationState.map { it.requestReason } + authenticationState + .map { it.requestReason } + .onEach { Log.d(TAG, "fingerprintAuthenticationReason updated: $it") } override val fingerprintAcquiredStatus: Flow<FingerprintAuthenticationStatus> = authenticationState diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/BiometricStatusInteractor.kt b/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/BiometricStatusInteractor.kt index c4967ec0df21..90ad9da476a0 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/BiometricStatusInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/BiometricStatusInteractor.kt @@ -17,6 +17,7 @@ package com.android.systemui.biometrics.domain.interactor import android.app.ActivityTaskManager +import android.util.Log import com.android.systemui.biometrics.data.repository.BiometricStatusRepository import com.android.systemui.biometrics.shared.model.AuthenticationReason import com.android.systemui.biometrics.shared.model.AuthenticationReason.SettingsOperations @@ -25,6 +26,7 @@ import javax.inject.Inject import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.map +import kotlinx.coroutines.flow.onEach /** Encapsulates business logic for interacting with biometric authentication state. */ interface BiometricStatusInteractor { @@ -46,14 +48,16 @@ constructor( ) : BiometricStatusInteractor { override val sfpsAuthenticationReason: Flow<AuthenticationReason> = - biometricStatusRepository.fingerprintAuthenticationReason.map { reason: AuthenticationReason - -> - if (reason.isReasonToAlwaysUpdateSfpsOverlay(activityTaskManager)) { - reason - } else { - AuthenticationReason.NotRunning + biometricStatusRepository.fingerprintAuthenticationReason + .map { reason: AuthenticationReason -> + if (reason.isReasonToAlwaysUpdateSfpsOverlay(activityTaskManager)) { + reason + } else { + AuthenticationReason.NotRunning + } } - }.distinctUntilChanged() + .distinctUntilChanged() + .onEach { Log.d(TAG, "sfpsAuthenticationReason updated: $it") } override val fingerprintAcquiredStatus: Flow<FingerprintAuthenticationStatus> = biometricStatusRepository.fingerprintAcquiredStatus diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinder.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinder.kt index 9949e4c7d3d4..9d5505b4b105 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/SideFpsOverlayViewBinder.kt @@ -20,6 +20,7 @@ package com.android.systemui.biometrics.ui.binder import android.content.Context import android.graphics.PorterDuff import android.graphics.PorterDuffColorFilter +import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.WindowManager @@ -96,6 +97,13 @@ constructor( showIndicatorForDeviceEntry, progressBarIsVisible) = combinedFlows + Log.d( + TAG, + "systemServerAuthReason = $systemServerAuthReason, " + + "showIndicatorForDeviceEntry = " + + "$showIndicatorForDeviceEntry, " + + "progressBarIsVisible = $progressBarIsVisible" + ) if (!isInRearDisplayMode) { if (progressBarIsVisible) { hide() @@ -119,6 +127,10 @@ constructor( /** Show the side fingerprint sensor indicator */ private fun show() { if (overlayView?.isAttachedToWindow == true) { + Log.d( + TAG, + "show(): overlayView $overlayView isAttachedToWindow already, ignoring show request" + ) return } @@ -135,6 +147,7 @@ constructor( ) bind(overlayView!!, overlayViewModel, fpsUnlockTracker.get(), windowManager.get()) overlayView!!.visibility = View.INVISIBLE + Log.d(TAG, "show(): adding overlayView $overlayView") windowManager.get().addView(overlayView, overlayViewModel.defaultOverlayViewParams) } @@ -144,6 +157,7 @@ constructor( val lottie = overlayView!!.requireViewById<LottieAnimationView>(R.id.sidefps_animation) lottie.pauseAnimation() lottie.removeAllLottieOnCompositionLoadedListener() + Log.d(TAG, "hide(): removing overlayView $overlayView, setting to null") windowManager.get().removeView(overlayView) overlayView = null } diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/DeviceEntrySideFpsOverlayInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/DeviceEntrySideFpsOverlayInteractor.kt index e017129bd5c5..6883be9cdb46 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/DeviceEntrySideFpsOverlayInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/DeviceEntrySideFpsOverlayInteractor.kt @@ -17,6 +17,7 @@ package com.android.systemui.keyguard.domain.interactor import android.content.Context +import android.util.Log import com.android.keyguard.KeyguardUpdateMonitor import com.android.systemui.bouncer.domain.interactor.AlternateBouncerInteractor import com.android.systemui.bouncer.domain.interactor.PrimaryBouncerInteractor @@ -35,6 +36,7 @@ import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.merge +import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.launch /** @@ -73,9 +75,12 @@ constructor( deviceEntryFingerprintAuthRepository.shouldUpdateIndicatorVisibility.filter { it } ) .map { shouldShowIndicatorForPrimaryBouncer() } + .onEach { Log.d(TAG, "showIndicatorForPrimaryBouncer updated: $it") } private val showIndicatorForAlternateBouncer: Flow<Boolean> = - alternateBouncerInteractor.isVisible + alternateBouncerInteractor.isVisible.onEach { + Log.d(TAG, "showIndicatorForAlternateBouncer updated: $it") + } /** * Indicates whether the primary or alternate bouncers request showing the side fingerprint @@ -88,6 +93,7 @@ constructor( showForPrimaryBouncer || showForAlternateBouncer } .distinctUntilChanged() + .onEach { Log.d(TAG, "showIndicatorForDeviceEntry updated: $it") } private fun shouldShowIndicatorForPrimaryBouncer(): Boolean { val sfpsEnabled: Boolean = |