blob: 9d8fcc3421cbb7652c5614b8b7cad91a6dc262ce [file] [log] [blame]
Ilya Matyukhinf2da1a12019-09-25 15:31:03 -07001/*
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 com.android.server.biometrics.face;
18
19import android.hardware.biometrics.IBiometricAuthenticator;
20import android.hardware.biometrics.IBiometricServiceReceiverInternal;
21import android.hardware.face.IFaceService;
22import android.os.IBinder;
23import android.os.RemoteException;
24
25/**
26 * TODO(b/141025588): Add JavaDoc.
27 */
28public final class FaceAuthenticator extends IBiometricAuthenticator.Stub {
29 private final IFaceService mFaceService;
30
31 public FaceAuthenticator(IFaceService faceService) {
32 mFaceService = faceService;
33 }
34
35 @Override
36 public void prepareForAuthentication(boolean requireConfirmation, IBinder token,
37 long sessionId, int userId, IBiometricServiceReceiverInternal wrapperReceiver,
38 String opPackageName, int cookie, int callingUid, int callingPid, int callingUserId)
39 throws RemoteException {
40 mFaceService.prepareForAuthentication(requireConfirmation, token, sessionId, userId,
41 wrapperReceiver, opPackageName, cookie, callingUid, callingPid, callingUserId);
42 }
43
44 @Override
45 public void startPreparedClient(int cookie) throws RemoteException {
46 mFaceService.startPreparedClient(cookie);
47 }
48
49 @Override
50 public void cancelAuthenticationFromService(IBinder token, String opPackageName, int callingUid,
51 int callingPid, int callingUserId, boolean fromClient) throws RemoteException {
52 mFaceService.cancelAuthenticationFromService(token, opPackageName, callingUid, callingPid,
53 callingUserId, fromClient);
54 }
55
56 @Override
57 public boolean isHardwareDetected(String opPackageName) throws RemoteException {
58 return mFaceService.isHardwareDetected(opPackageName);
59 }
60
61 @Override
62 public boolean hasEnrolledTemplates(int userId, String opPackageName) throws RemoteException {
63 return mFaceService.hasEnrolledFaces(userId, opPackageName);
64 }
65
66 @Override
67 public void resetLockout(byte[] token) throws RemoteException {
68 mFaceService.resetLockout(token);
69 }
70
71 @Override
72 public void setActiveUser(int uid) throws RemoteException {
73 mFaceService.setActiveUser(uid);
74 }
Kevin Chyn7d07c892020-02-18 18:18:17 -080075
76 @Override
77 public long getAuthenticatorId() throws RemoteException {
78 return mFaceService.getAuthenticatorId();
79 }
Ilya Matyukhinf2da1a12019-09-25 15:31:03 -070080}