Skip to content
Snippets Groups Projects
Commit b0adeb4f authored by Chandru S's avatar Chandru S
Browse files

Change var to val in SensorLocation object

Fixes: 342956711
Test: manually, enroll fingerprint on a device with UDFPS
    1. Change resolution
    2. Go to lockscreen
    3. Verify the size and location of the fingerprint icon
Flag: com.android.systemui.device_entry_udfps_refactor
Change-Id: I0ec6b267b02fb5101299f3628275ec579133502e
parent ff4ec7ef
No related branches found
No related tags found
No related merge requests found
......@@ -98,11 +98,11 @@ constructor(
) { unscaledSensorLocation, scale ->
val sensorLocation =
SensorLocation(
unscaledSensorLocation.sensorLocationX,
unscaledSensorLocation.sensorLocationY,
unscaledSensorLocation.sensorRadius,
naturalCenterX = unscaledSensorLocation.sensorLocationX,
naturalCenterY = unscaledSensorLocation.sensorLocationY,
naturalRadius = unscaledSensorLocation.sensorRadius,
scale = scale
)
sensorLocation.scale = scale
sensorLocation
}
......
......@@ -16,18 +16,18 @@
package com.android.systemui.biometrics.shared.model
/** Provides current sensor location information in the current screen resolution [scale]. */
/**
* Provides current sensor location information in the current screen resolution [scale].
*
* @property scale Scale to apply to the sensor location's natural parameters to support different
* screen resolutions.
*/
data class SensorLocation(
private val naturalCenterX: Int,
private val naturalCenterY: Int,
private val naturalRadius: Int
private val naturalRadius: Int,
private val scale: Float = 1f
) {
/**
* Scale to apply to the sensor location's natural parameters to support different screen
* resolutions.
*/
var scale: Float = 1f
val centerX: Float
get() {
return naturalCenterX * scale
......
......@@ -147,8 +147,9 @@ constructor(
deviceEntryIconViewModel.get().udfpsLocation.value?.let { udfpsLocation ->
Log.d(
"DeviceEntrySection",
"udfpsLocation=$udfpsLocation" +
" unusedAuthController=${authController.udfpsLocation}"
"udfpsLocation=$udfpsLocation, " +
"scaledLocation=(${udfpsLocation.centerX},${udfpsLocation.centerY}), " +
"unusedAuthController=${authController.udfpsLocation}"
)
centerIcon(
Point(udfpsLocation.centerX.toInt(), udfpsLocation.centerY.toInt()),
......
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