Skip to content
Snippets Groups Projects
Commit b57ecafb authored by lbill's avatar lbill
Browse files

Fix NPE crash when BP fallback to credentialUI and rotate

Flag: NONE

Bug: 287480279
Fixes: 342184246
Test: atest AuthContainerViewTest
Test: manual show BP on SFPS project and make sure the BP location
meet requirement

Change-Id: Id548e5b6db5fa28407b9a5d6a247a59ccef1bf1f
parent 48cc3a84
No related branches found
No related tags found
No related merge requests found
......@@ -629,7 +629,7 @@ public class AuthContainerView extends LinearLayout
if (fpProp != null && fpProp.isAnyUdfpsType()) {
maybeUpdatePositionForUdfps(forceInvalidate /* invalidate */);
}
if (faceProp != null && mBiometricView.isFaceOnly()) {
if (faceProp != null && mBiometricView != null && mBiometricView.isFaceOnly()) {
alwaysUpdatePositionAtScreenBottom(forceInvalidate /* invalidate */);
}
if (fpProp != null && fpProp.sensorType == TYPE_POWER_BUTTON) {
......
......@@ -18,6 +18,7 @@ package com.android.systemui.biometrics
import android.app.ActivityTaskManager
import android.app.admin.DevicePolicyManager
import android.content.pm.PackageManager
import android.content.res.Configuration
import android.hardware.biometrics.BiometricAuthenticator
import android.hardware.biometrics.BiometricConstants
import android.hardware.biometrics.BiometricManager
......@@ -383,6 +384,33 @@ open class AuthContainerViewTest : SysuiTestCase() {
assertThat(container.hasBiometricPrompt()).isFalse()
}
@Test
fun testAnimateToCredentialUI_rotateCredentialUI() {
val container = initializeFingerprintContainer(
authenticators = BiometricManager.Authenticators.BIOMETRIC_WEAK or
BiometricManager.Authenticators.DEVICE_CREDENTIAL
)
container.animateToCredentialUI(false)
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()
val configuration = Configuration(context.resources.configuration)
configuration.orientation = Configuration.ORIENTATION_LANDSCAPE
container.dispatchConfigurationChanged(configuration)
waitForIdleSync()
assertThat(container.hasCredentialView()).isTrue()
assertThat(container.hasBiometricPrompt()).isFalse()
}
@Test
fun testShowBiometricUI() {
val container = initializeFingerprintContainer()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment