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

Commit e9d52e36 authored by Curtis Belmonte's avatar Curtis Belmonte
Browse files

Stop AuthContainerView from crashing with 2 sensors

Fixes an issue with BiometricPrompt crashing on devices with two sensors
(e.g. face and fingerprint) by using whichever prompt UI corresponds to
the first sensor in the list. Later commits will improve on this UI to
indicate when the actual authentication modality changes.

Test: Manually tested; verified the prompt no longer crashes.

Fixes: 173540555
Change-Id: I2add151fe336e53929a2f8167213b773d1fd48d4
parent baae6129
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -281,7 +281,7 @@ public class AuthContainerView extends LinearLayout

        // Inflate biometric view only if necessary.
        if (Utils.isBiometricAllowed(mConfig.mPromptInfo)) {
            if (config.mSensorIds.length == 1) {
            if (config.mSensorIds.length == 1 || config.mSensorIds.length == 2) {
                final int singleSensorAuthId = config.mSensorIds[0];
                if (Utils.containsSensorId(mFpProps, singleSensorAuthId)) {
                    FingerprintSensorPropertiesInternal sensorProps = null;
@@ -313,7 +313,6 @@ public class AuthContainerView extends LinearLayout
                    return;
                }
            } else {
                // The UI currently only supports authentication with a single sensor.
                Log.e(TAG, "Unsupported sensor array, length: " + config.mSensorIds.length);
                mBiometricView = null;
                mBackgroundView = null;