Fix to use subId instead of slotId when calling getPhone()
Bug: 18705342
Change-Id: I71c5c4122bf5226893309e806bec4430c995b568
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 1a5de74..24abf23 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -1574,14 +1574,19 @@
*/
public boolean hasIccCard() {
// FIXME Make changes to pass defaultSimId of type int
- return hasIccCardUsingSlotId(getDefaultSubscription());
+ return hasIccCardUsingSlotId(mSubscriptionController.getSlotId(getDefaultSubscription()));
}
/**
* @return true if a ICC card is present for a slotId
*/
public boolean hasIccCardUsingSlotId(int slotId) {
- return getPhone(slotId).getIccCard().hasIccCard();
+ int subId[] = mSubscriptionController.getSubIdUsingSlotId(slotId);
+ if (subId != null) {
+ return getPhone(subId[0]).getIccCard().hasIccCard();
+ } else {
+ return false;
+ }
}
/**