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

Commit e28256fc authored by Chandru S's avatar Chandru S Committed by Automerger Merge Worker
Browse files

Merge "Add debug logs for unlock ripple & sleep+auth interactions" into...

Merge "Add debug logs for unlock ripple & sleep+auth interactions" into tm-qpr-dev am: e829ea7f am: 10aeca91

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21614393



Change-Id: Ide73857dd65895e7cd26defe15cc5c4421d21a3a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents bd6d3767 10aeca91
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -877,7 +877,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab

    private void reportSuccessfulBiometricUnlock(boolean isStrongBiometric, int userId) {
        mBackgroundExecutor.execute(
                () -> mLockPatternUtils.reportSuccessfulBiometricUnlock(isStrongBiometric, userId));
                () -> {
                    mLogger.logReportSuccessfulBiometricUnlock(isStrongBiometric, userId);
                    mLockPatternUtils.reportSuccessfulBiometricUnlock(isStrongBiometric, userId);
                });
    }

    private void handleFingerprintAuthFailed() {
@@ -2530,11 +2533,13 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        // If this message exists, we should not authenticate again until this message is
        // consumed by the handler
        if (mHandler.hasMessages(MSG_BIOMETRIC_AUTHENTICATION_CONTINUE)) {
            mLogger.logHandlerHasAuthContinueMsgs(action);
            return;
        }

        // don't start running fingerprint until they're registered
        if (!mAuthController.areAllFingerprintAuthenticatorsRegistered()) {
            mLogger.d("All FP authenticators not registered, skipping FP listening state update");
            return;
        }
        final boolean shouldListenForFingerprint = shouldListenForFingerprint(isUdfpsSupported());
+31 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.keyguard.logging

import android.hardware.biometrics.BiometricSourceType
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.log.dagger.BiometricLog
import com.android.systemui.plugins.log.LogBuffer
@@ -157,6 +158,36 @@ class BiometricUnlockLogger @Inject constructor(@BiometricLog private val logBuf
            }
        )
    }

    fun deferringAuthenticationDueToSleep(
        userId: Int,
        biometricSourceType: BiometricSourceType,
        alreadyPendingAuth: Boolean
    ) {
        logBuffer.log(
            TAG,
            DEBUG,
            {
                int1 = userId
                str1 = biometricSourceType.name
                bool2 = alreadyPendingAuth
            },
            {
                "onBiometricAuthenticated, deferring auth: userId: $int1, " +
                    "biometricSourceType: $str1, " +
                    "goingToSleep: true, " +
                    "mPendingAuthentication != null: $bool2"
            }
        )
    }

    fun finishedGoingToSleepWithPendingAuth() {
        logBuffer.log(
            TAG,
            LogLevel.DEBUG,
            "onFinishedGoingToSleep with pendingAuthenticated != null"
        )
    }
}

private fun wakeAndUnlockModeToString(mode: Int): String {
+26 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.keyguard.logging

import com.android.systemui.biometrics.AuthRippleController
import com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController
import com.android.systemui.log.dagger.KeyguardLog
import com.android.systemui.plugins.log.LogBuffer
@@ -120,4 +121,29 @@ constructor(
            "type=${KeyguardIndicationRotateTextViewController.indicationTypeToString(type)}"
        }
    }

    fun notShowingUnlockRipple(keyguardNotShowing: Boolean, unlockNotAllowed: Boolean) {
        buffer.log(
            AuthRippleController.TAG,
            LogLevel.DEBUG,
            {
                bool1 = keyguardNotShowing
                bool2 = unlockNotAllowed
            },
            { "Not showing unlock ripple: keyguardNotShowing: $bool1, unlockNotAllowed: $bool2" }
        )
    }

    fun showingUnlockRippleAt(x: Int, y: Int, context: String) {
        buffer.log(
            AuthRippleController.TAG,
            LogLevel.DEBUG,
            {
                int1 = x
                int2 = y
                str1 = context
            },
            { "Showing unlock ripple with center (x, y): ($int1, $int2), context: $str1" }
        )
    }
}
+24 −0
Original line number Diff line number Diff line
@@ -584,6 +584,30 @@ constructor(@KeyguardUpdateMonitorLog private val logBuffer: LogBuffer) {
        )
    }

    fun logReportSuccessfulBiometricUnlock(isStrongBiometric: Boolean, userId: Int) {
        logBuffer.log(
            TAG,
            DEBUG,
            {
                bool1 = isStrongBiometric
                int1 = userId
            },
            { "reporting successful biometric unlock: isStrongBiometric: $bool1, userId: $int1" }
        )
    }

    fun logHandlerHasAuthContinueMsgs(action: Int) {
        logBuffer.log(
            TAG,
            DEBUG,
            { int1 = action },
            {
                "MSG_BIOMETRIC_AUTHENTICATION_CONTINUE already queued up, " +
                    "ignoring updating FP listening state to $int1"
            }
        )
    }

    fun logFaceEnrolledUpdated(oldValue: Boolean, newValue: Boolean) {
        logBuffer.log(
            TAG,
+10 −2
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.hardware.biometrics.BiometricSourceType
import androidx.annotation.VisibleForTesting
import com.android.keyguard.KeyguardUpdateMonitor
import com.android.keyguard.KeyguardUpdateMonitorCallback
import com.android.keyguard.logging.KeyguardLogger
import com.android.settingslib.Utils
import com.android.systemui.R
import com.android.systemui.animation.Interpolators
@@ -74,6 +75,7 @@ class AuthRippleController @Inject constructor(
    private val udfpsControllerProvider: Provider<UdfpsController>,
    private val statusBarStateController: StatusBarStateController,
    private val featureFlags: FeatureFlags,
    private val logger: KeyguardLogger,
        rippleView: AuthRippleView?
) : ViewController<AuthRippleView>(rippleView), KeyguardStateController.Callback,
    WakefulnessLifecycle.Observer {
@@ -120,8 +122,11 @@ class AuthRippleController @Inject constructor(
    }

    fun showUnlockRipple(biometricSourceType: BiometricSourceType) {
        if (!keyguardStateController.isShowing ||
                !keyguardUpdateMonitor.isUnlockingWithBiometricAllowed(biometricSourceType)) {
        val keyguardNotShowing = !keyguardStateController.isShowing
        val unlockNotAllowed = !keyguardUpdateMonitor
                .isUnlockingWithBiometricAllowed(biometricSourceType)
        if (keyguardNotShowing || unlockNotAllowed) {
            logger.notShowingUnlockRipple(keyguardNotShowing, unlockNotAllowed)
            return
        }

@@ -138,6 +143,7 @@ class AuthRippleController @Inject constructor(
                                Math.max(it.y, centralSurfaces.displayHeight.toInt() - it.y)
                        )
                )
                logger.showingUnlockRippleAt(it.x, it.y, "FP sensor radius: $udfpsRadius")
                showUnlockedRipple()
            }
        } else if (biometricSourceType == BiometricSourceType.FACE) {
@@ -155,6 +161,7 @@ class AuthRippleController @Inject constructor(
                                Math.max(it.y, centralSurfaces.displayHeight.toInt() - it.y)
                        )
                )
                logger.showingUnlockRippleAt(it.x, it.y, "Face unlock ripple")
                showUnlockedRipple()
            }
        }
@@ -391,5 +398,6 @@ class AuthRippleController @Inject constructor(

    companion object {
        const val RIPPLE_ANIMATION_DURATION: Long = 1533
        const val TAG = "AuthRippleController"
    }
}
Loading