Loading packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/FullMobileConnectionRepositoryKairos.kt +12 −7 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import com.android.systemui.KairosBuilder import com.android.systemui.kairos.BuildSpec import com.android.systemui.kairos.ExperimentalKairosApi import com.android.systemui.kairos.State import com.android.systemui.kairos.combine import com.android.systemui.kairos.flatMap import com.android.systemui.kairosBuilder import com.android.systemui.log.table.TableLogBuffer Loading Loading @@ -55,9 +56,15 @@ constructor( @Assisted private val isCarrierMerged: State<Boolean>, ) : MobileConnectionRepositoryKairos, KairosBuilder by kairosBuilder() { private var dumpCache: DumpCache? = null init { onActivated { logDiffsForTable(isCarrierMerged, tableLogBuffer, columnName = "isCarrierMerged") combine(isCarrierMerged, activeRepo) { isCarrierMerged, activeRepo -> DumpCache(isCarrierMerged, activeRepo) } .observe { dumpCache = it } } } Loading Loading @@ -198,13 +205,6 @@ constructor( override val isInEcmMode: State<Boolean> = activeRepo.flatMap { it.isInEcmMode } private var dumpCache: DumpCache? = null private data class DumpCache( val isCarrierMerged: Boolean, val activeRepo: MobileConnectionRepositoryKairos, ) fun dump(pw: PrintWriter) { val cache = dumpCache ?: return val ipw = IndentingPrintWriter(pw, " ") Loading @@ -227,6 +227,11 @@ constructor( ipw.decreaseIndent() } private data class DumpCache( val isCarrierMerged: Boolean, val activeRepo: MobileConnectionRepositoryKairos, ) @AssistedFactory interface Factory { fun create( Loading packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryKairosImpl.kt +10 −5 Original line number Diff line number Diff line Loading @@ -131,6 +131,8 @@ constructor( private val mobileRepoFactory: Lazy<ConnectionRepoFactory>, ) : MobileConnectionsRepositoryKairos, Dumpable, KairosBuilder by kairosBuilder() { private var dumpCache: DumpCache? = null init { dumpManager.registerNormalDumpable("MobileConnectionsRepositoryKairos", this) } Loading Loading @@ -253,6 +255,7 @@ constructor( .asIncremental() .mapValues { (subId, sub) -> mobileRepoFactory.get().create(subId) } .applyLatestSpecForKey() .apply { observe { dumpCache = DumpCache(it) } } } private val telephonyManagerState: State<Pair<Int?, Set<Int>>> = buildState { Loading Loading @@ -479,10 +482,6 @@ constructor( profileClass = profileClass, ) private var dumpCache: DumpCache? = null private data class DumpCache(val repos: Map<Int, FullMobileConnectionRepositoryKairos>) override fun dump(pw: PrintWriter, args: Array<String>) { val cache = dumpCache ?: return val ipw = IndentingPrintWriter(pw, " ") Loading @@ -494,10 +493,16 @@ constructor( ipw.println("Connections (${cache.repos.size} total):") ipw.increaseIndent() cache.repos.values.forEach { it.dump(ipw) } cache.repos.values.forEach { if (it is FullMobileConnectionRepositoryKairos) { it.dump(ipw) } } ipw.decreaseIndent() } private data class DumpCache(val repos: Map<Int, MobileConnectionRepositoryKairos>) fun interface ConnectionRepoFactory { fun create(subId: Int): BuildSpec<MobileConnectionRepositoryKairos> } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/FullMobileConnectionRepositoryKairos.kt +12 −7 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import com.android.systemui.KairosBuilder import com.android.systemui.kairos.BuildSpec import com.android.systemui.kairos.ExperimentalKairosApi import com.android.systemui.kairos.State import com.android.systemui.kairos.combine import com.android.systemui.kairos.flatMap import com.android.systemui.kairosBuilder import com.android.systemui.log.table.TableLogBuffer Loading Loading @@ -55,9 +56,15 @@ constructor( @Assisted private val isCarrierMerged: State<Boolean>, ) : MobileConnectionRepositoryKairos, KairosBuilder by kairosBuilder() { private var dumpCache: DumpCache? = null init { onActivated { logDiffsForTable(isCarrierMerged, tableLogBuffer, columnName = "isCarrierMerged") combine(isCarrierMerged, activeRepo) { isCarrierMerged, activeRepo -> DumpCache(isCarrierMerged, activeRepo) } .observe { dumpCache = it } } } Loading Loading @@ -198,13 +205,6 @@ constructor( override val isInEcmMode: State<Boolean> = activeRepo.flatMap { it.isInEcmMode } private var dumpCache: DumpCache? = null private data class DumpCache( val isCarrierMerged: Boolean, val activeRepo: MobileConnectionRepositoryKairos, ) fun dump(pw: PrintWriter) { val cache = dumpCache ?: return val ipw = IndentingPrintWriter(pw, " ") Loading @@ -227,6 +227,11 @@ constructor( ipw.decreaseIndent() } private data class DumpCache( val isCarrierMerged: Boolean, val activeRepo: MobileConnectionRepositoryKairos, ) @AssistedFactory interface Factory { fun create( Loading
packages/SystemUI/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryKairosImpl.kt +10 −5 Original line number Diff line number Diff line Loading @@ -131,6 +131,8 @@ constructor( private val mobileRepoFactory: Lazy<ConnectionRepoFactory>, ) : MobileConnectionsRepositoryKairos, Dumpable, KairosBuilder by kairosBuilder() { private var dumpCache: DumpCache? = null init { dumpManager.registerNormalDumpable("MobileConnectionsRepositoryKairos", this) } Loading Loading @@ -253,6 +255,7 @@ constructor( .asIncremental() .mapValues { (subId, sub) -> mobileRepoFactory.get().create(subId) } .applyLatestSpecForKey() .apply { observe { dumpCache = DumpCache(it) } } } private val telephonyManagerState: State<Pair<Int?, Set<Int>>> = buildState { Loading Loading @@ -479,10 +482,6 @@ constructor( profileClass = profileClass, ) private var dumpCache: DumpCache? = null private data class DumpCache(val repos: Map<Int, FullMobileConnectionRepositoryKairos>) override fun dump(pw: PrintWriter, args: Array<String>) { val cache = dumpCache ?: return val ipw = IndentingPrintWriter(pw, " ") Loading @@ -494,10 +493,16 @@ constructor( ipw.println("Connections (${cache.repos.size} total):") ipw.increaseIndent() cache.repos.values.forEach { it.dump(ipw) } cache.repos.values.forEach { if (it is FullMobileConnectionRepositoryKairos) { it.dump(ipw) } } ipw.decreaseIndent() } private data class DumpCache(val repos: Map<Int, MobileConnectionRepositoryKairos>) fun interface ConnectionRepoFactory { fun create(subId: Int): BuildSpec<MobileConnectionRepositoryKairos> } Loading