Filter out empty phone number
Prevent flicker. Bug: 318310357 Test: manual - on SIMs Test: unit test Change-Id: Ie44ec8bad58b59368099d0fe3f277c12855f8bd4
This commit is contained in:
@@ -141,10 +141,27 @@ class SubscriptionRepositoryTest {
|
||||
assertThat(subInfos.map { it.subscriptionId }).containsExactly(SUB_ID_1)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun phoneNumberFlow() = runBlocking {
|
||||
mockSubscriptionManager.stub {
|
||||
on { getPhoneNumber(SUB_ID_1) } doReturn NUMBER_1
|
||||
}
|
||||
val subInfo = SubscriptionInfo.Builder().apply {
|
||||
setId(SUB_ID_1)
|
||||
setMcc(MCC)
|
||||
}.build()
|
||||
|
||||
val phoneNumber = context.phoneNumberFlow(subInfo).firstWithTimeoutOrNull()
|
||||
|
||||
assertThat(phoneNumber).isEqualTo(NUMBER_1)
|
||||
}
|
||||
|
||||
private companion object {
|
||||
const val SUB_ID_1 = 1
|
||||
const val SUB_ID_2 = 2
|
||||
val GROUP_UUID = UUID.randomUUID().toString()
|
||||
const val SIM_SLOT_INDEX = 1
|
||||
const val NUMBER_1 = "000000001"
|
||||
const val MCC = "310"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user