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

Commit 77869c4f authored by Austin Delgado's avatar Austin Delgado Committed by Android (Google) Code Review
Browse files

Merge "Fix BiometricPrompt credential view rotation" into main

parents df5017f1 79d5c75d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.content.Context;
import android.graphics.PixelFormat;
import android.hardware.biometrics.BiometricAuthenticator.Modality;
import android.hardware.biometrics.BiometricConstants;
import android.hardware.biometrics.BiometricManager.Authenticators;
import android.hardware.biometrics.PromptInfo;
import android.hardware.face.FaceSensorPropertiesInternal;
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
@@ -168,7 +169,7 @@ public class AuthContainerView extends LinearLayout
    // HAT received from LockSettingsService when credential is verified.
    @Nullable private byte[] mCredentialAttestation;

    // TODO(b/287311775): remove when legacy prompt is replaced
    // TODO(b/313469218): remove when legacy prompt is replaced
    @Deprecated
    static class Config {
        Context mContext;
@@ -220,6 +221,9 @@ public class AuthContainerView extends LinearLayout
            mHandler.postDelayed(() -> {
                addCredentialView(false /* animatePanel */, true /* animateContents */);
            }, mConfig.mSkipAnimation ? 0 : ANIMATE_CREDENTIAL_START_DELAY_MS);

            // TODO(b/313469218): Remove Config
            mConfig.mPromptInfo.setAuthenticators(Authenticators.DEVICE_CREDENTIAL);
        }

        @Override
+7 −0
Original line number Diff line number Diff line
@@ -338,6 +338,13 @@ open class AuthContainerViewTest : SysuiTestCase() {
        waitForIdleSync()

        assertThat(container.hasCredentialView()).isTrue()
        assertThat(container.hasBiometricPrompt()).isFalse()

        // Check credential view persists after new attachment
        container.onAttachedToWindow()

        assertThat(container.hasCredentialView()).isTrue()
        assertThat(container.hasBiometricPrompt()).isFalse()
    }

    @Test