mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-06-05 21:49:23 +02:00
show the called SIM card number in case there are multiple ones
This commit is contained in:
@ -63,6 +63,7 @@ class CallActivity : SimpleActivity() {
|
|||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
setupNotification()
|
setupNotification()
|
||||||
updateOtherPersonsInfo()
|
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) {
|
private fun updateCallState(state: Int) {
|
||||||
when (state) {
|
when (state) {
|
||||||
Call.STATE_RINGING -> callRinging()
|
Call.STATE_RINGING -> callRinging()
|
||||||
|
Reference in New Issue
Block a user