Fix multisim issue with sim call manager.
Ensure that on multisim devices we only configure the sim call manager
when its the default sim manager for the current sub.
I considered making getSimCallManager multisim aware, but it works out to
be a pretty large change for a scenario that I don't think will reasonably
happen very often. Ultimately we would like to deprecate the sim
call manager in the future.
Test: Manual
Bug: 111411739
Change-Id: I6c9e7f30a249e11669108fbb4175ecbf192d80d5
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
index 465b89a..df0a527 100644
--- a/src/com/android/phone/MobileNetworkSettings.java
+++ b/src/com/android/phone/MobileNetworkSettings.java
@@ -1867,10 +1867,23 @@
return;
}
+ // See what Telecom thinks the SIM call manager is.
final PhoneAccountHandle simCallManager =
TelecomManager.from(getContext()).getSimCallManager();
- if (simCallManager != null) {
+ // Check which SIM call manager is for the current sub ID.
+ PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(mSubId);
+ String currentSubSimCallManager = null;
+ if (carrierConfig != null) {
+ currentSubSimCallManager = carrierConfig.getString(
+ CarrierConfigManager.KEY_DEFAULT_SIM_CALL_MANAGER_STRING);
+ }
+
+ // Only try to configure the phone account if this is the sim call manager for the
+ // current sub.
+ if (simCallManager != null
+ && simCallManager.getComponentName().flattenToString().equals(
+ currentSubSimCallManager)) {
Intent intent = MobileNetworkSettings.buildPhoneAccountConfigureIntent(
getContext(), simCallManager);
PackageManager pm = getContext().getPackageManager();