chore: simplify iccid finder #64
1 changed files with 10 additions and 7 deletions
|
@ -115,15 +115,18 @@ class NotificationsActivity: BaseEuiccAccessActivity(), OpenEuiccContextMarker {
|
||||||
|
|
||||||
private fun refresh() {
|
private fun refresh() {
|
||||||
launchTask {
|
launchTask {
|
||||||
notificationAdapter.notifications =
|
euiccChannelManager.withEuiccChannel(logicalSlotId) { channel ->
|
||||||
euiccChannelManager.withEuiccChannel(logicalSlotId) { channel ->
|
val profiles = buildMap {
|
||||||
val profiles = channel.lpa.profiles
|
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