1 /* 2 * Copyright (C) 2021 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.fingerprint; 18 19 import android.annotation.IntDef; 20 21 import java.lang.annotation.Retention; 22 import java.lang.annotation.RetentionPolicy; 23 24 /** 25 * Interface for handling state changes in fingerprint-related events. 26 * @hide 27 */ 28 public abstract class FingerprintStateListener extends IFingerprintStateListener.Stub { 29 // Operation has not started yet. 30 public static final int STATE_IDLE = 0; 31 32 // Enrollment is in progress. 33 public static final int STATE_ENROLLING = 1; 34 35 // Lockscreen authentication in progress. 36 public static final int STATE_KEYGUARD_AUTH = 2; 37 38 // BiometricPrompt authentication in progress. 39 public static final int STATE_BP_AUTH = 3; 40 41 // Other Authentication State 42 public static final int STATE_AUTH_OTHER = 4; 43 44 @IntDef({STATE_IDLE, STATE_ENROLLING, STATE_KEYGUARD_AUTH, STATE_BP_AUTH, STATE_AUTH_OTHER}) 45 @Retention(RetentionPolicy.SOURCE) 46 public @interface State {} 47 48 /** 49 * Defines behavior in response to state update 50 * @param newState new state of fingerprint sensor 51 */ onStateChanged(@ingerprintStateListener.State int newState)52 public abstract void onStateChanged(@FingerprintStateListener.State int newState); 53 } 54