Java Code Examples for android.hardware.fingerprint.FingerprintManager#FINGERPRINT_ERROR_HW_UNAVAILABLE
The following examples show how to use
android.hardware.fingerprint.FingerprintManager#FINGERPRINT_ERROR_HW_UNAVAILABLE .
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 |
@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 |
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: FingerprintService.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
protected void handleError(long deviceId, int error, int vendorCode) { ClientMonitor client = mCurrentClient; if (client instanceof InternalRemovalClient || client instanceof InternalEnumerateClient) { clearEnumerateState(); } if (client != null && client.onError(error, vendorCode)) { removeClient(client); } if (DEBUG) Slog.v(TAG, "handleError(client=" + (client != null ? client.getOwnerString() : "null") + ", error = " + error + ")"); // This is the magic code that starts the next client when the old client finishes. if (error == FingerprintManager.FINGERPRINT_ERROR_CANCELED) { mHandler.removeCallbacks(mResetClientState); if (mPendingClient != null) { if (DEBUG) Slog.v(TAG, "start pending client " + mPendingClient.getOwnerString()); startClient(mPendingClient, false); mPendingClient = null; } } else if (error == FingerprintManager.FINGERPRINT_ERROR_HW_UNAVAILABLE) { // If we get HW_UNAVAILABLE, try to connect again later... Slog.w(TAG, "Got ERROR_HW_UNAVAILABLE; try reconnecting next client."); synchronized (this) { mDaemon = null; mHalDeviceId = 0; mCurrentUserId = UserHandle.USER_NULL; } } }
Example 4
Source File: FingerprintLauncher.java From GravityBox with Apache License 2.0 | 5 votes |
@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(); } }
Example 5
Source File: FingerprintDialogCompatV23.java From FingerprintDialogCompat with Apache License 2.0 | 4 votes |
/** * Start the finger print authentication by enabling the finger print sensor. * Note: Use this function in the onResume() of the activity/fragment. Never forget to call * {@link #stopAuthIfRunning()} in onPause() of the activity/fragment. */ @TargetApi(Build.VERSION_CODES.M) private void startAuth() { if (isScanning) stopAuthIfRunning(); final FingerprintManager fingerprintManager = (FingerprintManager) mContext.getSystemService(Context.FINGERPRINT_SERVICE); //Cannot access the fingerprint manager. if (fingerprintManager == null) { mCallback.fingerprintAuthenticationNotSupported(); return; } //No fingerprint enrolled. if (!fingerprintManager.hasEnrolledFingerprints()) { mCallback.hasNoFingerprintEnrolled(); return; } final FingerprintManager.CryptoObject cryptoObject = getCryptoObject(); if (cryptoObject != null) { final FingerprintManager.AuthenticationCallback authCallback = new FingerprintManager.AuthenticationCallback() { @Override public void onAuthenticationError(int errMsgId, CharSequence errString) { displayStatusText(errString.toString(), true); switch (errMsgId) { case FingerprintManager.FINGERPRINT_ERROR_CANCELED: case FingerprintManager.FINGERPRINT_ERROR_USER_CANCELED: mCallback.authenticationCanceledByUser(); break; case FingerprintManager.FINGERPRINT_ERROR_HW_NOT_PRESENT: case FingerprintManager.FINGERPRINT_ERROR_HW_UNAVAILABLE: mCallback.fingerprintAuthenticationNotSupported(); break; default: mCallback.onAuthenticationError(errMsgId, errString); } } @Override public void onAuthenticationHelp(int helpMsgId, CharSequence helpString) { displayStatusText(helpString.toString(), false); mCallback.onAuthenticationHelp(helpMsgId, helpString); } @Override public void onAuthenticationFailed() { displayStatusText(getString(R.string.fingerprint_not_recognised), false); mCallback.onAuthenticationFailed(); } @Override public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) { mCallback.onAuthenticationSucceeded(); closeDialog(); } }; mCancellationSignal = new CancellationSignal(); //noinspection MissingPermission fingerprintManager.authenticate(cryptoObject, mCancellationSignal, 0, authCallback, new Handler(Looper.getMainLooper())); } else { //Cannot access the secure keystore. mCallback.fingerprintAuthenticationNotSupported(); closeDialog(); } }