blob: a6f6c1ea02933849cdfaa6af858eda839ca7318a [file] [log] [blame]
Ilya Matyukhine4675b32019-11-07 16:07:19 -08001/*
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
17package android.hardware.biometrics;
18
19import android.os.Bundle;
20import android.hardware.biometrics.IBiometricEnabledOnKeyguardCallback;
21import 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 */
30interface 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
joshmccloskeya8f15a52020-02-04 13:27:03 -080036 // Cancel authentication for the given sessionId
37 void cancelAuthentication(IBinder token, String opPackageName);
38
Ilya Matyukhine4675b32019-11-07 16:07:19 -080039 // TODO(b/141025588): Make userId the first arg to be consistent with hasEnrolledBiometrics.
40 // Checks if biometrics can be used.
Ilya Matyukhin30f1dd82019-11-18 18:08:56 -080041 int canAuthenticate(String opPackageName, int userId, int authenticators);
Ilya Matyukhine4675b32019-11-07 16:07:19 -080042
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 Chyn7d07c892020-02-18 18:18:17 -080054
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 Matyukhine4675b32019-11-07 16:07:19 -080059}