From ec0403083cdc7b7c2d896f113f50b520ae6d6f54 Mon Sep 17 00:00:00 2001 From: Marvin Rohrbach Date: Mon, 22 Jan 2024 22:37:50 +0100 Subject: [PATCH] Implement sim color support in call activity --- .../org/fossify/phone/activities/CallActivity.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/org/fossify/phone/activities/CallActivity.kt b/app/src/main/kotlin/org/fossify/phone/activities/CallActivity.kt index da4c0fc3..505414a3 100644 --- a/app/src/main/kotlin/org/fossify/phone/activities/CallActivity.kt +++ b/app/src/main/kotlin/org/fossify/phone/activities/CallActivity.kt @@ -585,14 +585,15 @@ class CallActivity : SimpleActivity() { @SuppressLint("MissingPermission") private fun checkCalledSIMCard() { try { - val accounts = telecomManager.callCapablePhoneAccounts - if (accounts.size > 1) { - accounts.forEachIndexed { index, account -> - if (account == CallManager.getPrimaryCall()?.details?.accountHandle) { + val simLabels = getAvailableSIMCardLabels() + if (simLabels.size > 1) { + simLabels.forEachIndexed { index, sim -> + if (sim.handle == CallManager.getPrimaryCall()?.details?.accountHandle) { binding.apply { - callSimId.text = "${index + 1}" + callSimId.text = sim.id.toString() callSimId.beVisible() callSimImage.beVisible() + callSimImage.applyColorFilter(sim.color.adjustSimColorForBackground(getProperBackgroundColor())) } val acceptDrawableId = when (index) {