1 /* 2 * Copyright (C) 2018 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 com.android.systemui.biometrics; 18 19 import android.annotation.Nullable; 20 import android.hardware.biometrics.BiometricPrompt; 21 22 /** 23 * Callback interface for dialog views. These should be implemented by the controller (e.g. 24 * FingerprintDialogImpl) and passed into their views (e.g. FingerprintDialogView). 25 */ 26 public interface AuthDialogCallback { 27 /** 28 * Invoked when the dialog is dismissed 29 * @param reason - the {@link BiometricPrompt.DismissedReason} for dismissing 30 * @param credentialAttestation the HAT received from LockSettingsService upon verification 31 */ onDismissed(@iometricPrompt.DismissedReason int reason, @Nullable byte[] credentialAttestation, long requestId)32 void onDismissed(@BiometricPrompt.DismissedReason int reason, 33 @Nullable byte[] credentialAttestation, long requestId); 34 35 /** 36 * Invoked when the "try again" button is clicked 37 */ onTryAgainPressed(long requestId)38 void onTryAgainPressed(long requestId); 39 40 /** 41 * Invoked when the "use password" button is clicked 42 */ onDeviceCredentialPressed(long requestId)43 void onDeviceCredentialPressed(long requestId); 44 45 /** 46 * See {@link android.hardware.biometrics.BiometricPrompt.Builder 47 * #setReceiveSystemEvents(boolean)} 48 * @param event 49 */ onSystemEvent(int event, long requestId)50 void onSystemEvent(int event, long requestId); 51 52 /** 53 * Notifies when the dialog has finished animating. 54 */ onDialogAnimatedIn(long requestId, boolean startFingerprintNow)55 void onDialogAnimatedIn(long requestId, boolean startFingerprintNow); 56 57 /** 58 * Notifies that the fingerprint sensor should be started now. 59 */ onStartFingerprintNow(long requestId)60 void onStartFingerprintNow(long requestId); 61 } 62