1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.android.systemui.biometrics
17 
18 import android.hardware.biometrics.common.AuthenticateReason
19 import kotlinx.coroutines.flow.Flow
20 
21 /**
22  * Provides the status of the interactive to auth feature.
23  *
24  * This controls whether fingerprint authentication can be used to unlock the device any time versus
25  * only when the device is interactive. This is controlled by the user through a settings toggle.
26  */
27 interface FingerprintInteractiveToAuthProvider {
28     /**
29      * Whether the setting is enabled for the current user. This is the opposite of the "Touch to
30      * Unlock" settings toggle.
31      */
32     val enabledForCurrentUser: Flow<Boolean>
33 
34     /**
35      * @param userId the user Id.
36      * @return Vendor extension if needed for authentication.
37      */
getVendorExtensionnull38     fun getVendorExtension(userId: Int): AuthenticateReason.Vendor?
39 }
40