chore: simplify iccid finder #64
1 changed files with 10 additions and 7 deletions
|
@ -115,13 +115,16 @@ class NotificationsActivity: BaseEuiccAccessActivity(), OpenEuiccContextMarker {
|
|||
|
||||
private fun refresh() {
|
||||
launchTask {
|
||||
notificationAdapter.notifications =
|
||||
euiccChannelManager.withEuiccChannel(logicalSlotId) { channel ->
|
||||
val profiles = channel.lpa.profiles
|
||||
val profiles = buildMap {
|
||||
for (profile in channel.lpa.profiles) {
|
||||
put(profile.iccid, profile)
|
||||
}
|
||||
}
|
||||
|
||||
channel.lpa.notifications.map {
|
||||
val profile = profiles.find { p -> p.iccid == it.iccid }
|
||||
LocalProfileNotificationWrapper(it, profile?.displayName ?: "???")
|
||||
notificationAdapter.notifications = channel.lpa.notifications.map {
|
||||
val name = profiles[it.iccid]?.displayName ?: "???"
|
||||
LocalProfileNotificationWrapper(it, name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue