Loading core/java/android/hardware/biometrics/BiometricFaceConstants.java +52 −52 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ import java.lang.annotation.RetentionPolicy; * * @hide */ public interface BiometricFaceConstants { public class BiometricFaceConstants { // // Accessibility constants // Loading @@ -43,12 +43,12 @@ public interface BiometricFaceConstants { * authentication. Note this is to accommodate people who have limited * vision. */ int FEATURE_REQUIRE_ATTENTION = 1; public static final int FEATURE_REQUIRE_ATTENTION = 1; /** * Require a diverse set of poses during enrollment. Note this is to * accommodate people with limited mobility. */ int FEATURE_REQUIRE_REQUIRE_DIVERSITY = 2; public static final int FEATURE_REQUIRE_REQUIRE_DIVERSITY = 2; // // Error messages from face authentication hardware during initialization, enrollment, Loading @@ -75,49 +75,49 @@ public interface BiometricFaceConstants { BIOMETRIC_ERROR_POWER_PRESSED, }) @Retention(RetentionPolicy.SOURCE) @interface FaceError {} public @interface FaceError {} /** * The hardware is unavailable. Try again later. */ int FACE_ERROR_HW_UNAVAILABLE = 1; public static final int FACE_ERROR_HW_UNAVAILABLE = 1; /** * Error state returned when the sensor was unable to process the current image. */ int FACE_ERROR_UNABLE_TO_PROCESS = 2; public static final int FACE_ERROR_UNABLE_TO_PROCESS = 2; /** * Error state returned when the current request has been running too long. This is intended to * prevent programs from waiting for the face authentication sensor indefinitely. The timeout is * platform and sensor-specific, but is generally on the order of 30 seconds. */ int FACE_ERROR_TIMEOUT = 3; public static final int FACE_ERROR_TIMEOUT = 3; /** * Error state returned for operations like enrollment; the operation cannot be completed * because there's not enough storage remaining to complete the operation. */ int FACE_ERROR_NO_SPACE = 4; public static final int FACE_ERROR_NO_SPACE = 4; /** * The operation was canceled because the face authentication sensor is unavailable. For * example, this may happen when the user is switched, the device is locked or another pending * operation prevents or disables it. */ int FACE_ERROR_CANCELED = 5; public static final int FACE_ERROR_CANCELED = 5; /** * The {@link FaceManager#remove} call failed. Typically this will happen when the * provided face id was incorrect. */ int FACE_ERROR_UNABLE_TO_REMOVE = 6; public static final int FACE_ERROR_UNABLE_TO_REMOVE = 6; /** * The operation was canceled because the API is locked out due to too many attempts. * This occurs after 5 failed attempts, and lasts for 30 seconds. */ int FACE_ERROR_LOCKOUT = 7; public static final int FACE_ERROR_LOCKOUT = 7; /** * Hardware vendors may extend this list if there are conditions that do not fall under one of Loading @@ -127,46 +127,46 @@ public interface BiometricFaceConstants { * expected to show the error message string if they happen, but are advised not to rely on the * message id since they will be device and vendor-specific */ int FACE_ERROR_VENDOR = 8; public static final int FACE_ERROR_VENDOR = 8; /** * The operation was canceled because FACE_ERROR_LOCKOUT occurred too many times. * Face authentication is disabled until the user unlocks with strong authentication * (PIN/Pattern/Password) */ int FACE_ERROR_LOCKOUT_PERMANENT = 9; public static final int FACE_ERROR_LOCKOUT_PERMANENT = 9; /** * The user canceled the operation. Upon receiving this, applications should use alternate * authentication (e.g. a password). The application should also provide the means to return * to face authentication, such as a "use face authentication" button. */ int FACE_ERROR_USER_CANCELED = 10; public static final int FACE_ERROR_USER_CANCELED = 10; /** * The user does not have a face enrolled. */ int FACE_ERROR_NOT_ENROLLED = 11; public static final int FACE_ERROR_NOT_ENROLLED = 11; /** * The device does not have a face sensor. This message will propagate if the calling app * ignores the result from PackageManager.hasFeature(FEATURE_FACE) and calls * this API anyway. Apps should always check for the feature before calling this API. */ int FACE_ERROR_HW_NOT_PRESENT = 12; public static final int FACE_ERROR_HW_NOT_PRESENT = 12; /** * The user pressed the negative button. This is a placeholder that is currently only used * by the support library. */ int FACE_ERROR_NEGATIVE_BUTTON = 13; public static final int FACE_ERROR_NEGATIVE_BUTTON = 13; /** * The device does not have pin, pattern, or password set up. See * {@link BiometricPrompt.Builder#setDeviceCredentialAllowed(boolean)} and * {@link KeyguardManager#isDeviceSecure()} */ int BIOMETRIC_ERROR_NO_DEVICE_CREDENTIAL = 14; public static final int BIOMETRIC_ERROR_NO_DEVICE_CREDENTIAL = 14; /** * A security vulnerability has been discovered and the sensor is unavailable until a Loading @@ -174,30 +174,30 @@ public interface BiometricFaceConstants { * authentication was requested with {@link Authenticators#BIOMETRIC_STRONG}, but the * sensor's strength can currently only meet {@link Authenticators#BIOMETRIC_WEAK}. */ int BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED = 15; public static final int BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED = 15; /** * Authentication cannot proceed because re-enrollment is required. */ int BIOMETRIC_ERROR_RE_ENROLL = 16; public static final int BIOMETRIC_ERROR_RE_ENROLL = 16; /** * Unknown error received from the HAL. */ int FACE_ERROR_UNKNOWN = 17; public static final int FACE_ERROR_UNKNOWN = 17; /** * A power press stopped this biometric operation. * @hide */ int BIOMETRIC_ERROR_POWER_PRESSED = 19; public static final int BIOMETRIC_ERROR_POWER_PRESSED = 19; /** * Vendor codes received from the HAL start at 0. Codes that the framework exposes to keyguard * append this value for some reason. We should probably remove this and just send the actual * vendor code. */ int FACE_ERROR_VENDOR_BASE = 1000; public static final int FACE_ERROR_VENDOR_BASE = 1000; // // Image acquisition messages. These will not be sent to the user, since they conflict with Loading Loading @@ -232,18 +232,18 @@ public interface BiometricFaceConstants { FACE_ACQUIRED_DARK_GLASSES_DETECTED, FACE_ACQUIRED_MOUTH_COVERING_DETECTED}) @Retention(RetentionPolicy.SOURCE) @interface FaceAcquired {} public @interface FaceAcquired {} /** * The image acquired was good. */ int FACE_ACQUIRED_GOOD = 0; public static final int FACE_ACQUIRED_GOOD = 0; /** * The face image was not good enough to process due to a detected condition. * (See {@link #FACE_ACQUIRED_TOO_BRIGHT or @link #FACE_ACQUIRED_TOO_DARK}). */ int FACE_ACQUIRED_INSUFFICIENT = 1; public static final int FACE_ACQUIRED_INSUFFICIENT = 1; /** * The face image was too bright due to too much ambient light. Loading @@ -252,7 +252,7 @@ public interface BiometricFaceConstants { * The user is expected to take action to retry in better lighting conditions * when this is returned. */ int FACE_ACQUIRED_TOO_BRIGHT = 2; public static final int FACE_ACQUIRED_TOO_BRIGHT = 2; /** * The face image was too dark due to illumination light obscured. Loading @@ -261,65 +261,65 @@ public interface BiometricFaceConstants { * The user is expected to take action to retry in better lighting conditions * when this is returned. */ int FACE_ACQUIRED_TOO_DARK = 3; public static final int FACE_ACQUIRED_TOO_DARK = 3; /** * The detected face is too close to the sensor, and the image can't be processed. * The user should be informed to move farther from the sensor when this is returned. */ int FACE_ACQUIRED_TOO_CLOSE = 4; public static final int FACE_ACQUIRED_TOO_CLOSE = 4; /** * The detected face is too small, as the user might be too far from the sensor. * The user should be informed to move closer to the sensor when this is returned. */ int FACE_ACQUIRED_TOO_FAR = 5; public static final int FACE_ACQUIRED_TOO_FAR = 5; /** * Only the upper part of the face was detected. The sensor field of view is too high. * The user should be informed to move up with respect to the sensor when this is returned. */ int FACE_ACQUIRED_TOO_HIGH = 6; public static final int FACE_ACQUIRED_TOO_HIGH = 6; /** * Only the lower part of the face was detected. The sensor field of view is too low. * The user should be informed to move down with respect to the sensor when this is returned. */ int FACE_ACQUIRED_TOO_LOW = 7; public static final int FACE_ACQUIRED_TOO_LOW = 7; /** * Only the right part of the face was detected. The sensor field of view is too far right. * The user should be informed to move to the right with respect to the sensor * when this is returned. */ int FACE_ACQUIRED_TOO_RIGHT = 8; public static final int FACE_ACQUIRED_TOO_RIGHT = 8; /** * Only the left part of the face was detected. The sensor field of view is too far left. * The user should be informed to move to the left with respect to the sensor * when this is returned. */ int FACE_ACQUIRED_TOO_LEFT = 9; public static final int FACE_ACQUIRED_TOO_LEFT = 9; /** * The user's eyes have strayed away from the sensor. If this message is sent, the user should * be informed to look at the device. If the user can't be found in the frame, one of the other * acquisition messages should be sent, e.g. FACE_ACQUIRED_NOT_DETECTED. */ int FACE_ACQUIRED_POOR_GAZE = 10; public static final int FACE_ACQUIRED_POOR_GAZE = 10; /** * No face was detected in front of the sensor. * The user should be informed to point the sensor to a face when this is returned. */ int FACE_ACQUIRED_NOT_DETECTED = 11; public static final int FACE_ACQUIRED_NOT_DETECTED = 11; /** * Too much motion was detected. * The user should be informed to keep their face steady relative to the * sensor. */ int FACE_ACQUIRED_TOO_MUCH_MOTION = 12; public static final int FACE_ACQUIRED_TOO_MUCH_MOTION = 12; /** * The sensor needs to be re-calibrated. This is an unexpected condition, and should only be Loading @@ -327,20 +327,20 @@ public interface BiometricFaceConstants { * requires user intervention, e.g. re-enrolling. The expected response to this message is to * direct the user to re-enroll. */ int FACE_ACQUIRED_RECALIBRATE = 13; public static final int FACE_ACQUIRED_RECALIBRATE = 13; /** * The face is too different from a previous acquisition. This condition * only applies to enrollment. This can happen if the user passes the * device to someone else in the middle of enrollment. */ int FACE_ACQUIRED_TOO_DIFFERENT = 14; public static final int FACE_ACQUIRED_TOO_DIFFERENT = 14; /** * The face is too similar to a previous acquisition. This condition only * applies to enrollment. The user should change their pose. */ int FACE_ACQUIRED_TOO_SIMILAR = 15; public static final int FACE_ACQUIRED_TOO_SIMILAR = 15; /** * The magnitude of the pan angle of the user’s face with respect to the sensor’s Loading @@ -352,7 +352,7 @@ public interface BiometricFaceConstants { * * The user should be informed to look more directly at the camera. */ int FACE_ACQUIRED_PAN_TOO_EXTREME = 16; public static final int FACE_ACQUIRED_PAN_TOO_EXTREME = 16; /** * The magnitude of the tilt angle of the user’s face with respect to the sensor’s Loading @@ -363,7 +363,7 @@ public interface BiometricFaceConstants { * * The user should be informed to look more directly at the camera. */ int FACE_ACQUIRED_TILT_TOO_EXTREME = 17; public static final int FACE_ACQUIRED_TILT_TOO_EXTREME = 17; /** * The magnitude of the roll angle of the user’s face with respect to the sensor’s Loading @@ -375,7 +375,7 @@ public interface BiometricFaceConstants { * * The user should be informed to look more directly at the camera. */ int FACE_ACQUIRED_ROLL_TOO_EXTREME = 18; public static final int FACE_ACQUIRED_ROLL_TOO_EXTREME = 18; /** * The user’s face has been obscured by some object. Loading @@ -383,7 +383,7 @@ public interface BiometricFaceConstants { * The user should be informed to remove any objects from the line of sight from * the sensor to the user’s face. */ int FACE_ACQUIRED_FACE_OBSCURED = 19; public static final int FACE_ACQUIRED_FACE_OBSCURED = 19; /** * This message represents the earliest message sent at the beginning of the authentication Loading @@ -393,47 +393,47 @@ public interface BiometricFaceConstants { * The framework will measure latency based on the time between the last START message and the * onAuthenticated callback. */ int FACE_ACQUIRED_START = 20; public static final int FACE_ACQUIRED_START = 20; /** * The sensor is dirty. The user should be informed to clean the sensor. */ int FACE_ACQUIRED_SENSOR_DIRTY = 21; public static final int FACE_ACQUIRED_SENSOR_DIRTY = 21; /** * Hardware vendors may extend this list if there are conditions that do not fall under one of * the above categories. Vendors are responsible for providing error strings for these errors. */ int FACE_ACQUIRED_VENDOR = 22; public static final int FACE_ACQUIRED_VENDOR = 22; /** * Unknown acquired code received from the HAL. */ int FACE_ACQUIRED_UNKNOWN = 23; public static final int FACE_ACQUIRED_UNKNOWN = 23; /** * The first frame from the camera has been received. */ int FACE_ACQUIRED_FIRST_FRAME_RECEIVED = 24; public static final int FACE_ACQUIRED_FIRST_FRAME_RECEIVED = 24; /** * Dark glasses detected. This can be useful for providing relevant feedback to the user and * enabling an alternative authentication logic if the implementation supports it. */ int FACE_ACQUIRED_DARK_GLASSES_DETECTED = 25; public static final int FACE_ACQUIRED_DARK_GLASSES_DETECTED = 25; /** * A face mask or face covering detected. This can be useful for providing relevant feedback to * the user and enabling an alternative authentication logic if the implementation supports it. */ int FACE_ACQUIRED_MOUTH_COVERING_DETECTED = 26; public static final int FACE_ACQUIRED_MOUTH_COVERING_DETECTED = 26; /** * Vendor codes received from the HAL start at 0. Codes that the framework exposes to keyguard * append this value for some reason. We should probably remove this and just send the actual * vendor code. */ int FACE_ACQUIRED_VENDOR_BASE = 1000; public static final int FACE_ACQUIRED_VENDOR_BASE = 1000; /** Loading core/java/android/hardware/face/FaceManager.java +39 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,44 @@ import static android.Manifest.permission.INTERACT_ACROSS_USERS; import static android.Manifest.permission.MANAGE_BIOMETRIC; import static android.Manifest.permission.USE_BIOMETRIC_INTERNAL; import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_LOCKOUT_NONE; import static android.hardware.biometrics.BiometricFaceConstants.BIOMETRIC_ERROR_RE_ENROLL; import static android.hardware.biometrics.BiometricFaceConstants.BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_DARK_GLASSES_DETECTED; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_FACE_OBSCURED; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_GOOD; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_INSUFFICIENT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_MOUTH_COVERING_DETECTED; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_NOT_DETECTED; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_PAN_TOO_EXTREME; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_POOR_GAZE; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_RECALIBRATE; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_ROLL_TOO_EXTREME; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_SENSOR_DIRTY; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_START; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TILT_TOO_EXTREME; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_BRIGHT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_CLOSE; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_DARK; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_DIFFERENT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_FAR; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_HIGH; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_LEFT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_LOW; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_MUCH_MOTION; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_RIGHT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_SIMILAR; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_VENDOR; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_CANCELED; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_HW_NOT_PRESENT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_HW_UNAVAILABLE; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_LOCKOUT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_LOCKOUT_PERMANENT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_NOT_ENROLLED; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_NO_SPACE; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_TIMEOUT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_UNABLE_TO_PROCESS; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_USER_CANCELED; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_VENDOR; import android.annotation.NonNull; import android.annotation.Nullable; Loading @@ -29,7 +67,6 @@ import android.content.Context; import android.content.pm.PackageManager; import android.hardware.biometrics.BiometricAuthenticator; import android.hardware.biometrics.BiometricConstants; import android.hardware.biometrics.BiometricFaceConstants; import android.hardware.biometrics.BiometricStateListener; import android.hardware.biometrics.CryptoObject; import android.hardware.biometrics.IBiometricServiceLockoutResetCallback; Loading Loading @@ -58,7 +95,7 @@ import java.util.List; * @hide */ @SystemService(Context.FACE_SERVICE) public class FaceManager implements BiometricAuthenticator, BiometricFaceConstants { public class FaceManager implements BiometricAuthenticator { private static final String TAG = "FaceManager"; Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +4 −2 Original line number Diff line number Diff line Loading @@ -30,6 +30,8 @@ import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_LOCKOUT_N import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_LOCKOUT_PERMANENT; import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_LOCKOUT_TIMED; import static android.hardware.biometrics.BiometricConstants.LockoutMode; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_HW_UNAVAILABLE; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_LOCKOUT_PERMANENT; import static android.hardware.biometrics.BiometricSourceType.FACE; import static android.hardware.biometrics.BiometricSourceType.FINGERPRINT; import static android.os.BatteryManager.BATTERY_STATUS_UNKNOWN; Loading Loading @@ -1238,9 +1240,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab boolean cameraPrivacyEnabled = mSensorPrivacyManager.isSensorPrivacyEnabled( SensorPrivacyManager.TOGGLE_TYPE_SOFTWARE, SensorPrivacyManager.Sensors.CAMERA); final boolean isHwUnavailable = msgId == FaceManager.FACE_ERROR_HW_UNAVAILABLE; final boolean isHwUnavailable = msgId == FACE_ERROR_HW_UNAVAILABLE; if (msgId == FaceManager.FACE_ERROR_LOCKOUT_PERMANENT) { if (msgId == FACE_ERROR_LOCKOUT_PERMANENT) { if (getFaceAuthInteractor() != null && getFaceAuthInteractor().isFaceAuthStrong()) { updateFingerprintListeningState(BIOMETRIC_ACTION_STOP); } Loading packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/FaceHelpMessageDeferralInteractor.kt +2 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.deviceentry.domain.interactor import android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_START import android.hardware.face.FaceManager import com.android.systemui.biometrics.FaceHelpMessageDeferralFactory import com.android.systemui.dagger.SysUISingleton Loading Loading @@ -86,7 +87,7 @@ constructor( } } .collect { if (it.acquiredInfo == FaceManager.FACE_ACQUIRED_START) { if (it.acquiredInfo == FACE_ACQUIRED_START) { faceHelpMessageDeferral.reset() } faceHelpMessageDeferral.processFrame(it.acquiredInfo) Loading packages/SystemUI/src/com/android/systemui/deviceentry/shared/model/FaceAuthenticationModels.kt +11 −7 Original line number Diff line number Diff line Loading @@ -16,6 +16,12 @@ package com.android.systemui.deviceentry.shared.model import android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_CANCELED import android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_HW_UNAVAILABLE import android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_LOCKOUT import android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_LOCKOUT_PERMANENT import android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_TIMEOUT import android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_UNABLE_TO_PROCESS import android.hardware.face.FaceManager import android.os.SystemClock.elapsedRealtime Loading Loading @@ -62,24 +68,22 @@ data class ErrorFaceAuthenticationStatus( * Method that checks if [msgId] is a lockout error. A lockout error means that face * authentication is locked out. */ fun isLockoutError() = msgId == FaceManager.FACE_ERROR_LOCKOUT_PERMANENT || msgId == FaceManager.FACE_ERROR_LOCKOUT fun isLockoutError() = msgId == FACE_ERROR_LOCKOUT_PERMANENT || msgId == FACE_ERROR_LOCKOUT /** * Method that checks if [msgId] is a cancellation error. This means that face authentication * was cancelled before it completed. */ fun isCancellationError() = msgId == FaceManager.FACE_ERROR_CANCELED fun isCancellationError() = msgId == FACE_ERROR_CANCELED fun isUnableToProcessError() = msgId == FaceManager.FACE_ERROR_UNABLE_TO_PROCESS fun isUnableToProcessError() = msgId == FACE_ERROR_UNABLE_TO_PROCESS /** Method that checks if [msgId] is a hardware error. */ fun isHardwareError() = msgId == FaceManager.FACE_ERROR_HW_UNAVAILABLE || msgId == FaceManager.FACE_ERROR_UNABLE_TO_PROCESS msgId == FACE_ERROR_HW_UNAVAILABLE || msgId == FACE_ERROR_UNABLE_TO_PROCESS /** Method that checks if [msgId] is a timeout error. */ fun isTimeoutError() = msgId == FaceManager.FACE_ERROR_TIMEOUT fun isTimeoutError() = msgId == FACE_ERROR_TIMEOUT companion object { /** Loading Loading
core/java/android/hardware/biometrics/BiometricFaceConstants.java +52 −52 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ import java.lang.annotation.RetentionPolicy; * * @hide */ public interface BiometricFaceConstants { public class BiometricFaceConstants { // // Accessibility constants // Loading @@ -43,12 +43,12 @@ public interface BiometricFaceConstants { * authentication. Note this is to accommodate people who have limited * vision. */ int FEATURE_REQUIRE_ATTENTION = 1; public static final int FEATURE_REQUIRE_ATTENTION = 1; /** * Require a diverse set of poses during enrollment. Note this is to * accommodate people with limited mobility. */ int FEATURE_REQUIRE_REQUIRE_DIVERSITY = 2; public static final int FEATURE_REQUIRE_REQUIRE_DIVERSITY = 2; // // Error messages from face authentication hardware during initialization, enrollment, Loading @@ -75,49 +75,49 @@ public interface BiometricFaceConstants { BIOMETRIC_ERROR_POWER_PRESSED, }) @Retention(RetentionPolicy.SOURCE) @interface FaceError {} public @interface FaceError {} /** * The hardware is unavailable. Try again later. */ int FACE_ERROR_HW_UNAVAILABLE = 1; public static final int FACE_ERROR_HW_UNAVAILABLE = 1; /** * Error state returned when the sensor was unable to process the current image. */ int FACE_ERROR_UNABLE_TO_PROCESS = 2; public static final int FACE_ERROR_UNABLE_TO_PROCESS = 2; /** * Error state returned when the current request has been running too long. This is intended to * prevent programs from waiting for the face authentication sensor indefinitely. The timeout is * platform and sensor-specific, but is generally on the order of 30 seconds. */ int FACE_ERROR_TIMEOUT = 3; public static final int FACE_ERROR_TIMEOUT = 3; /** * Error state returned for operations like enrollment; the operation cannot be completed * because there's not enough storage remaining to complete the operation. */ int FACE_ERROR_NO_SPACE = 4; public static final int FACE_ERROR_NO_SPACE = 4; /** * The operation was canceled because the face authentication sensor is unavailable. For * example, this may happen when the user is switched, the device is locked or another pending * operation prevents or disables it. */ int FACE_ERROR_CANCELED = 5; public static final int FACE_ERROR_CANCELED = 5; /** * The {@link FaceManager#remove} call failed. Typically this will happen when the * provided face id was incorrect. */ int FACE_ERROR_UNABLE_TO_REMOVE = 6; public static final int FACE_ERROR_UNABLE_TO_REMOVE = 6; /** * The operation was canceled because the API is locked out due to too many attempts. * This occurs after 5 failed attempts, and lasts for 30 seconds. */ int FACE_ERROR_LOCKOUT = 7; public static final int FACE_ERROR_LOCKOUT = 7; /** * Hardware vendors may extend this list if there are conditions that do not fall under one of Loading @@ -127,46 +127,46 @@ public interface BiometricFaceConstants { * expected to show the error message string if they happen, but are advised not to rely on the * message id since they will be device and vendor-specific */ int FACE_ERROR_VENDOR = 8; public static final int FACE_ERROR_VENDOR = 8; /** * The operation was canceled because FACE_ERROR_LOCKOUT occurred too many times. * Face authentication is disabled until the user unlocks with strong authentication * (PIN/Pattern/Password) */ int FACE_ERROR_LOCKOUT_PERMANENT = 9; public static final int FACE_ERROR_LOCKOUT_PERMANENT = 9; /** * The user canceled the operation. Upon receiving this, applications should use alternate * authentication (e.g. a password). The application should also provide the means to return * to face authentication, such as a "use face authentication" button. */ int FACE_ERROR_USER_CANCELED = 10; public static final int FACE_ERROR_USER_CANCELED = 10; /** * The user does not have a face enrolled. */ int FACE_ERROR_NOT_ENROLLED = 11; public static final int FACE_ERROR_NOT_ENROLLED = 11; /** * The device does not have a face sensor. This message will propagate if the calling app * ignores the result from PackageManager.hasFeature(FEATURE_FACE) and calls * this API anyway. Apps should always check for the feature before calling this API. */ int FACE_ERROR_HW_NOT_PRESENT = 12; public static final int FACE_ERROR_HW_NOT_PRESENT = 12; /** * The user pressed the negative button. This is a placeholder that is currently only used * by the support library. */ int FACE_ERROR_NEGATIVE_BUTTON = 13; public static final int FACE_ERROR_NEGATIVE_BUTTON = 13; /** * The device does not have pin, pattern, or password set up. See * {@link BiometricPrompt.Builder#setDeviceCredentialAllowed(boolean)} and * {@link KeyguardManager#isDeviceSecure()} */ int BIOMETRIC_ERROR_NO_DEVICE_CREDENTIAL = 14; public static final int BIOMETRIC_ERROR_NO_DEVICE_CREDENTIAL = 14; /** * A security vulnerability has been discovered and the sensor is unavailable until a Loading @@ -174,30 +174,30 @@ public interface BiometricFaceConstants { * authentication was requested with {@link Authenticators#BIOMETRIC_STRONG}, but the * sensor's strength can currently only meet {@link Authenticators#BIOMETRIC_WEAK}. */ int BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED = 15; public static final int BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED = 15; /** * Authentication cannot proceed because re-enrollment is required. */ int BIOMETRIC_ERROR_RE_ENROLL = 16; public static final int BIOMETRIC_ERROR_RE_ENROLL = 16; /** * Unknown error received from the HAL. */ int FACE_ERROR_UNKNOWN = 17; public static final int FACE_ERROR_UNKNOWN = 17; /** * A power press stopped this biometric operation. * @hide */ int BIOMETRIC_ERROR_POWER_PRESSED = 19; public static final int BIOMETRIC_ERROR_POWER_PRESSED = 19; /** * Vendor codes received from the HAL start at 0. Codes that the framework exposes to keyguard * append this value for some reason. We should probably remove this and just send the actual * vendor code. */ int FACE_ERROR_VENDOR_BASE = 1000; public static final int FACE_ERROR_VENDOR_BASE = 1000; // // Image acquisition messages. These will not be sent to the user, since they conflict with Loading Loading @@ -232,18 +232,18 @@ public interface BiometricFaceConstants { FACE_ACQUIRED_DARK_GLASSES_DETECTED, FACE_ACQUIRED_MOUTH_COVERING_DETECTED}) @Retention(RetentionPolicy.SOURCE) @interface FaceAcquired {} public @interface FaceAcquired {} /** * The image acquired was good. */ int FACE_ACQUIRED_GOOD = 0; public static final int FACE_ACQUIRED_GOOD = 0; /** * The face image was not good enough to process due to a detected condition. * (See {@link #FACE_ACQUIRED_TOO_BRIGHT or @link #FACE_ACQUIRED_TOO_DARK}). */ int FACE_ACQUIRED_INSUFFICIENT = 1; public static final int FACE_ACQUIRED_INSUFFICIENT = 1; /** * The face image was too bright due to too much ambient light. Loading @@ -252,7 +252,7 @@ public interface BiometricFaceConstants { * The user is expected to take action to retry in better lighting conditions * when this is returned. */ int FACE_ACQUIRED_TOO_BRIGHT = 2; public static final int FACE_ACQUIRED_TOO_BRIGHT = 2; /** * The face image was too dark due to illumination light obscured. Loading @@ -261,65 +261,65 @@ public interface BiometricFaceConstants { * The user is expected to take action to retry in better lighting conditions * when this is returned. */ int FACE_ACQUIRED_TOO_DARK = 3; public static final int FACE_ACQUIRED_TOO_DARK = 3; /** * The detected face is too close to the sensor, and the image can't be processed. * The user should be informed to move farther from the sensor when this is returned. */ int FACE_ACQUIRED_TOO_CLOSE = 4; public static final int FACE_ACQUIRED_TOO_CLOSE = 4; /** * The detected face is too small, as the user might be too far from the sensor. * The user should be informed to move closer to the sensor when this is returned. */ int FACE_ACQUIRED_TOO_FAR = 5; public static final int FACE_ACQUIRED_TOO_FAR = 5; /** * Only the upper part of the face was detected. The sensor field of view is too high. * The user should be informed to move up with respect to the sensor when this is returned. */ int FACE_ACQUIRED_TOO_HIGH = 6; public static final int FACE_ACQUIRED_TOO_HIGH = 6; /** * Only the lower part of the face was detected. The sensor field of view is too low. * The user should be informed to move down with respect to the sensor when this is returned. */ int FACE_ACQUIRED_TOO_LOW = 7; public static final int FACE_ACQUIRED_TOO_LOW = 7; /** * Only the right part of the face was detected. The sensor field of view is too far right. * The user should be informed to move to the right with respect to the sensor * when this is returned. */ int FACE_ACQUIRED_TOO_RIGHT = 8; public static final int FACE_ACQUIRED_TOO_RIGHT = 8; /** * Only the left part of the face was detected. The sensor field of view is too far left. * The user should be informed to move to the left with respect to the sensor * when this is returned. */ int FACE_ACQUIRED_TOO_LEFT = 9; public static final int FACE_ACQUIRED_TOO_LEFT = 9; /** * The user's eyes have strayed away from the sensor. If this message is sent, the user should * be informed to look at the device. If the user can't be found in the frame, one of the other * acquisition messages should be sent, e.g. FACE_ACQUIRED_NOT_DETECTED. */ int FACE_ACQUIRED_POOR_GAZE = 10; public static final int FACE_ACQUIRED_POOR_GAZE = 10; /** * No face was detected in front of the sensor. * The user should be informed to point the sensor to a face when this is returned. */ int FACE_ACQUIRED_NOT_DETECTED = 11; public static final int FACE_ACQUIRED_NOT_DETECTED = 11; /** * Too much motion was detected. * The user should be informed to keep their face steady relative to the * sensor. */ int FACE_ACQUIRED_TOO_MUCH_MOTION = 12; public static final int FACE_ACQUIRED_TOO_MUCH_MOTION = 12; /** * The sensor needs to be re-calibrated. This is an unexpected condition, and should only be Loading @@ -327,20 +327,20 @@ public interface BiometricFaceConstants { * requires user intervention, e.g. re-enrolling. The expected response to this message is to * direct the user to re-enroll. */ int FACE_ACQUIRED_RECALIBRATE = 13; public static final int FACE_ACQUIRED_RECALIBRATE = 13; /** * The face is too different from a previous acquisition. This condition * only applies to enrollment. This can happen if the user passes the * device to someone else in the middle of enrollment. */ int FACE_ACQUIRED_TOO_DIFFERENT = 14; public static final int FACE_ACQUIRED_TOO_DIFFERENT = 14; /** * The face is too similar to a previous acquisition. This condition only * applies to enrollment. The user should change their pose. */ int FACE_ACQUIRED_TOO_SIMILAR = 15; public static final int FACE_ACQUIRED_TOO_SIMILAR = 15; /** * The magnitude of the pan angle of the user’s face with respect to the sensor’s Loading @@ -352,7 +352,7 @@ public interface BiometricFaceConstants { * * The user should be informed to look more directly at the camera. */ int FACE_ACQUIRED_PAN_TOO_EXTREME = 16; public static final int FACE_ACQUIRED_PAN_TOO_EXTREME = 16; /** * The magnitude of the tilt angle of the user’s face with respect to the sensor’s Loading @@ -363,7 +363,7 @@ public interface BiometricFaceConstants { * * The user should be informed to look more directly at the camera. */ int FACE_ACQUIRED_TILT_TOO_EXTREME = 17; public static final int FACE_ACQUIRED_TILT_TOO_EXTREME = 17; /** * The magnitude of the roll angle of the user’s face with respect to the sensor’s Loading @@ -375,7 +375,7 @@ public interface BiometricFaceConstants { * * The user should be informed to look more directly at the camera. */ int FACE_ACQUIRED_ROLL_TOO_EXTREME = 18; public static final int FACE_ACQUIRED_ROLL_TOO_EXTREME = 18; /** * The user’s face has been obscured by some object. Loading @@ -383,7 +383,7 @@ public interface BiometricFaceConstants { * The user should be informed to remove any objects from the line of sight from * the sensor to the user’s face. */ int FACE_ACQUIRED_FACE_OBSCURED = 19; public static final int FACE_ACQUIRED_FACE_OBSCURED = 19; /** * This message represents the earliest message sent at the beginning of the authentication Loading @@ -393,47 +393,47 @@ public interface BiometricFaceConstants { * The framework will measure latency based on the time between the last START message and the * onAuthenticated callback. */ int FACE_ACQUIRED_START = 20; public static final int FACE_ACQUIRED_START = 20; /** * The sensor is dirty. The user should be informed to clean the sensor. */ int FACE_ACQUIRED_SENSOR_DIRTY = 21; public static final int FACE_ACQUIRED_SENSOR_DIRTY = 21; /** * Hardware vendors may extend this list if there are conditions that do not fall under one of * the above categories. Vendors are responsible for providing error strings for these errors. */ int FACE_ACQUIRED_VENDOR = 22; public static final int FACE_ACQUIRED_VENDOR = 22; /** * Unknown acquired code received from the HAL. */ int FACE_ACQUIRED_UNKNOWN = 23; public static final int FACE_ACQUIRED_UNKNOWN = 23; /** * The first frame from the camera has been received. */ int FACE_ACQUIRED_FIRST_FRAME_RECEIVED = 24; public static final int FACE_ACQUIRED_FIRST_FRAME_RECEIVED = 24; /** * Dark glasses detected. This can be useful for providing relevant feedback to the user and * enabling an alternative authentication logic if the implementation supports it. */ int FACE_ACQUIRED_DARK_GLASSES_DETECTED = 25; public static final int FACE_ACQUIRED_DARK_GLASSES_DETECTED = 25; /** * A face mask or face covering detected. This can be useful for providing relevant feedback to * the user and enabling an alternative authentication logic if the implementation supports it. */ int FACE_ACQUIRED_MOUTH_COVERING_DETECTED = 26; public static final int FACE_ACQUIRED_MOUTH_COVERING_DETECTED = 26; /** * Vendor codes received from the HAL start at 0. Codes that the framework exposes to keyguard * append this value for some reason. We should probably remove this and just send the actual * vendor code. */ int FACE_ACQUIRED_VENDOR_BASE = 1000; public static final int FACE_ACQUIRED_VENDOR_BASE = 1000; /** Loading
core/java/android/hardware/face/FaceManager.java +39 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,44 @@ import static android.Manifest.permission.INTERACT_ACROSS_USERS; import static android.Manifest.permission.MANAGE_BIOMETRIC; import static android.Manifest.permission.USE_BIOMETRIC_INTERNAL; import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_LOCKOUT_NONE; import static android.hardware.biometrics.BiometricFaceConstants.BIOMETRIC_ERROR_RE_ENROLL; import static android.hardware.biometrics.BiometricFaceConstants.BIOMETRIC_ERROR_SECURITY_UPDATE_REQUIRED; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_DARK_GLASSES_DETECTED; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_FACE_OBSCURED; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_GOOD; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_INSUFFICIENT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_MOUTH_COVERING_DETECTED; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_NOT_DETECTED; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_PAN_TOO_EXTREME; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_POOR_GAZE; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_RECALIBRATE; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_ROLL_TOO_EXTREME; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_SENSOR_DIRTY; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_START; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TILT_TOO_EXTREME; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_BRIGHT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_CLOSE; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_DARK; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_DIFFERENT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_FAR; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_HIGH; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_LEFT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_LOW; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_MUCH_MOTION; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_RIGHT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_TOO_SIMILAR; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_VENDOR; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_CANCELED; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_HW_NOT_PRESENT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_HW_UNAVAILABLE; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_LOCKOUT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_LOCKOUT_PERMANENT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_NOT_ENROLLED; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_NO_SPACE; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_TIMEOUT; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_UNABLE_TO_PROCESS; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_USER_CANCELED; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_VENDOR; import android.annotation.NonNull; import android.annotation.Nullable; Loading @@ -29,7 +67,6 @@ import android.content.Context; import android.content.pm.PackageManager; import android.hardware.biometrics.BiometricAuthenticator; import android.hardware.biometrics.BiometricConstants; import android.hardware.biometrics.BiometricFaceConstants; import android.hardware.biometrics.BiometricStateListener; import android.hardware.biometrics.CryptoObject; import android.hardware.biometrics.IBiometricServiceLockoutResetCallback; Loading Loading @@ -58,7 +95,7 @@ import java.util.List; * @hide */ @SystemService(Context.FACE_SERVICE) public class FaceManager implements BiometricAuthenticator, BiometricFaceConstants { public class FaceManager implements BiometricAuthenticator { private static final String TAG = "FaceManager"; Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +4 −2 Original line number Diff line number Diff line Loading @@ -30,6 +30,8 @@ import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_LOCKOUT_N import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_LOCKOUT_PERMANENT; import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_LOCKOUT_TIMED; import static android.hardware.biometrics.BiometricConstants.LockoutMode; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_HW_UNAVAILABLE; import static android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_LOCKOUT_PERMANENT; import static android.hardware.biometrics.BiometricSourceType.FACE; import static android.hardware.biometrics.BiometricSourceType.FINGERPRINT; import static android.os.BatteryManager.BATTERY_STATUS_UNKNOWN; Loading Loading @@ -1238,9 +1240,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab boolean cameraPrivacyEnabled = mSensorPrivacyManager.isSensorPrivacyEnabled( SensorPrivacyManager.TOGGLE_TYPE_SOFTWARE, SensorPrivacyManager.Sensors.CAMERA); final boolean isHwUnavailable = msgId == FaceManager.FACE_ERROR_HW_UNAVAILABLE; final boolean isHwUnavailable = msgId == FACE_ERROR_HW_UNAVAILABLE; if (msgId == FaceManager.FACE_ERROR_LOCKOUT_PERMANENT) { if (msgId == FACE_ERROR_LOCKOUT_PERMANENT) { if (getFaceAuthInteractor() != null && getFaceAuthInteractor().isFaceAuthStrong()) { updateFingerprintListeningState(BIOMETRIC_ACTION_STOP); } Loading
packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/FaceHelpMessageDeferralInteractor.kt +2 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.deviceentry.domain.interactor import android.hardware.biometrics.BiometricFaceConstants.FACE_ACQUIRED_START import android.hardware.face.FaceManager import com.android.systemui.biometrics.FaceHelpMessageDeferralFactory import com.android.systemui.dagger.SysUISingleton Loading Loading @@ -86,7 +87,7 @@ constructor( } } .collect { if (it.acquiredInfo == FaceManager.FACE_ACQUIRED_START) { if (it.acquiredInfo == FACE_ACQUIRED_START) { faceHelpMessageDeferral.reset() } faceHelpMessageDeferral.processFrame(it.acquiredInfo) Loading
packages/SystemUI/src/com/android/systemui/deviceentry/shared/model/FaceAuthenticationModels.kt +11 −7 Original line number Diff line number Diff line Loading @@ -16,6 +16,12 @@ package com.android.systemui.deviceentry.shared.model import android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_CANCELED import android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_HW_UNAVAILABLE import android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_LOCKOUT import android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_LOCKOUT_PERMANENT import android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_TIMEOUT import android.hardware.biometrics.BiometricFaceConstants.FACE_ERROR_UNABLE_TO_PROCESS import android.hardware.face.FaceManager import android.os.SystemClock.elapsedRealtime Loading Loading @@ -62,24 +68,22 @@ data class ErrorFaceAuthenticationStatus( * Method that checks if [msgId] is a lockout error. A lockout error means that face * authentication is locked out. */ fun isLockoutError() = msgId == FaceManager.FACE_ERROR_LOCKOUT_PERMANENT || msgId == FaceManager.FACE_ERROR_LOCKOUT fun isLockoutError() = msgId == FACE_ERROR_LOCKOUT_PERMANENT || msgId == FACE_ERROR_LOCKOUT /** * Method that checks if [msgId] is a cancellation error. This means that face authentication * was cancelled before it completed. */ fun isCancellationError() = msgId == FaceManager.FACE_ERROR_CANCELED fun isCancellationError() = msgId == FACE_ERROR_CANCELED fun isUnableToProcessError() = msgId == FaceManager.FACE_ERROR_UNABLE_TO_PROCESS fun isUnableToProcessError() = msgId == FACE_ERROR_UNABLE_TO_PROCESS /** Method that checks if [msgId] is a hardware error. */ fun isHardwareError() = msgId == FaceManager.FACE_ERROR_HW_UNAVAILABLE || msgId == FaceManager.FACE_ERROR_UNABLE_TO_PROCESS msgId == FACE_ERROR_HW_UNAVAILABLE || msgId == FACE_ERROR_UNABLE_TO_PROCESS /** Method that checks if [msgId] is a timeout error. */ fun isTimeoutError() = msgId == FaceManager.FACE_ERROR_TIMEOUT fun isTimeoutError() = msgId == FACE_ERROR_TIMEOUT companion object { /** Loading