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

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

Merge "Rename KeyguardFaceAuthManager to DeviceEntryFaceAuthManager" into udc-dev am: 3df6829c

parents fa696cd8 3df6829c
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ import kotlinx.coroutines.withContext
 * API to run face authentication and detection for device entry / on keyguard (as opposed to the
 * biometric prompt).
 */
interface KeyguardFaceAuthManager {
interface DeviceEntryFaceAuthRepository {
    /** Provide the current face authentication state for device entry. */
    val isAuthenticated: Flow<Boolean>

@@ -108,7 +108,7 @@ interface KeyguardFaceAuthManager {
}

@SysUISingleton
class KeyguardFaceAuthManagerImpl
class DeviceEntryFaceAuthRepositoryImpl
@Inject
constructor(
    context: Context,
@@ -127,7 +127,7 @@ constructor(
    private val keyguardInteractor: KeyguardInteractor,
    private val alternateBouncerInteractor: AlternateBouncerInteractor,
    dumpManager: DumpManager,
) : KeyguardFaceAuthManager, Dumpable {
) : DeviceEntryFaceAuthRepository, Dumpable {
    private var authCancellationSignal: CancellationSignal? = null
    private var detectCancellationSignal: CancellationSignal? = null
    private var faceAcquiredInfoIgnoreList: Set<Int>
@@ -144,13 +144,13 @@ constructor(
        get() = _detectionStatus.filterNotNull()

    private val _isLockedOut = MutableStateFlow(false)
    override val isLockedOut: Flow<Boolean> = _isLockedOut
    override val isLockedOut: StateFlow<Boolean> = _isLockedOut

    val isDetectionSupported =
        faceManager?.sensorPropertiesInternal?.firstOrNull()?.supportsFaceDetection ?: false

    private val _isAuthRunning = MutableStateFlow(false)
    override val isAuthRunning: Flow<Boolean>
    override val isAuthRunning: StateFlow<Boolean>
        get() = _isAuthRunning

    private val keyguardSessionId: InstanceId?
@@ -199,7 +199,7 @@ constructor(
                )
                .boxed()
                .collect(Collectors.toSet())
        dumpManager.registerCriticalDumpable("KeyguardFaceAuthManagerImpl", this)
        dumpManager.registerCriticalDumpable("DeviceEntryFaceAuthRepositoryImpl", this)

        observeFaceAuthGatingChecks()
        observeFaceDetectGatingChecks()
@@ -495,7 +495,7 @@ constructor(
    }

    companion object {
        const val TAG = "KeyguardFaceAuthManager"
        const val TAG = "DeviceEntryFaceAuthRepository"

        /**
         * If no cancel signal has been received after this amount of time, assume that it is
@@ -505,7 +505,7 @@ constructor(
    }

    override fun dump(pw: PrintWriter, args: Array<out String>) {
        pw.println("KeyguardFaceAuthManagerImpl state:")
        pw.println("DeviceEntryFaceAuthRepositoryImpl state:")
        pw.println("  cancellationInProgress: $cancellationInProgress")
        pw.println("  _isLockedOut.value: ${_isLockedOut.value}")
        pw.println("  _isAuthRunning.value: ${_isAuthRunning.value}")
+4 −1
Original line number Diff line number Diff line
@@ -22,7 +22,10 @@ import dagger.Module

@Module
interface KeyguardFaceAuthModule {
    @Binds fun faceAuthManager(impl: KeyguardFaceAuthManagerImpl): KeyguardFaceAuthManager
    @Binds
    fun deviceEntryFaceAuthRepository(
        impl: DeviceEntryFaceAuthRepositoryImpl
    ): DeviceEntryFaceAuthRepository

    @Binds fun trustRepository(impl: TrustRepositoryImpl): TrustRepository
}
+4 −1
Original line number Diff line number Diff line
@@ -18,7 +18,10 @@ package com.android.systemui.keyguard.shared.model

import android.hardware.face.FaceManager

/** Authentication status provided by [com.android.keyguard.faceauth.KeyguardFaceAuthManager] */
/**
 * Authentication status provided by
 * [com.android.systemui.keyguard.data.repository.DeviceEntryFaceAuthRepository]
 */
sealed class AuthenticationStatus

/** Success authentication status. */
+3 −3
Original line number Diff line number Diff line
@@ -9,15 +9,15 @@ import com.android.systemui.plugins.log.LogBuffer
import com.android.systemui.plugins.log.LogLevel.DEBUG
import javax.inject.Inject

private const val TAG = "KeyguardFaceAuthManagerLog"
private const val TAG = "DeviceEntryFaceAuthRepositoryLog"

/**
 * Helper class for logging for
 * [com.android.systemui.keyguard.data.repository.KeyguardFaceAuthManager]
 * [com.android.systemui.keyguard.data.repository.DeviceEntryFaceAuthRepository]
 *
 * To enable logcat echoing for an entire buffer:
 * ```
 *   adb shell settings put global systemui/buffer/KeyguardFaceAuthManagerLog <logLevel>
 *   adb shell settings put global systemui/buffer/DeviceEntryFaceAuthRepositoryLog <logLevel>
 *
 * ```
 */
+2 −2
Original line number Diff line number Diff line
@@ -367,13 +367,13 @@ public class LogModule {

    /**
     * Provides a {@link LogBuffer} for use by
     *  {@link com.android.keyguard.faceauth.KeyguardFaceAuthManagerImpl}.
     *  {@link com.android.systemui.keyguard.data.repository.DeviceEntryFaceAuthRepositoryImpl}.
     */
    @Provides
    @SysUISingleton
    @FaceAuthLog
    public static LogBuffer provideFaceAuthLog(LogBufferFactory factory) {
        return factory.create("KeyguardFaceAuthManagerLog", 300);
        return factory.create("DeviceEntryFaceAuthRepositoryLog", 300);
    }

    /**
Loading