mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
store the Sim card ID at the SIM model too
This commit is contained in:
@ -15,7 +15,7 @@ val Context.audioManager: AudioManager get() = getSystemService(Context.AUDIO_SE
|
||||
@SuppressLint("MissingPermission")
|
||||
fun Context.getAvailableSIMCardLabels(): ArrayList<SIMAccount> {
|
||||
val SIMAccounts = ArrayList<SIMAccount>()
|
||||
telecomManager.callCapablePhoneAccounts.forEach { account ->
|
||||
telecomManager.callCapablePhoneAccounts.forEachIndexed { index, account ->
|
||||
val phoneAccount = telecomManager.getPhoneAccount(account)
|
||||
var label = phoneAccount.label.toString()
|
||||
var address = phoneAccount.address.toString()
|
||||
@ -23,7 +23,7 @@ fun Context.getAvailableSIMCardLabels(): ArrayList<SIMAccount> {
|
||||
address = Uri.decode(address.substringAfter("tel:"))
|
||||
label += " ($address)"
|
||||
}
|
||||
val SIM = SIMAccount(phoneAccount.accountHandle, label)
|
||||
val SIM = SIMAccount(index + 1, phoneAccount.accountHandle, label)
|
||||
SIMAccounts.add(SIM)
|
||||
}
|
||||
return SIMAccounts
|
||||
|
@ -2,4 +2,4 @@ package com.simplemobiletools.dialer.models
|
||||
|
||||
import android.telecom.PhoneAccountHandle
|
||||
|
||||
data class SIMAccount(val handle: PhoneAccountHandle, val label: String)
|
||||
data class SIMAccount(val id: Int, val handle: PhoneAccountHandle, val label: String)
|
||||
|
Reference in New Issue
Block a user