Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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
        }

+8 −8
Original line number Diff line number Diff line
@@ -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
+3 −2
Original line number Diff line number Diff line
@@ -147,7 +147,8 @@ constructor(
                deviceEntryIconViewModel.get().udfpsLocation.value?.let { udfpsLocation ->
                    Log.d(
                        "DeviceEntrySection",
                        "udfpsLocation=$udfpsLocation" +
                        "udfpsLocation=$udfpsLocation, " +
                            "scaledLocation=(${udfpsLocation.centerX},${udfpsLocation.centerY}), " +
                            "unusedAuthController=${authController.udfpsLocation}"
                    )
                    centerIcon(