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

Commit 2502168e authored by Grace Cheng's avatar Grace Cheng
Browse files

Remove circular dependency on FingerprintPropertyInteractor

Flag: EXEMPT BUGFIX
Bug: 443057722
Test: N/A
Change-Id: Ieef60d71656e77750d605fbb55011546ba096029
parent 70f9dce9
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -47,7 +47,6 @@ constructor(
    private val repository: FingerprintPropertyRepository,
    @Main private val configurationInteractor: ConfigurationInteractor,
    displayStateInteractor: DisplayStateInteractor,
    udfpsOverlayInteractor: UdfpsOverlayInteractor,
) {
    val propertiesInitialized: Flow<Boolean> = repository.propertiesInitialized
    val isUdfps: StateFlow<Boolean> =
@@ -118,15 +117,6 @@ constructor(
            )
        }

    /**
     * Sensor location for the:
     * - current physical display
     * - current screen resolution
     * - device's current orientation
     */
    val udfpsSensorBounds: Flow<Rect> =
        udfpsOverlayInteractor.udfpsOverlayParams.map { it.sensorBounds }.distinctUntilChanged()

    companion object {

        private const val EMPTY_DISPLAY_ID = ""
+12 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.keyguard.ui.viewmodel

import android.content.Context
import android.graphics.Rect
import com.android.settingslib.Utils
import com.android.systemui.accessibility.domain.interactor.AccessibilityInteractor
import com.android.systemui.biometrics.domain.interactor.FingerprintPropertyInteractor
@@ -31,6 +32,7 @@ import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager
import javax.inject.Inject
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.emptyFlow
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.flowOf
@@ -45,7 +47,6 @@ constructor(
    @ShadeDisplayAware configurationInteractor: ConfigurationInteractor,
    deviceEntryUdfpsInteractor: DeviceEntryUdfpsInteractor,
    deviceEntryBackgroundViewModel: DeviceEntryBackgroundViewModel,
    fingerprintPropertyInteractor: FingerprintPropertyInteractor,
    udfpsOverlayInteractor: UdfpsOverlayInteractor,
    alternateBouncerViewModel: AlternateBouncerViewModel,
    private val statusBarKeyguardViewManager: StatusBarKeyguardViewManager,
@@ -58,6 +59,15 @@ constructor(
            clamp(it * 2f, 0f, 1f)
        }

    /**
     * Sensor location for the:
     * - current physical display
     * - current screen resolution
     * - device's current orientation
     */
    val udfpsSensorBounds: Flow<Rect> =
        udfpsOverlayInteractor.udfpsOverlayParams.map { it.sensorBounds }.distinctUntilChanged()

    /**
     * UDFPS icon location in pixels for the current display and screen resolution, in natural
     * orientation.
@@ -65,7 +75,7 @@ constructor(
    val iconLocation: Flow<IconLocation> =
        isSupported.flatMapLatest { supportsUI ->
            if (supportsUI) {
                fingerprintPropertyInteractor.udfpsSensorBounds.map { bounds ->
                udfpsSensorBounds.map { bounds ->
                    IconLocation(
                        left = bounds.left,
                        top = bounds.top,
+0 −1
Original line number Diff line number Diff line
@@ -31,6 +31,5 @@ val Kosmos.fingerprintPropertyInteractor by Fixture {
        repository = fingerprintPropertyRepository,
        configurationInteractor = configurationInteractor,
        displayStateInteractor = displayStateInteractor,
        udfpsOverlayInteractor = udfpsOverlayInteractor,
    )
}
+0 −1
Original line number Diff line number Diff line
@@ -75,7 +75,6 @@ private val Kosmos.alternateBouncerUdfpsIconViewModel by
            configurationInteractor = configurationInteractor,
            deviceEntryUdfpsInteractor = deviceEntryUdfpsInteractor,
            deviceEntryBackgroundViewModel = mock<DeviceEntryBackgroundViewModel>(),
            fingerprintPropertyInteractor = fingerprintPropertyInteractor,
            udfpsOverlayInteractor = udfpsOverlayInteractor,
            alternateBouncerViewModel = alternateBouncerViewModel,
            statusBarKeyguardViewManager = statusBarKeyguardViewManager,