1 package com.android.keyguard 2 3 import android.annotation.CurrentTimeMillisLong 4 import android.hardware.biometrics.BiometricAuthenticator.Modality 5 import android.hardware.biometrics.BiometricAuthenticator.TYPE_FACE 6 import android.hardware.biometrics.BiometricAuthenticator.TYPE_FINGERPRINT 7 8 /** Verbose logging for various keyguard listening states. */ 9 sealed class KeyguardListenModel { 10 /** Timestamp of the state change. */ 11 abstract val timeMillis: Long 12 /** Current user */ 13 abstract val userId: Int 14 /** If keyguard is listening for the given [modality]. */ 15 abstract val listening: Boolean 16 /** Sensor type */ 17 @Modality abstract val modality: Int 18 } 19 20 /** 21 * Verbose debug information associated with [KeyguardUpdateMonitor.shouldListenForFingerprint]. 22 */ 23 data class KeyguardFingerprintListenModel( 24 @CurrentTimeMillisLong override val timeMillis: Long, 25 override val userId: Int, 26 override val listening: Boolean, 27 // keep sorted 28 val biometricEnabledForUser: Boolean, 29 val bouncer: Boolean, 30 val canSkipBouncer: Boolean, 31 val credentialAttempted: Boolean, 32 val deviceInteractive: Boolean, 33 val dreaming: Boolean, 34 val encryptedOrLockdown: Boolean, 35 val fingerprintDisabled: Boolean, 36 val fingerprintLockedOut: Boolean, 37 val goingToSleep: Boolean, 38 val keyguardGoingAway: Boolean, 39 val keyguardIsVisible: Boolean, 40 val keyguardOccluded: Boolean, 41 val occludingAppRequestingFp: Boolean, 42 val primaryUser: Boolean, 43 val shouldListenForFingerprintAssistant: Boolean, 44 val switchingUser: Boolean, 45 val udfps: Boolean, 46 val userDoesNotHaveTrust: Boolean, 47 val userNeedsStrongAuth: Boolean 48 ) : KeyguardListenModel() { 49 override val modality: Int = TYPE_FACE 50 } 51 52 /** 53 * Verbose debug information associated with [KeyguardUpdateMonitor.shouldListenForFace]. 54 */ 55 data class KeyguardFaceListenModel( 56 @CurrentTimeMillisLong override val timeMillis: Long, 57 override val userId: Int, 58 override val listening: Boolean, 59 // keep sorted 60 val authInterruptActive: Boolean, 61 val becauseCannotSkipBouncer: Boolean, 62 val biometricSettingEnabledForUser: Boolean, 63 val bouncer: Boolean, 64 val faceAuthenticated: Boolean, 65 val faceDisabled: Boolean, 66 val keyguardAwake: Boolean, 67 val keyguardGoingAway: Boolean, 68 val listeningForFaceAssistant: Boolean, 69 val lockIconPressed: Boolean, 70 val occludingAppRequestingFaceAuth: Boolean, 71 val primaryUser: Boolean, 72 val scanningAllowedByStrongAuth: Boolean, 73 val secureCameraLaunched: Boolean, 74 val switchingUser: Boolean 75 ) : KeyguardListenModel() { 76 override val modality: Int = TYPE_FINGERPRINT 77 } 78