diff options
| author | 2024-01-24 04:29:30 +0000 | |
|---|---|---|
| committer | 2024-01-24 04:30:11 +0000 | |
| commit | a35c0abd62493b84c71cdcc04f12c4b91e7fee2f (patch) | |
| tree | 68439a924504beae9f8f9d246ae72f15ddd126b0 | |
| parent | d1693d79ca68de8a75d1c550b37212cd33299dbf (diff) | |
Flag showing logo on bp
Test: Manually test on test app
Test: atest PromptViewModelTest
Flag: ACONFIG android.hardware.biometrics.custom_biometric_prompt DEVELOPMENT
Bug: 321852561
Change-Id: Id64b5b8af6411a22c7ebf460a3c426923bca133f
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) } |