diff options
| author | 2023-03-03 03:21:16 +0000 | |
|---|---|---|
| committer | 2023-03-03 03:21:16 +0000 | |
| commit | 5577073fd1af3e200bbd5bb19b58d9469996e526 (patch) | |
| tree | b3c04a57cb519b3179db387ec23f6df20bbd18db | |
| parent | 4c0d044cef175cea9c0d7134bf2acbb4846ad524 (diff) | |
| parent | 91ec7717142eaf08fe3a6c8a27ae262142a5490e (diff) | |
Merge "Log whenever face or fp enrollment state changes, and when trust usually managed state changes" into udc-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java | 28 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/keyguard/logging/KeyguardUpdateMonitorLogger.kt | 614 |
2 files changed, 415 insertions, 227 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java index a4ec8e1b72f2..866b502e00ac 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java @@ -685,7 +685,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab public void onTrustManagedChanged(boolean managed, int userId) { Assert.isMainThread(); mUserTrustIsManaged.put(userId, managed); - mUserTrustIsUsuallyManaged.put(userId, mTrustManager.isTrustUsuallyManaged(userId)); + boolean trustUsuallyManaged = mTrustManager.isTrustUsuallyManaged(userId); + mLogger.logTrustUsuallyManagedUpdated(userId, mUserTrustIsUsuallyManaged.get(userId), + trustUsuallyManaged, "onTrustManagedChanged"); + mUserTrustIsUsuallyManaged.put(userId, trustUsuallyManaged); for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { @@ -2393,8 +2396,12 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab updateSecondaryLockscreenRequirement(user); List<UserInfo> allUsers = mUserManager.getUsers(); for (UserInfo userInfo : allUsers) { + boolean trustUsuallyManaged = mTrustManager.isTrustUsuallyManaged(userInfo.id); + mLogger.logTrustUsuallyManagedUpdated(userInfo.id, + mUserTrustIsUsuallyManaged.get(userInfo.id), + trustUsuallyManaged, "init from constructor"); mUserTrustIsUsuallyManaged.put(userInfo.id, - mTrustManager.isTrustUsuallyManaged(userInfo.id)); + trustUsuallyManaged); } updateAirplaneModeState(); @@ -2434,9 +2441,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab } private void updateFaceEnrolled(int userId) { - mIsFaceEnrolled = mFaceManager != null && !mFaceSensorProperties.isEmpty() + Boolean isFaceEnrolled = mFaceManager != null && !mFaceSensorProperties.isEmpty() && mBiometricEnabledForUser.get(userId) && mAuthController.isFaceAuthEnrolled(userId); + mIsFaceEnrolled = isFaceEnrolled; + mLogger.logFaceEnrolledUpdated(mIsFaceEnrolled, isFaceEnrolled); } public boolean isFaceSupported() { @@ -3103,9 +3112,13 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab @VisibleForTesting boolean isUnlockWithFingerprintPossible(int userId) { // TODO (b/242022358), make this rely on onEnrollmentChanged event and update it only once. - mIsUnlockWithFingerprintPossible.put(userId, mFpm != null + boolean fpEnrolled = mFpm != null && !mFingerprintSensorProperties.isEmpty() - && !isFingerprintDisabled(userId) && mFpm.hasEnrolledTemplates(userId)); + && !isFingerprintDisabled(userId) && mFpm.hasEnrolledTemplates(userId); + mLogger.logFpEnrolledUpdated(userId, + mIsUnlockWithFingerprintPossible.getOrDefault(userId, false), + fpEnrolled); + mIsUnlockWithFingerprintPossible.put(userId, fpEnrolled); return mIsUnlockWithFingerprintPossible.get(userId); } @@ -3221,7 +3234,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab void handleUserSwitching(int userId, CountDownLatch latch) { Assert.isMainThread(); clearBiometricRecognized(); - mUserTrustIsUsuallyManaged.put(userId, mTrustManager.isTrustUsuallyManaged(userId)); + boolean trustUsuallyManaged = mTrustManager.isTrustUsuallyManaged(userId); + mLogger.logTrustUsuallyManagedUpdated(userId, mUserTrustIsUsuallyManaged.get(userId), + trustUsuallyManaged, "userSwitching"); + mUserTrustIsUsuallyManaged.put(userId, trustUsuallyManaged); for (int i = 0; i < mCallbacks.size(); i++) { KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get(); if (cb != null) { diff --git a/packages/SystemUI/src/com/android/keyguard/logging/KeyguardUpdateMonitorLogger.kt b/packages/SystemUI/src/com/android/keyguard/logging/KeyguardUpdateMonitorLogger.kt index e53f6adb62a4..fb2c02ad8c48 100644 --- a/packages/SystemUI/src/com/android/keyguard/logging/KeyguardUpdateMonitorLogger.kt +++ b/packages/SystemUI/src/com/android/keyguard/logging/KeyguardUpdateMonitorLogger.kt @@ -26,6 +26,7 @@ import com.android.keyguard.FaceAuthUiEvent import com.android.keyguard.KeyguardListenModel import com.android.keyguard.KeyguardUpdateMonitorCallback import com.android.keyguard.TrustGrantFlags +import com.android.systemui.log.dagger.KeyguardUpdateMonitorLog import com.android.systemui.plugins.log.LogBuffer import com.android.systemui.plugins.log.LogLevel import com.android.systemui.plugins.log.LogLevel.DEBUG @@ -33,18 +34,15 @@ import com.android.systemui.plugins.log.LogLevel.ERROR import com.android.systemui.plugins.log.LogLevel.INFO import com.android.systemui.plugins.log.LogLevel.VERBOSE import com.android.systemui.plugins.log.LogLevel.WARNING -import com.android.systemui.log.dagger.KeyguardUpdateMonitorLog import com.google.errorprone.annotations.CompileTimeConstant import javax.inject.Inject private const val TAG = "KeyguardUpdateMonitorLog" -/** - * Helper class for logging for [com.android.keyguard.KeyguardUpdateMonitor] - */ -class KeyguardUpdateMonitorLogger @Inject constructor( - @KeyguardUpdateMonitorLog private val logBuffer: LogBuffer -) { +/** Helper class for logging for [com.android.keyguard.KeyguardUpdateMonitor] */ +class KeyguardUpdateMonitorLogger +@Inject +constructor(@KeyguardUpdateMonitorLog private val logBuffer: LogBuffer) { fun d(@CompileTimeConstant msg: String) = log(msg, DEBUG) fun e(@CompileTimeConstant msg: String) = log(msg, ERROR) @@ -56,15 +54,16 @@ class KeyguardUpdateMonitorLogger @Inject constructor( fun log(@CompileTimeConstant msg: String, level: LogLevel) = logBuffer.log(TAG, level, msg) fun logActiveUnlockTriggered(reason: String?) { - logBuffer.log("ActiveUnlock", DEBUG, - { str1 = reason }, - { "initiate active unlock triggerReason=$str1" }) + logBuffer.log( + "ActiveUnlock", + DEBUG, + { str1 = reason }, + { "initiate active unlock triggerReason=$str1" } + ) } fun logAuthInterruptDetected(active: Boolean) { - logBuffer.log(TAG, DEBUG, - { bool1 = active }, - { "onAuthInterruptDetected($bool1)" }) + logBuffer.log(TAG, DEBUG, { bool1 = active }, { "onAuthInterruptDetected($bool1)" }) } fun logBroadcastReceived(action: String?) { @@ -72,9 +71,12 @@ class KeyguardUpdateMonitorLogger @Inject constructor( } fun logDeviceProvisionedState(deviceProvisioned: Boolean) { - logBuffer.log(TAG, DEBUG, - { bool1 = deviceProvisioned }, - { "DEVICE_PROVISIONED state = $bool1" }) + logBuffer.log( + TAG, + DEBUG, + { bool1 = deviceProvisioned }, + { "DEVICE_PROVISIONED state = $bool1" } + ) } fun logException(ex: Exception, @CompileTimeConstant logMsg: String) { @@ -82,46 +84,56 @@ class KeyguardUpdateMonitorLogger @Inject constructor( } fun logFaceAcquired(acquireInfo: Int) { - logBuffer.log(TAG, DEBUG, - { int1 = acquireInfo }, - { "Face acquired acquireInfo=$int1" }) + logBuffer.log(TAG, DEBUG, { int1 = acquireInfo }, { "Face acquired acquireInfo=$int1" }) } fun logFaceAuthDisabledForUser(userId: Int) { - logBuffer.log(TAG, DEBUG, - { int1 = userId }, - { "Face authentication disabled by DPM for userId: $int1" }) + logBuffer.log( + TAG, + DEBUG, + { int1 = userId }, + { "Face authentication disabled by DPM for userId: $int1" } + ) } fun logFaceAuthError(msgId: Int, originalErrMsg: String) { - logBuffer.log(TAG, DEBUG, { - str1 = originalErrMsg - int1 = msgId - }, { "Face error received: $str1 msgId= $int1" }) + logBuffer.log( + TAG, + DEBUG, + { + str1 = originalErrMsg + int1 = msgId + }, + { "Face error received: $str1 msgId= $int1" } + ) } fun logFaceAuthForWrongUser(authUserId: Int) { - logBuffer.log(TAG, DEBUG, - { int1 = authUserId }, - { "Face authenticated for wrong user: $int1" }) + logBuffer.log( + TAG, + DEBUG, + { int1 = authUserId }, + { "Face authenticated for wrong user: $int1" } + ) } fun logFaceAuthHelpMsg(msgId: Int, helpMsg: String?) { - logBuffer.log(TAG, DEBUG, { - int1 = msgId - str1 = helpMsg - }, { "Face help received, msgId: $int1 msg: $str1" }) + logBuffer.log( + TAG, + DEBUG, + { + int1 = msgId + str1 = helpMsg + }, + { "Face help received, msgId: $int1 msg: $str1" } + ) } fun logFaceAuthRequested(reason: String?) { - logBuffer.log(TAG, DEBUG, { - str1 = reason - }, { "requestFaceAuth() reason=$str1" }) + logBuffer.log(TAG, DEBUG, { str1 = reason }, { "requestFaceAuth() reason=$str1" }) } fun logFaceAuthSuccess(userId: Int) { - logBuffer.log(TAG, DEBUG, - { int1 = userId }, - { "Face auth succeeded for user $int1" }) + logBuffer.log(TAG, DEBUG, { int1 = userId }, { "Face auth succeeded for user $int1" }) } fun logFaceLockoutReset(@LockoutMode mode: Int) { @@ -133,21 +145,30 @@ class KeyguardUpdateMonitorLogger @Inject constructor( } fun logFaceUnlockPossible(isFaceUnlockPossible: Boolean) { - logBuffer.log(TAG, DEBUG, - { bool1 = isFaceUnlockPossible }, - {"isUnlockWithFacePossible: $bool1"}) + logBuffer.log( + TAG, + DEBUG, + { bool1 = isFaceUnlockPossible }, + { "isUnlockWithFacePossible: $bool1" } + ) } fun logFingerprintAuthForWrongUser(authUserId: Int) { - logBuffer.log(TAG, DEBUG, - { int1 = authUserId }, - { "Fingerprint authenticated for wrong user: $int1" }) + logBuffer.log( + TAG, + DEBUG, + { int1 = authUserId }, + { "Fingerprint authenticated for wrong user: $int1" } + ) } fun logFingerprintDisabledForUser(userId: Int) { - logBuffer.log(TAG, DEBUG, - { int1 = userId }, - { "Fingerprint disabled by DPM for userId: $int1" }) + logBuffer.log( + TAG, + DEBUG, + { int1 = userId }, + { "Fingerprint disabled by DPM for userId: $int1" } + ) } fun logFingerprintLockoutReset(@LockoutMode mode: Int) { @@ -155,16 +176,24 @@ class KeyguardUpdateMonitorLogger @Inject constructor( } fun logFingerprintRunningState(fingerprintRunningState: Int) { - logBuffer.log(TAG, DEBUG, - { int1 = fingerprintRunningState }, - { "fingerprintRunningState: $int1" }) + logBuffer.log( + TAG, + DEBUG, + { int1 = fingerprintRunningState }, + { "fingerprintRunningState: $int1" } + ) } fun logFingerprintSuccess(userId: Int, isStrongBiometric: Boolean) { - logBuffer.log(TAG, DEBUG, { - int1 = userId - bool1 = isStrongBiometric - }, {"Fingerprint auth successful: userId: $int1, isStrongBiometric: $bool1"}) + logBuffer.log( + TAG, + DEBUG, + { + int1 = userId + bool1 = isStrongBiometric + }, + { "Fingerprint auth successful: userId: $int1, isStrongBiometric: $bool1" } + ) } fun logFaceDetected(userId: Int, isStrongBiometric: Boolean) { @@ -182,29 +211,42 @@ class KeyguardUpdateMonitorLogger @Inject constructor( } fun logFingerprintError(msgId: Int, originalErrMsg: String) { - logBuffer.log(TAG, DEBUG, { - str1 = originalErrMsg - int1 = msgId - }, { "Fingerprint error received: $str1 msgId= $int1" }) + logBuffer.log( + TAG, + DEBUG, + { + str1 = originalErrMsg + int1 = msgId + }, + { "Fingerprint error received: $str1 msgId= $int1" } + ) } fun logInvalidSubId(subId: Int) { - logBuffer.log(TAG, INFO, - { int1 = subId }, - { "Previously active sub id $int1 is now invalid, will remove" }) + logBuffer.log( + TAG, + INFO, + { int1 = subId }, + { "Previously active sub id $int1 is now invalid, will remove" } + ) } fun logPrimaryKeyguardBouncerChanged( - primaryBouncerIsOrWillBeShowing: Boolean, - primaryBouncerFullyShown: Boolean + primaryBouncerIsOrWillBeShowing: Boolean, + primaryBouncerFullyShown: Boolean ) { - logBuffer.log(TAG, DEBUG, { - bool1 = primaryBouncerIsOrWillBeShowing - bool2 = primaryBouncerFullyShown - }, { - "handlePrimaryBouncerChanged " + + logBuffer.log( + TAG, + DEBUG, + { + bool1 = primaryBouncerIsOrWillBeShowing + bool2 = primaryBouncerFullyShown + }, + { + "handlePrimaryBouncerChanged " + "primaryBouncerIsOrWillBeShowing=$bool1 primaryBouncerFullyShown=$bool2" - }) + } + ) } fun logKeyguardListenerModel(model: KeyguardListenModel) { @@ -212,98 +254,134 @@ class KeyguardUpdateMonitorLogger @Inject constructor( } fun logKeyguardShowingChanged(showing: Boolean, occluded: Boolean, visible: Boolean) { - logBuffer.log(TAG, DEBUG, { - bool1 = showing - bool2 = occluded - bool3 = visible - }, { - "keyguardShowingChanged(showing=$bool1 occluded=$bool2 visible=$bool3)" - }) + logBuffer.log( + TAG, + DEBUG, + { + bool1 = showing + bool2 = occluded + bool3 = visible + }, + { "keyguardShowingChanged(showing=$bool1 occluded=$bool2 visible=$bool3)" } + ) } fun logMissingSupervisorAppError(userId: Int) { - logBuffer.log(TAG, ERROR, - { int1 = userId }, - { "No Profile Owner or Device Owner supervision app found for User $int1" }) + logBuffer.log( + TAG, + ERROR, + { int1 = userId }, + { "No Profile Owner or Device Owner supervision app found for User $int1" } + ) } fun logPhoneStateChanged(newState: String?) { - logBuffer.log(TAG, DEBUG, - { str1 = newState }, - { "handlePhoneStateChanged($str1)" }) + logBuffer.log(TAG, DEBUG, { str1 = newState }, { "handlePhoneStateChanged($str1)" }) } fun logRegisterCallback(callback: KeyguardUpdateMonitorCallback?) { - logBuffer.log(TAG, VERBOSE, - { str1 = "$callback" }, - { "*** register callback for $str1" }) + logBuffer.log(TAG, VERBOSE, { str1 = "$callback" }, { "*** register callback for $str1" }) } fun logRetryingAfterFaceHwUnavailable(retryCount: Int) { - logBuffer.log(TAG, WARNING, - { int1 = retryCount }, - { "Retrying face after HW unavailable, attempt $int1" }) + logBuffer.log( + TAG, + WARNING, + { int1 = retryCount }, + { "Retrying face after HW unavailable, attempt $int1" } + ) } fun logRetryAfterFpErrorWithDelay(msgId: Int, errString: String?, delay: Int) { - logBuffer.log(TAG, DEBUG, { - int1 = msgId - int2 = delay - str1 = "$errString" - }, { - "Fingerprint scheduling retry auth after $int2 ms due to($int1) -> $str1" - }) + logBuffer.log( + TAG, + DEBUG, + { + int1 = msgId + int2 = delay + str1 = "$errString" + }, + { "Fingerprint scheduling retry auth after $int2 ms due to($int1) -> $str1" } + ) } fun logRetryAfterFpHwUnavailable(retryCount: Int) { - logBuffer.log(TAG, WARNING, - { int1 = retryCount }, - { "Retrying fingerprint attempt: $int1" }) + logBuffer.log( + TAG, + WARNING, + { int1 = retryCount }, + { "Retrying fingerprint attempt: $int1" } + ) } fun logSendPrimaryBouncerChanged( primaryBouncerIsOrWillBeShowing: Boolean, primaryBouncerFullyShown: Boolean, ) { - logBuffer.log(TAG, DEBUG, { - bool1 = primaryBouncerIsOrWillBeShowing - bool2 = primaryBouncerFullyShown - }, { - "sendPrimaryBouncerChanged primaryBouncerIsOrWillBeShowing=$bool1 " + + logBuffer.log( + TAG, + DEBUG, + { + bool1 = primaryBouncerIsOrWillBeShowing + bool2 = primaryBouncerFullyShown + }, + { + "sendPrimaryBouncerChanged primaryBouncerIsOrWillBeShowing=$bool1 " + "primaryBouncerFullyShown=$bool2" - }) + } + ) } fun logServiceStateChange(subId: Int, serviceState: ServiceState?) { - logBuffer.log(TAG, DEBUG, { - int1 = subId - str1 = "$serviceState" - }, { "handleServiceStateChange(subId=$int1, serviceState=$str1)" }) + logBuffer.log( + TAG, + DEBUG, + { + int1 = subId + str1 = "$serviceState" + }, + { "handleServiceStateChange(subId=$int1, serviceState=$str1)" } + ) } fun logServiceStateIntent(action: String?, serviceState: ServiceState?, subId: Int) { - logBuffer.log(TAG, VERBOSE, { - str1 = action - str2 = "$serviceState" - int1 = subId - }, { "action $str1 serviceState=$str2 subId=$int1" }) + logBuffer.log( + TAG, + VERBOSE, + { + str1 = action + str2 = "$serviceState" + int1 = subId + }, + { "action $str1 serviceState=$str2 subId=$int1" } + ) } fun logSimState(subId: Int, slotId: Int, state: Int) { - logBuffer.log(TAG, DEBUG, { - int1 = subId - int2 = slotId - long1 = state.toLong() - }, { "handleSimStateChange(subId=$int1, slotId=$int2, state=$long1)" }) + logBuffer.log( + TAG, + DEBUG, + { + int1 = subId + int2 = slotId + long1 = state.toLong() + }, + { "handleSimStateChange(subId=$int1, slotId=$int2, state=$long1)" } + ) } fun logSimStateFromIntent(action: String?, extraSimState: String?, slotId: Int, subId: Int) { - logBuffer.log(TAG, VERBOSE, { - str1 = action - str2 = extraSimState - int1 = slotId - int2 = subId - }, { "action $str1 state: $str2 slotId: $int1 subid: $int2" }) + logBuffer.log( + TAG, + VERBOSE, + { + str1 = action + str2 = extraSimState + int1 = slotId + int2 = subId + }, + { "action $str1 state: $str2 slotId: $int1 subid: $int2" } + ) } fun logSimUnlocked(subId: Int) { @@ -311,78 +389,98 @@ class KeyguardUpdateMonitorLogger @Inject constructor( } fun logStartedListeningForFace(faceRunningState: Int, faceAuthUiEvent: FaceAuthUiEvent) { - logBuffer.log(TAG, VERBOSE, { - int1 = faceRunningState - str1 = faceAuthUiEvent.reason - str2 = faceAuthUiEvent.extraInfoToString() - }, { "startListeningForFace(): $int1, reason: $str1 $str2" }) + logBuffer.log( + TAG, + VERBOSE, + { + int1 = faceRunningState + str1 = faceAuthUiEvent.reason + str2 = faceAuthUiEvent.extraInfoToString() + }, + { "startListeningForFace(): $int1, reason: $str1 $str2" } + ) } fun logStartedListeningForFaceFromWakeUp(faceRunningState: Int, @WakeReason pmWakeReason: Int) { - logBuffer.log(TAG, VERBOSE, { - int1 = faceRunningState - str1 = PowerManager.wakeReasonToString(pmWakeReason) - }, { "startListeningForFace(): $int1, reason: wakeUp-$str1" }) + logBuffer.log( + TAG, + VERBOSE, + { + int1 = faceRunningState + str1 = PowerManager.wakeReasonToString(pmWakeReason) + }, + { "startListeningForFace(): $int1, reason: wakeUp-$str1" } + ) } fun logStoppedListeningForFace(faceRunningState: Int, faceAuthReason: String) { - logBuffer.log(TAG, VERBOSE, { - int1 = faceRunningState - str1 = faceAuthReason - }, { "stopListeningForFace(): currentFaceRunningState: $int1, reason: $str1" }) + logBuffer.log( + TAG, + VERBOSE, + { + int1 = faceRunningState + str1 = faceAuthReason + }, + { "stopListeningForFace(): currentFaceRunningState: $int1, reason: $str1" } + ) } fun logSubInfo(subInfo: SubscriptionInfo?) { - logBuffer.log(TAG, VERBOSE, - { str1 = "$subInfo" }, - { "SubInfo:$str1" }) + logBuffer.log(TAG, VERBOSE, { str1 = "$subInfo" }, { "SubInfo:$str1" }) } fun logTimeFormatChanged(newTimeFormat: String?) { - logBuffer.log(TAG, DEBUG, - { str1 = newTimeFormat }, - { "handleTimeFormatUpdate timeFormat=$str1" }) + logBuffer.log( + TAG, + DEBUG, + { str1 = newTimeFormat }, + { "handleTimeFormatUpdate timeFormat=$str1" } + ) } fun logUdfpsPointerDown(sensorId: Int) { - logBuffer.log(TAG, DEBUG, - { int1 = sensorId }, - { "onUdfpsPointerDown, sensorId: $int1" }) + logBuffer.log(TAG, DEBUG, { int1 = sensorId }, { "onUdfpsPointerDown, sensorId: $int1" }) } fun logUdfpsPointerUp(sensorId: Int) { - logBuffer.log(TAG, DEBUG, - { int1 = sensorId }, - { "onUdfpsPointerUp, sensorId: $int1" }) + logBuffer.log(TAG, DEBUG, { int1 = sensorId }, { "onUdfpsPointerUp, sensorId: $int1" }) } fun logUnexpectedFaceCancellationSignalState(faceRunningState: Int, unlockPossible: Boolean) { - logBuffer.log(TAG, ERROR, { - int1 = faceRunningState - bool1 = unlockPossible - }, { - "Cancellation signal is not null, high chance of bug in " + - "face auth lifecycle management. " + - "Face state: $int1, unlockPossible: $bool1" - }) + logBuffer.log( + TAG, + ERROR, + { + int1 = faceRunningState + bool1 = unlockPossible + }, + { + "Cancellation signal is not null, high chance of bug in " + + "face auth lifecycle management. " + + "Face state: $int1, unlockPossible: $bool1" + } + ) } fun logUnexpectedFpCancellationSignalState( fingerprintRunningState: Int, unlockPossible: Boolean ) { - logBuffer.log(TAG, ERROR, { - int1 = fingerprintRunningState - bool1 = unlockPossible - }, { - "Cancellation signal is not null, high chance of bug in " + - "fp auth lifecycle management. FP state: $int1, unlockPossible: $bool1" - }) + logBuffer.log( + TAG, + ERROR, + { + int1 = fingerprintRunningState + bool1 = unlockPossible + }, + { + "Cancellation signal is not null, high chance of bug in " + + "fp auth lifecycle management. FP state: $int1, unlockPossible: $bool1" + } + ) } fun logUnregisterCallback(callback: KeyguardUpdateMonitorCallback?) { - logBuffer.log(TAG, VERBOSE, - { str1 = "$callback" }, - { "*** unregister callback for $str1" }) + logBuffer.log(TAG, VERBOSE, { str1 = "$callback" }, { "*** unregister callback for $str1" }) } fun logUserRequestedUnlock( @@ -390,75 +488,149 @@ class KeyguardUpdateMonitorLogger @Inject constructor( reason: String?, dismissKeyguard: Boolean ) { - logBuffer.log("ActiveUnlock", DEBUG, { - str1 = requestOrigin?.name - str2 = reason - bool1 = dismissKeyguard - }, { "reportUserRequestedUnlock origin=$str1 reason=$str2 dismissKeyguard=$bool1" }) + logBuffer.log( + "ActiveUnlock", + DEBUG, + { + str1 = requestOrigin?.name + str2 = reason + bool1 = dismissKeyguard + }, + { "reportUserRequestedUnlock origin=$str1 reason=$str2 dismissKeyguard=$bool1" } + ) } fun logTrustGrantedWithFlags( - flags: Int, - newlyUnlocked: Boolean, - userId: Int, - message: String? + flags: Int, + newlyUnlocked: Boolean, + userId: Int, + message: String? ) { - logBuffer.log(TAG, DEBUG, { - int1 = flags - bool1 = newlyUnlocked - int2 = userId - str1 = message - }, { "trustGrantedWithFlags[user=$int2] newlyUnlocked=$bool1 " + - "flags=${TrustGrantFlags(int1)} message=$str1" }) - } - - fun logTrustChanged( - wasTrusted: Boolean, - isNowTrusted: Boolean, - userId: Int - ) { - logBuffer.log(TAG, DEBUG, { - bool1 = wasTrusted - bool2 = isNowTrusted - int1 = userId - }, { "onTrustChanged[user=$int1] wasTrusted=$bool1 isNowTrusted=$bool2" }) + logBuffer.log( + TAG, + DEBUG, + { + int1 = flags + bool1 = newlyUnlocked + int2 = userId + str1 = message + }, + { + "trustGrantedWithFlags[user=$int2] newlyUnlocked=$bool1 " + + "flags=${TrustGrantFlags(int1)} message=$str1" + } + ) + } + + fun logTrustChanged(wasTrusted: Boolean, isNowTrusted: Boolean, userId: Int) { + logBuffer.log( + TAG, + DEBUG, + { + bool1 = wasTrusted + bool2 = isNowTrusted + int1 = userId + }, + { "onTrustChanged[user=$int1] wasTrusted=$bool1 isNowTrusted=$bool2" } + ) } fun logKeyguardStateUpdate( - secure: Boolean, - canDismissLockScreen: Boolean, - trusted: Boolean, - trustManaged: Boolean - + secure: Boolean, + canDismissLockScreen: Boolean, + trusted: Boolean, + trustManaged: Boolean ) { - logBuffer.log("KeyguardState", DEBUG, { - bool1 = secure - bool2 = canDismissLockScreen - bool3 = trusted - bool4 = trustManaged - }, { "#update secure=$bool1 canDismissKeyguard=$bool2" + - " trusted=$bool3 trustManaged=$bool4" }) + logBuffer.log( + "KeyguardState", + DEBUG, + { + bool1 = secure + bool2 = canDismissLockScreen + bool3 = trusted + bool4 = trustManaged + }, + { + "#update secure=$bool1 canDismissKeyguard=$bool2" + + " trusted=$bool3 trustManaged=$bool4" + } + ) } fun logSkipUpdateFaceListeningOnWakeup(@WakeReason pmWakeReason: Int) { - logBuffer.log(TAG, VERBOSE, { - str1 = PowerManager.wakeReasonToString(pmWakeReason) - }, { "Skip updating face listening state on wakeup from $str1"}) + logBuffer.log( + TAG, + VERBOSE, + { str1 = PowerManager.wakeReasonToString(pmWakeReason) }, + { "Skip updating face listening state on wakeup from $str1" } + ) } fun logTaskStackChangedForAssistant(assistantVisible: Boolean) { - logBuffer.log(TAG, VERBOSE, { - bool1 = assistantVisible - }, { - "TaskStackChanged for ACTIVITY_TYPE_ASSISTANT, assistant visible: $bool1" - }) + logBuffer.log( + TAG, + VERBOSE, + { bool1 = assistantVisible }, + { "TaskStackChanged for ACTIVITY_TYPE_ASSISTANT, assistant visible: $bool1" } + ) } fun logAssistantVisible(assistantVisible: Boolean) { - logBuffer.log(TAG, VERBOSE, { - bool1 = assistantVisible - }, { - "Updating mAssistantVisible to new value: $bool1" - }) + logBuffer.log( + TAG, + VERBOSE, + { bool1 = assistantVisible }, + { "Updating mAssistantVisible to new value: $bool1" } + ) + } + + fun logFaceEnrolledUpdated(oldValue: Boolean, newValue: Boolean) { + logBuffer.log( + TAG, + DEBUG, + { + bool1 = oldValue + bool2 = newValue + }, + { "Face enrolled state changed: old: $bool1, new: $bool2" } + ) + } + + fun logFpEnrolledUpdated(userId: Int, oldValue: Boolean, newValue: Boolean) { + logBuffer.log( + TAG, + DEBUG, + { + int1 = userId + bool1 = oldValue + bool2 = newValue + }, + { "Fp enrolled state changed for userId: $int1 old: $bool1, new: $bool2" } + ) + } + + fun logTrustUsuallyManagedUpdated( + userId: Int, + oldValue: Boolean, + newValue: Boolean, + context: String + ) { + logBuffer.log( + TAG, + DEBUG, + { + int1 = userId + bool1 = oldValue + bool2 = newValue + str1 = context + }, + { + "trustUsuallyManaged changed for " + + "userId: $int1 " + + "old: $bool1, " + + "new: $bool2 " + + "context: $context" + } + ) } } |