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

Commit b5971524 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 13967044 from db8118b6 to 25Q4-release

Change-Id: I40bcd5a9eb3e2561847f01e51f227bf8ee74abc3
parents b4e3a8c5 db8118b6
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ interface DisplayRepository {
    val pendingDisplay: Flow<PendingDisplay?>

    /** Whether the default display is currently off. */
    val defaultDisplayOff: Flow<Boolean>
    val defaultDisplayOff: StateFlow<Boolean>

    /**
     * Given a display ID int, return the corresponding Display object, or null if none exist.
@@ -426,11 +426,15 @@ constructor(
            }
            .debugLog("pendingDisplay")

    override val defaultDisplayOff: Flow<Boolean> =
    override val defaultDisplayOff: StateFlow<Boolean> =
        displayChangeEvent
            .filter { it == Display.DEFAULT_DISPLAY }
            .map { defaultDisplay.state == Display.STATE_OFF }
            .distinctUntilChanged()
            .stateIn(
                bgApplicationScope,
                SharingStarted.WhileSubscribed(),
                defaultDisplay.state == Display.STATE_OFF,
            )

    override fun getDisplay(displayId: Int): Display? {
        val cachedDisplay = getCachedDisplay(displayId)