[Sb refactor] [demo] Use better default for demo mode

DemoModeConnectionsRepository was using (isConnected = false, isValidated
= false) for its default mobile connectivity model, and doesn't yet
support updating those values via the command line.

This CL just changes the default to be (true, true) so that the icons
properly show up.

Test: manual demo mode
Bug: 238425913
Change-Id: I1c9ade7ed0bd3c278ed38a3b306627a2879fb83e
This commit is contained in:
Evan Laird
2023-01-10 17:42:23 -05:00
parent 5c87aeada1
commit 4c85530de0
2 changed files with 10 additions and 1 deletions

View File

@@ -156,7 +156,8 @@ constructor(
override val defaultDataSubId = MutableStateFlow(INVALID_SUBSCRIPTION_ID)
// TODO(b/261029387): not yet supported
override val defaultMobileNetworkConnectivity = MutableStateFlow(MobileConnectivityModel())
override val defaultMobileNetworkConnectivity =
MutableStateFlow(MobileConnectivityModel(isConnected = true, isValidated = true))
override fun getRepoForSubId(subId: Int): DemoMobileConnectionRepository {
val current = connectionRepoCache[subId]?.repo

View File

@@ -89,6 +89,14 @@ class DemoMobileConnectionsRepositoryTest : SysuiTestCase() {
underTest.startProcessingCommands()
}
@Test
fun `connectivity - defaults to connected and validated`() =
testScope.runTest {
val connectivity = underTest.defaultMobileNetworkConnectivity.value
assertThat(connectivity.isConnected).isTrue()
assertThat(connectivity.isValidated).isTrue()
}
@Test
fun `network event - create new subscription`() =
testScope.runTest {