Fix regression from ag/22534576

Gate changes from ag/22534576 on isSfps check until BiometricPrompt
refactor into View-ViewBinder-ViewModel structure is complete for
non-sfps logic

Test: Ensure correct icon is displayed in BP on non-sfps device
Fixes: 280494848
Change-Id: I3d2d1434e7090153ff938ed3553d6766436e1814
This commit is contained in:
Grace Cheng
2023-05-03 21:36:01 +00:00
parent d3446e4eb8
commit 12241c35be
2 changed files with 8 additions and 1 deletions

View File

@@ -31,6 +31,10 @@ open class AuthBiometricFingerprintView(
context: Context,
attrs: AttributeSet? = null
) : AuthBiometricView(context, attrs) {
/** If this view is for a SFPS sensor. */
var isSfps = false
private set
/** If this view is for a UDFPS sensor. */
var isUdfps = false
private set
@@ -40,6 +44,7 @@ open class AuthBiometricFingerprintView(
/** Set the [sensorProps] of this sensor so the view can be customized prior to layout. */
fun setSensorProperties(sensorProps: FingerprintSensorPropertiesInternal) {
isSfps = sensorProps.isAnySidefpsType
isUdfps = sensorProps.isAnyUdfpsType
udfpsAdapter = if (isUdfps) UdfpsDialogMeasureAdapter(this, sensorProps) else null
}

View File

@@ -36,7 +36,9 @@ object AuthBiometricFingerprintViewBinder {
viewModel.setRotation(view.context.display?.orientation ?: Surface.ROTATION_0)
launch {
viewModel.iconAsset.collect { iconAsset ->
view.updateIconViewAnimation(iconAsset)
if (view.isSfps) {
view.updateIconViewAnimation(iconAsset)
}
}
}
}