Merge "Also catch IllegalArgumentException in TelecomAccountRegistry"
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index df2b62c..e251516 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -2819,6 +2819,9 @@
} catch (ImsException e) {
Log.w(LOG_TAG, "IMS isCapable - service unavailable: " + e.getMessage());
return false;
+ } catch (IllegalArgumentException e) {
+ Log.i(LOG_TAG, "isCapable: " + subId + " is inactive, returning false.");
+ return false;
} finally {
Binder.restoreCallingIdentity(token);
}
@@ -3403,7 +3406,7 @@
private int getSlotIndexOrException(int subId) throws IllegalArgumentException {
int slotId = SubscriptionManager.getSlotIndex(subId);
if (!SubscriptionManager.isValidSlotIndex(slotId)) {
- throw new IllegalArgumentException("Invalid Subscription Id.");
+ throw new IllegalArgumentException("Invalid Subscription Id, subId=" + subId);
}
return slotId;
}
diff --git a/src/com/android/services/telephony/TelecomAccountRegistry.java b/src/com/android/services/telephony/TelecomAccountRegistry.java
index bfd8e27..f925dd6 100644
--- a/src/com/android/services/telephony/TelecomAccountRegistry.java
+++ b/src/com/android/services/telephony/TelecomAccountRegistry.java
@@ -156,6 +156,10 @@
Log.w(this, "registerMmTelCapabilityCallback: registration failed, no ImsService"
+ " available. Exception: " + e.getMessage());
return;
+ } catch (IllegalArgumentException e) {
+ Log.w(this, "registerMmTelCapabilityCallback: registration failed, invalid"
+ + " subscription, Exception" + e.getMessage());
+ return;
}
}