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

Commit d99d6c68 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Change var to val in SensorLocation object" into main

parents db2b5f08 b0adeb4f
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -98,11 +98,11 @@ constructor(
        ) { unscaledSensorLocation, scale ->
        ) { unscaledSensorLocation, scale ->
            val sensorLocation =
            val sensorLocation =
                SensorLocation(
                SensorLocation(
                    unscaledSensorLocation.sensorLocationX,
                    naturalCenterX = unscaledSensorLocation.sensorLocationX,
                    unscaledSensorLocation.sensorLocationY,
                    naturalCenterY = unscaledSensorLocation.sensorLocationY,
                    unscaledSensorLocation.sensorRadius,
                    naturalRadius = unscaledSensorLocation.sensorRadius,
                    scale = scale
                )
                )
            sensorLocation.scale = scale
            sensorLocation
            sensorLocation
        }
        }


+8 −8
Original line number Original line Diff line number Diff line
@@ -16,18 +16,18 @@


package com.android.systemui.biometrics.shared.model
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(
data class SensorLocation(
    private val naturalCenterX: Int,
    private val naturalCenterX: Int,
    private val naturalCenterY: 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
    val centerX: Float
        get() {
        get() {
            return naturalCenterX * scale
            return naturalCenterX * scale
+3 −2
Original line number Original line Diff line number Diff line
@@ -147,7 +147,8 @@ constructor(
                deviceEntryIconViewModel.get().udfpsLocation.value?.let { udfpsLocation ->
                deviceEntryIconViewModel.get().udfpsLocation.value?.let { udfpsLocation ->
                    Log.d(
                    Log.d(
                        "DeviceEntrySection",
                        "DeviceEntrySection",
                        "udfpsLocation=$udfpsLocation" +
                        "udfpsLocation=$udfpsLocation, " +
                            "scaledLocation=(${udfpsLocation.centerX},${udfpsLocation.centerY}), " +
                            "unusedAuthController=${authController.udfpsLocation}"
                            "unusedAuthController=${authController.udfpsLocation}"
                    )
                    )
                    centerIcon(
                    centerIcon(