diff options
2 files changed, 6 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModel.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModel.kt index dca0338dc8e7..e78a7a942993 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModel.kt @@ -21,6 +21,7 @@ import android.graphics.Rect import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.Drawable import android.hardware.biometrics.BiometricPrompt +import android.hardware.biometrics.Flags.customBiometricPrompt import android.hardware.biometrics.PromptContentView import android.util.Log import android.view.HapticFeedbackConstants @@ -240,7 +241,7 @@ constructor( promptSelectorInteractor.prompt .map { when { - it == null -> null + !customBiometricPrompt() || it == null -> null it.logoRes != -1 -> context.resources.getDrawable(it.logoRes, context.theme) it.logoBitmap != null -> BitmapDrawable(context.resources, it.logoBitmap) else -> context.packageManager.getApplicationIcon(it.opPackageName) diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt index 3888f2b940b3..8127bb1f0465 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt @@ -21,6 +21,7 @@ import android.content.res.Configuration import android.graphics.Bitmap import android.graphics.Point import android.graphics.drawable.BitmapDrawable +import android.hardware.biometrics.Flags.FLAG_CUSTOM_BIOMETRIC_PROMPT import android.hardware.biometrics.PromptContentItemBulletedText import android.hardware.biometrics.PromptContentView import android.hardware.biometrics.PromptInfo @@ -1244,6 +1245,7 @@ internal class PromptViewModelTest(private val testCase: TestCase) : SysuiTestCa @Test fun defaultLogoIfNoLogoSet() = runGenericTest { + mSetFlagsRule.enableFlags(FLAG_CUSTOM_BIOMETRIC_PROMPT) val logo by collectLastValue(viewModel.logo) assertThat(logo).isEqualTo(defaultLogoIcon) } @@ -1251,6 +1253,7 @@ internal class PromptViewModelTest(private val testCase: TestCase) : SysuiTestCa @Test fun logoResSetByApp() = runGenericTest(logoRes = logoResFromApp) { + mSetFlagsRule.enableFlags(FLAG_CUSTOM_BIOMETRIC_PROMPT) val logo by collectLastValue(viewModel.logo) assertThat(logo).isEqualTo(logoFromApp) } @@ -1258,6 +1261,7 @@ internal class PromptViewModelTest(private val testCase: TestCase) : SysuiTestCa @Test fun logoBitmapSetByApp() = runGenericTest(logoBitmap = logoBitmapFromApp) { + mSetFlagsRule.enableFlags(FLAG_CUSTOM_BIOMETRIC_PROMPT) val logo by collectLastValue(viewModel.logo) assertThat((logo as BitmapDrawable).bitmap).isEqualTo(logoBitmapFromApp) } |