show the called SIM card number in case there are multiple ones
This commit is contained in:
parent
bda0d2e296
commit
4dbc73f3de
|
@ -63,6 +63,7 @@ class CallActivity : SimpleActivity() {
|
|||
runOnUiThread {
|
||||
setupNotification()
|
||||
updateOtherPersonsInfo()
|
||||
checkCalledSIMCard()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -195,6 +196,23 @@ class CallActivity : SimpleActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressLint("MissingPermission")
|
||||
private fun checkCalledSIMCard() {
|
||||
try {
|
||||
val accounts = telecomManager.callCapablePhoneAccounts
|
||||
if (accounts.size > 1) {
|
||||
accounts.forEachIndexed { index, account ->
|
||||
if (account == CallManager.call?.details?.accountHandle) {
|
||||
call_sim_id.text = "${index + 1}"
|
||||
call_sim_id.beVisible()
|
||||
call_sim_image.beVisible()
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (ignored: Exception) {
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateCallState(state: Int) {
|
||||
when (state) {
|
||||
Call.STATE_RINGING -> callRinging()
|
||||
|
|
Loading…
Reference in New Issue