Merge "Improve carrierconfig to support multisim in SIMRecords"
am: 9981d8ad86
Change-Id: I75c0ecc317dfb416a03982e56e4dbe0f2b0ec0fc
diff --git a/src/java/com/android/internal/telephony/uicc/SIMRecords.java b/src/java/com/android/internal/telephony/uicc/SIMRecords.java
index 4f44f15..d1574c7 100755
--- a/src/java/com/android/internal/telephony/uicc/SIMRecords.java
+++ b/src/java/com/android/internal/telephony/uicc/SIMRecords.java
@@ -1028,16 +1028,20 @@
onCphsCompleted));
} else {
if (ar.userObj != null) {
- CarrierConfigManager configLoader = (CarrierConfigManager)
+ CarrierConfigManager configManager = (CarrierConfigManager)
mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE);
- if (ar.exception != null && configLoader != null
- && configLoader.getConfig().getBoolean(
- CarrierConfigManager.KEY_EDITABLE_VOICEMAIL_NUMBER_BOOL)) {
- // GsmCdmaPhone will store vm number on device
- // when IccVmNotSupportedException occurred
- AsyncResult.forMessage(((Message) ar.userObj)).exception =
- new IccVmNotSupportedException(
- "Update SIM voice mailbox error");
+ if (ar.exception != null && configManager != null) {
+ PersistableBundle b = configManager.getConfigForSubId(
+ SubscriptionController.getInstance().getSubIdUsingPhoneId(
+ mParentApp.getPhoneId()));
+ if (b != null && b.getBoolean(
+ CarrierConfigManager.KEY_EDITABLE_VOICEMAIL_NUMBER_BOOL)) {
+ // GsmCdmaPhone will store vm number on device
+ // when IccVmNotSupportedException occurred
+ AsyncResult.forMessage(((Message) ar.userObj)).exception =
+ new IccVmNotSupportedException(
+ "Update SIM voice mailbox error");
+ }
} else {
AsyncResult.forMessage(((Message) ar.userObj))
.exception = ar.exception;