Ilya Matyukhin | e4675b3 | 2019-11-07 16:07:19 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2019 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 | |
| 17 | package android.hardware.biometrics; |
| 18 | |
| 19 | import android.os.Bundle; |
| 20 | import android.hardware.biometrics.IBiometricEnabledOnKeyguardCallback; |
| 21 | import android.hardware.biometrics.IBiometricServiceReceiver; |
| 22 | |
| 23 | /** |
| 24 | * Communication channel from BiometricPrompt and BiometricManager to AuthService. The |
| 25 | * interface does not expose specific biometric modalities. The system will use the default |
| 26 | * biometric for apps. On devices with more than one, the choice is dictated by user preference in |
| 27 | * Settings. |
| 28 | * @hide |
| 29 | */ |
| 30 | interface IAuthService { |
| 31 | // Requests authentication. The service choose the appropriate biometric to use, and show |
| 32 | // the corresponding BiometricDialog. |
| 33 | void authenticate(IBinder token, long sessionId, int userId, |
| 34 | IBiometricServiceReceiver receiver, String opPackageName, in Bundle bundle); |
| 35 | |
joshmccloskey | a8f15a5 | 2020-02-04 13:27:03 -0800 | [diff] [blame] | 36 | // Cancel authentication for the given sessionId |
| 37 | void cancelAuthentication(IBinder token, String opPackageName); |
| 38 | |
Ilya Matyukhin | e4675b3 | 2019-11-07 16:07:19 -0800 | [diff] [blame] | 39 | // TODO(b/141025588): Make userId the first arg to be consistent with hasEnrolledBiometrics. |
| 40 | // Checks if biometrics can be used. |
Ilya Matyukhin | 30f1dd8 | 2019-11-18 18:08:56 -0800 | [diff] [blame] | 41 | int canAuthenticate(String opPackageName, int userId, int authenticators); |
Ilya Matyukhin | e4675b3 | 2019-11-07 16:07:19 -0800 | [diff] [blame] | 42 | |
| 43 | // Checks if any biometrics are enrolled. |
| 44 | boolean hasEnrolledBiometrics(int userId, String opPackageName); |
| 45 | |
| 46 | // Register callback for when keyguard biometric eligibility changes. |
| 47 | void registerEnabledOnKeyguardCallback(IBiometricEnabledOnKeyguardCallback callback); |
| 48 | |
| 49 | // Explicitly set the active user. |
| 50 | void setActiveUser(int userId); |
| 51 | |
| 52 | // Reset the lockout when user authenticates with strong auth (e.g. PIN, pattern or password) |
| 53 | void resetLockout(in byte [] token); |
Kevin Chyn | 7d07c89 | 2020-02-18 18:18:17 -0800 | [diff] [blame^] | 54 | |
| 55 | // Get a list of AuthenticatorIDs for authenticators which have enrolled templates and meet |
| 56 | // the requirements for integrating with Keystore. The AuthenticatorID are known in Keystore |
| 57 | // land as SIDs, and are used during key generation. |
| 58 | long[] getAuthenticatorIds(); |
Ilya Matyukhin | e4675b3 | 2019-11-07 16:07:19 -0800 | [diff] [blame] | 59 | } |