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

Commit c4987ec4 authored by Chandru S's avatar Chandru S Committed by Android (Google) Code Review
Browse files

Merge "Remove additional padding that was needed before when the sensor length...

Merge "Remove additional padding that was needed before when the sensor length from HAL didn't match power button" into main
parents 8458c512 7c35de05
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -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 -->
+4 −11
Original line number Diff line number Diff line
@@ -67,8 +67,8 @@ class SideFpsProgressBarViewModel
@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 @@ constructor(
        _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 @@ constructor(
    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 @@ constructor(
                    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 @@ constructor(
                    // 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 @@ constructor(
                        // 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