Merge "Remove additional padding that was needed before when the sensor length from HAL didn't match power button" into main
diff --git a/packages/SystemUI/res-keyguard/values/dimens.xml b/packages/SystemUI/res-keyguard/values/dimens.xml
index e853f02..4e540de 100644
--- a/packages/SystemUI/res-keyguard/values/dimens.xml
+++ b/packages/SystemUI/res-keyguard/values/dimens.xml
@@ -169,9 +169,6 @@
<dimen name="weather_clock_smartspace_translateX">0dp</dimen>
<dimen name="weather_clock_smartspace_translateY">0dp</dimen>
- <!-- Additional length to add to the SFPS sensor length we get from framework so that the length
- of the progress bar matches the length of the power button -->
- <dimen name="sfps_progress_bar_length_extra_padding">12dp</dimen>
<!-- Thickness of the progress bar we show for the SFPS based authentication. -->
<dimen name="sfps_progress_bar_thickness">6dp</dimen>
<!-- Padding from the edge of the screen for the progress bar -->
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/SideFpsProgressBarViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/SideFpsProgressBarViewModel.kt
index 67c42f0..00e5d35 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/SideFpsProgressBarViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/SideFpsProgressBarViewModel.kt
@@ -67,8 +67,8 @@
@Inject
constructor(
private val context: Context,
- private val biometricStatusInteractor: BiometricStatusInteractor,
- private val deviceEntryFingerprintAuthInteractor: DeviceEntryFingerprintAuthInteractor,
+ biometricStatusInteractor: BiometricStatusInteractor,
+ deviceEntryFingerprintAuthInteractor: DeviceEntryFingerprintAuthInteractor,
private val sfpsSensorInteractor: SideFpsSensorInteractor,
// todo (b/317432075) Injecting DozeServiceHost directly instead of using it through
// DozeInteractor as DozeServiceHost already depends on DozeInteractor.
@@ -89,9 +89,6 @@
_progress.value = 0.0f
}
- private val additionalSensorLengthPadding =
- context.resources.getDimension(R.dimen.sfps_progress_bar_length_extra_padding).toInt()
-
// Merged [FingerprintAuthenticationStatus] from BiometricPrompt acquired messages and
// device entry authentication messages
private val mergedFingerprintAuthenticationStatus =
@@ -114,9 +111,7 @@
val progress: Flow<Float> = _progress.asStateFlow()
val progressBarLength: Flow<Int> =
- sfpsSensorInteractor.sensorLocation
- .map { it.length + additionalSensorLengthPadding }
- .distinctUntilChanged()
+ sfpsSensorInteractor.sensorLocation.map { it.length }.distinctUntilChanged()
val progressBarThickness =
context.resources.getDimension(R.dimen.sfps_progress_bar_thickness).toInt()
@@ -128,7 +123,6 @@
context.resources
.getDimension(R.dimen.sfps_progress_bar_padding_from_edge)
.toInt()
- val lengthOfTheProgressBar = sensorLocation.length + additionalSensorLengthPadding
val viewLeftTop = Point(sensorLocation.left, sensorLocation.top)
val totalDistanceFromTheEdge = paddingFromEdge + progressBarThickness
@@ -139,7 +133,7 @@
// Sensor is vertical to the current orientation, we rotate it 270 deg
// around the (left,top) point as the pivot. We need to push it down the
// length of the progress bar so that it is still aligned to the sensor
- viewLeftTop.y += lengthOfTheProgressBar
+ viewLeftTop.y += sensorLocation.length
val isSensorOnTheNearEdge =
rotation == DisplayRotation.ROTATION_180 ||
rotation == DisplayRotation.ROTATION_90
@@ -164,7 +158,6 @@
// We want to push it up from the bottom edge by the padding and
// the thickness of the progressbar.
viewLeftTop.y -= totalDistanceFromTheEdge
- viewLeftTop.x -= additionalSensorLengthPadding
}
}
viewLeftTop