diff options
| author | 2023-11-21 11:54:24 -0800 | |
|---|---|---|
| committer | 2023-11-27 11:14:03 -0800 | |
| commit | 79d5c75d1bed7896d3fe17809dedbb5a3797ea1a (patch) | |
| tree | d5d024c9da8ab543618e9d2f089bcfc7decb4b3c | |
| parent | 7d859fde142d03a82b6cc8ff0585cee08e8b7166 (diff) | |
Fix BiometricPrompt credential view rotation
Fixes: 310527539
Test: atest SystemUITests:com.android.systemui.biometrics
Flag: None
Change-Id: I77d758072a1c7478ad95c18ce923a6ed771dce13
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java | 6 | ||||
| -rw-r--r-- | packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthContainerViewTest.kt | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java b/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java index 1ac4163649a4..ab23564a1df4 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java @@ -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 diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthContainerViewTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthContainerViewTest.kt index f4122d59cea1..ea20d29556dc 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthContainerViewTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/AuthContainerViewTest.kt @@ -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 |