Waiting for the psim subscriptionInfo ready
When the pSIM is inserted for the first time, this subscriptionInfo arrives late. It causes the sim onboarding is closed. We add the timer to wait the psim's subscriptionInfo. Bug: 377171470 Flag: EXEMPT bugfix Test: insert the psim and showing the sim onboarding flow. Change-Id: Ib50c28d1bb1372fb822b3cf10cfa3fb22c457b3b
This commit is contained in:
@@ -40,6 +40,7 @@ import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import kotlinx.coroutines.flow.onStart
|
||||
import kotlinx.coroutines.flow.shareIn
|
||||
import java.util.stream.Collectors
|
||||
|
||||
private const val TAG = "SubscriptionRepository"
|
||||
|
||||
@@ -154,6 +155,18 @@ class SubscriptionRepository(private val context: Context) {
|
||||
.conflate()
|
||||
.flowOn(Dispatchers.Default)
|
||||
|
||||
fun removableSubscriptionInfoListFlow(): Flow<List<SubscriptionInfo>> {
|
||||
return subscriptionsChangedFlow()
|
||||
.map {
|
||||
subscriptionManager.availableSubscriptionInfoList?.stream()
|
||||
?.filter { sub: SubscriptionInfo -> !sub.isEmbedded }
|
||||
?.collect(Collectors.toList()) ?: emptyList()
|
||||
}
|
||||
.conflate()
|
||||
.onEach { Log.d(TAG, "getRemovableSubscriptionVisibleFlow: $it") }
|
||||
.flowOn(Dispatchers.Default)
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
fun phoneNumberFlow(subId: Int): Flow<String?> =
|
||||
activeSubscriptionInfoFlow(subId).flatMapLatest { subInfo ->
|
||||
|
||||
Reference in New Issue
Block a user