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

Commit aea66f75 authored by Dave Mankoff's avatar Dave Mankoff
Browse files

Fix flag app being empty.

Kotlin evaluates `object` declarations lazily.
We have to access `Flags` before it will populate
the list, and we were asking for the list during
construction of our dagger graph.

Bug: 257302229
Test: manual
Change-Id: Iadfbbbc50ee2fb09260f5d119898fb50b3cc90f9
parent 6fe41592
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -22,7 +22,11 @@ object FlagsFactory {
    private val flagMap = mutableMapOf<String, Flag<*>>()

    val knownFlags: Map<String, Flag<*>>
        get() = flagMap
        get() {
            // We need to access Flags in order to initialize our map.
            assert(flagMap.contains(Flags.TEAMFOOD.name)) { "Where is teamfood?" }
            return flagMap
        }

    fun unreleasedFlag(
        id: Int,
+5 −1
Original line number Diff line number Diff line
@@ -22,7 +22,11 @@ object FlagsFactory {
    private val flagMap = mutableMapOf<String, Flag<*>>()

    val knownFlags: Map<String, Flag<*>>
        get() = flagMap
        get() {
            // We need to access Flags in order to initialize our map.
            assert(flagMap.contains(Flags.TEAMFOOD.name)) { "Where is teamfood?" }
            return flagMap
        }

    fun unreleasedFlag(
        id: Int,