[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:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user