Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aab56413 authored by Kevin Chyn's avatar Kevin Chyn Committed by Android (Google) Code Review
Browse files

Merge "Check for hardware before authenticating"

parents 21e8a2ff 9c98582d
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -616,8 +616,15 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan
            mExecutor = executor;
            mAuthenticationCallback = callback;
            final long sessionId = crypto != null ? crypto.getOpId() : 0;
            if (BiometricManager.hasBiometrics(mContext)) {
                mService.authenticate(mToken, sessionId, userId, mBiometricServiceReceiver,
                        mContext.getOpPackageName(), mBundle);
            } else {
                mExecutor.execute(() -> {
                    callback.onAuthenticationError(BiometricPrompt.BIOMETRIC_ERROR_HW_NOT_PRESENT,
                            mContext.getString(R.string.biometric_error_hw_unavailable));
                });
            }
        } catch (RemoteException e) {
            Log.e(TAG, "Remote exception while authenticating", e);
            mExecutor.execute(() -> {