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

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

Merge "Remove circular dependency on FingerprintPropertyInteractor" into main

parents d40808e7 2502168e
Loading
Loading
Loading
Loading
+0 −10
Original line number Original line Diff line number Diff line
@@ -47,7 +47,6 @@ constructor(
    private val repository: FingerprintPropertyRepository,
    private val repository: FingerprintPropertyRepository,
    @Main private val configurationInteractor: ConfigurationInteractor,
    @Main private val configurationInteractor: ConfigurationInteractor,
    displayStateInteractor: DisplayStateInteractor,
    displayStateInteractor: DisplayStateInteractor,
    udfpsOverlayInteractor: UdfpsOverlayInteractor,
) {
) {
    val propertiesInitialized: Flow<Boolean> = repository.propertiesInitialized
    val propertiesInitialized: Flow<Boolean> = repository.propertiesInitialized
    val isUdfps: StateFlow<Boolean> =
    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 {
    companion object {


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


import android.content.Context
import android.content.Context
import android.graphics.Rect
import com.android.settingslib.Utils
import com.android.settingslib.Utils
import com.android.systemui.accessibility.domain.interactor.AccessibilityInteractor
import com.android.systemui.accessibility.domain.interactor.AccessibilityInteractor
import com.android.systemui.biometrics.domain.interactor.FingerprintPropertyInteractor
import com.android.systemui.biometrics.domain.interactor.FingerprintPropertyInteractor
@@ -31,6 +32,7 @@ import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager
import javax.inject.Inject
import javax.inject.Inject
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.emptyFlow
import kotlinx.coroutines.flow.emptyFlow
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.flowOf
@@ -45,7 +47,6 @@ constructor(
    @ShadeDisplayAware configurationInteractor: ConfigurationInteractor,
    @ShadeDisplayAware configurationInteractor: ConfigurationInteractor,
    deviceEntryUdfpsInteractor: DeviceEntryUdfpsInteractor,
    deviceEntryUdfpsInteractor: DeviceEntryUdfpsInteractor,
    deviceEntryBackgroundViewModel: DeviceEntryBackgroundViewModel,
    deviceEntryBackgroundViewModel: DeviceEntryBackgroundViewModel,
    fingerprintPropertyInteractor: FingerprintPropertyInteractor,
    udfpsOverlayInteractor: UdfpsOverlayInteractor,
    udfpsOverlayInteractor: UdfpsOverlayInteractor,
    alternateBouncerViewModel: AlternateBouncerViewModel,
    alternateBouncerViewModel: AlternateBouncerViewModel,
    private val statusBarKeyguardViewManager: StatusBarKeyguardViewManager,
    private val statusBarKeyguardViewManager: StatusBarKeyguardViewManager,
@@ -58,6 +59,15 @@ constructor(
            clamp(it * 2f, 0f, 1f)
            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
     * UDFPS icon location in pixels for the current display and screen resolution, in natural
     * orientation.
     * orientation.
@@ -65,7 +75,7 @@ constructor(
    val iconLocation: Flow<IconLocation> =
    val iconLocation: Flow<IconLocation> =
        isSupported.flatMapLatest { supportsUI ->
        isSupported.flatMapLatest { supportsUI ->
            if (supportsUI) {
            if (supportsUI) {
                fingerprintPropertyInteractor.udfpsSensorBounds.map { bounds ->
                udfpsSensorBounds.map { bounds ->
                    IconLocation(
                    IconLocation(
                        left = bounds.left,
                        left = bounds.left,
                        top = bounds.top,
                        top = bounds.top,
+0 −1
Original line number Original line Diff line number Diff line
@@ -31,6 +31,5 @@ val Kosmos.fingerprintPropertyInteractor by Fixture {
        repository = fingerprintPropertyRepository,
        repository = fingerprintPropertyRepository,
        configurationInteractor = configurationInteractor,
        configurationInteractor = configurationInteractor,
        displayStateInteractor = displayStateInteractor,
        displayStateInteractor = displayStateInteractor,
        udfpsOverlayInteractor = udfpsOverlayInteractor,
    )
    )
}
}
+0 −1
Original line number Original line Diff line number Diff line
@@ -75,7 +75,6 @@ private val Kosmos.alternateBouncerUdfpsIconViewModel by
            configurationInteractor = configurationInteractor,
            configurationInteractor = configurationInteractor,
            deviceEntryUdfpsInteractor = deviceEntryUdfpsInteractor,
            deviceEntryUdfpsInteractor = deviceEntryUdfpsInteractor,
            deviceEntryBackgroundViewModel = mock<DeviceEntryBackgroundViewModel>(),
            deviceEntryBackgroundViewModel = mock<DeviceEntryBackgroundViewModel>(),
            fingerprintPropertyInteractor = fingerprintPropertyInteractor,
            udfpsOverlayInteractor = udfpsOverlayInteractor,
            udfpsOverlayInteractor = udfpsOverlayInteractor,
            alternateBouncerViewModel = alternateBouncerViewModel,
            alternateBouncerViewModel = alternateBouncerViewModel,
            statusBarKeyguardViewManager = statusBarKeyguardViewManager,
            statusBarKeyguardViewManager = statusBarKeyguardViewManager,