1 package com.android.systemui.biometrics.ui
2 
3 import com.android.systemui.biometrics.AuthPanelController
4 import com.android.systemui.biometrics.ui.viewmodel.CredentialViewModel
5 
6 /** A credential variant of BiometricPrompt. */
7 sealed interface CredentialView {
8     /**
9      * Callbacks for the "host" container view that contains this credential view.
10      *
11      * TODO(b/251476085): Removed when the host view is converted to use a parent view model.
12      */
13     interface Host {
14         /** When the user's credential has been verified. */
15         fun onCredentialMatched(attestation: ByteArray)
16 
17         /** When the user abandons credential verification. */
18         fun onCredentialAborted()
19 
20         /** Warn the user is warned about excessive attempts. */
21         fun onCredentialAttemptsRemaining(remaining: Int, messageBody: String)
22     }
23 
24     // TODO(251476085): remove AuthPanelController
25     fun init(
26         viewModel: CredentialViewModel,
27         host: Host,
28         panelViewController: AuthPanelController,
29         animatePanel: Boolean,
30     )
31 }
32