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

Commit 95eb4844 authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Remove displayIds from PerDisplayRepository

Nothing is using it anymore.

Bug: 362719719
Bug: 398011576
Test: PerDisplayInstanceRepositoryImplTest
Flag: NONE - just cleaning up
Change-Id: Ia999fb933d5b786986249aa441025406805f53ee
parent 45e76e53
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -32,9 +32,6 @@ class FakePerDisplayRepository<T> : PerDisplayRepository<T> {
        return instances[displayId]
    }

    override val displayIds: Set<Int>
        get() = instances.keys

    override val debugName: String
        get() = "FakePerDisplayRepository"
}
+0 −10
Original line number Diff line number Diff line
@@ -86,9 +86,6 @@ interface PerDisplayRepository<T> {
    /** Gets the cached instance or create a new one for a given display. */
    operator fun get(displayId: Int): T?

    /** List of display ids for which this repository has an instance. */
    val displayIds: Set<Int>

    /** Debug name for this repository, mainly for tracing and logging. */
    val debugName: String
}
@@ -122,9 +119,6 @@ constructor(
        backgroundApplicationScope.launch("$debugName#start") { start() }
    }

    override val displayIds: Set<Int>
        get() = perDisplayInstances.keys

    private suspend fun start() {
        dumpManager.registerNormalDumpable("PerDisplayRepository-${debugName}", this)
        displayRepository.displayIds.collectLatest { displayIds ->
@@ -199,8 +193,6 @@ class DefaultDisplayOnlyInstanceRepositoryImpl<T>(
    private val lazyDefaultDisplayInstance by lazy {
        instanceProvider.createInstance(Display.DEFAULT_DISPLAY)
    }
    override val displayIds: Set<Int> = setOf(Display.DEFAULT_DISPLAY)

    override fun get(displayId: Int): T? = lazyDefaultDisplayInstance
}

@@ -214,7 +206,5 @@ class DefaultDisplayOnlyInstanceRepositoryImpl<T>(
 */
class SingleInstanceRepositoryImpl<T>(override val debugName: String, private val instance: T) :
    PerDisplayRepository<T> {
    override val displayIds: Set<Int> = setOf(Display.DEFAULT_DISPLAY)

    override fun get(displayId: Int): T? = instance
}