Skip to content

Commit ec04030

Browse files
committed
Implement sim color support in call activity
1 parent d8ba4fa commit ec04030

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

app/src/main/kotlin/org/fossify/phone/activities/CallActivity.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -585,14 +585,15 @@ class CallActivity : SimpleActivity() {
585585
@SuppressLint("MissingPermission")
586586
private fun checkCalledSIMCard() {
587587
try {
588-
val accounts = telecomManager.callCapablePhoneAccounts
589-
if (accounts.size > 1) {
590-
accounts.forEachIndexed { index, account ->
591-
if (account == CallManager.getPrimaryCall()?.details?.accountHandle) {
588+
val simLabels = getAvailableSIMCardLabels()
589+
if (simLabels.size > 1) {
590+
simLabels.forEachIndexed { index, sim ->
591+
if (sim.handle == CallManager.getPrimaryCall()?.details?.accountHandle) {
592592
binding.apply {
593-
callSimId.text = "${index + 1}"
593+
callSimId.text = sim.id.toString()
594594
callSimId.beVisible()
595595
callSimImage.beVisible()
596+
callSimImage.applyColorFilter(sim.color.adjustSimColorForBackground(getProperBackgroundColor()))
596597
}
597598

598599
val acceptDrawableId = when (index) {

0 commit comments

Comments
 (0)