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

Commit 79d5c75d authored by Austin Delgado's avatar Austin Delgado
Browse files

Fix BiometricPrompt credential view rotation

Fixes: 310527539
Test: atest SystemUITests:com.android.systemui.biometrics
Flag: None
Change-Id: I77d758072a1c7478ad95c18ce923a6ed771dce13
parent 7d859fde
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