chore: simplify iccid finder #64

Closed
septs wants to merge 1 commit from septs:simplify-iccid-finder into master

View file

@ -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)
}
}
}