Java Code Examples for android.hardware.fingerprint.FingerprintManager#FINGERPRINT_ERROR_LOCKOUT

The following examples show how to use android.hardware.fingerprint.FingerprintManager#FINGERPRINT_ERROR_LOCKOUT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AndroidSecurityBridge.java    From CrossMobile with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void onAuthenticationError(int errorCode, CharSequence errString) {
    System.out.println("Error " + errorCode + " : " + errString);
    NSError error;
    switch (errorCode) {
        case FingerprintManager.FINGERPRINT_ERROR_HW_UNAVAILABLE:
            error = new NSError(LAErrorDomain, LAError.TouchIDNotAvailable, getUserInfo(errString.toString()));
            break;
        case FingerprintManager.FINGERPRINT_ERROR_UNABLE_TO_PROCESS:
            error = new NSError(LAErrorDomain, LAError.AuthenticationFailed, getUserInfo(errString.toString()));
            break;
        case FingerprintManager.FINGERPRINT_ERROR_TIMEOUT:
            error = new NSError(LAErrorDomain, LAError.SystemCancel, getUserInfo(errString.toString()));
            break;
        case FingerprintManager.FINGERPRINT_ERROR_CANCELED:
            error = new NSError(LAErrorDomain, LAError.SystemCancel, getUserInfo(errString.toString()));
            break;
        case FingerprintManager.FINGERPRINT_ERROR_LOCKOUT:
            error = new NSError(LAErrorDomain, LAError.TouchIDLockout, getUserInfo(errString.toString()));
    }
}
 
Example 2
Source File: MainActivity.java    From AndroidFingerPrintDemo with Apache License 2.0 6 votes vote down vote up
private void handleErrorCode(int code) {
    switch (code) {
        case FingerprintManager.FINGERPRINT_ERROR_CANCELED:
            setResultInfo(R.string.ErrorCanceled_warning);
            break;
        case FingerprintManager.FINGERPRINT_ERROR_HW_UNAVAILABLE:
            setResultInfo(R.string.ErrorHwUnavailable_warning);
            break;
        case FingerprintManager.FINGERPRINT_ERROR_LOCKOUT:
            setResultInfo(R.string.ErrorLockout_warning);
            break;
        case FingerprintManager.FINGERPRINT_ERROR_NO_SPACE:
            setResultInfo(R.string.ErrorNoSpace_warning);
            break;
        case FingerprintManager.FINGERPRINT_ERROR_TIMEOUT:
            setResultInfo(R.string.ErrorTimeout_warning);
            break;
        case FingerprintManager.FINGERPRINT_ERROR_UNABLE_TO_PROCESS:
            setResultInfo(R.string.ErrorUnableToProcess_warning);
            break;
    }
}
 
Example 3
Source File: FingerprintLauncher.java    From GravityBox with Apache License 2.0 5 votes vote down vote up
@Override
public void onAuthenticationError(int errMsgId, CharSequence errString) {
    if (DEBUG) log("onAuthenticationError: " + errMsgId + " - " + errString);

    if (mIsPaused)
        return;

    switch (errMsgId) {
        case FingerprintManager.FINGERPRINT_ERROR_HW_UNAVAILABLE:
        case FingerprintManager.FINGERPRINT_ERROR_CANCELED:
            if (mShowToast) {
                Toast.makeText(mContext, String.format("%s\n%s",
                    TAG, mGbContext.getString(R.string.fingerprint_sensor_unavail)),
                    Toast.LENGTH_SHORT).show();
            }
            restartListeningDelayed(10000);
            break;
        case FingerprintManager.FINGERPRINT_ERROR_UNABLE_TO_PROCESS:
            restartListeningDelayed(3000);
            break;
        case FingerprintManager.FINGERPRINT_ERROR_TIMEOUT:
            restartListeningDelayed(2000);
            break;
        case FingerprintManager.FINGERPRINT_ERROR_LOCKOUT:
            restartListeningDelayed(35000);
            Toast.makeText(mContext, String.format("%s\n%s",
                    TAG, mGbContext.getString(R.string.fingerprint_sensor_locked)),
                    Toast.LENGTH_LONG).show();
    }
}