merge in lmp-mr1-release history after reset to lmp-mr1-dev
diff --git a/res/xml/cdma_options.xml b/res/xml/cdma_options.xml
index d4eaeba..78e3630 100644
--- a/res/xml/cdma_options.xml
+++ b/res/xml/cdma_options.xml
@@ -34,7 +34,7 @@
         android:dialogTitle="@string/cdma_subscription_dialogtitle" />
 
     <PreferenceScreen
-        android:key="button_apn_key"
+        android:key="button_apn_key_cdma"
         android:title="@string/apn_settings"
         android:persistent="false">
 
diff --git a/src/com/android/phone/CdmaOptions.java b/src/com/android/phone/CdmaOptions.java
index 897c797..a04427e 100644
--- a/src/com/android/phone/CdmaOptions.java
+++ b/src/com/android/phone/CdmaOptions.java
@@ -46,7 +46,7 @@
     private static final String BUTTON_CDMA_SUBSCRIPTION_KEY = "cdma_subscription_key";
     private static final String BUTTON_CDMA_ACTIVATE_DEVICE_KEY = "cdma_activate_device_key";
     private static final String BUTTON_CARRIER_SETTINGS_KEY = "carrier_settings_key";
-    private static final String BUTTON_APN_EXPAND_KEY = "button_apn_key";
+    private static final String BUTTON_APN_EXPAND_KEY = "button_apn_key_cdma";
 
     private PreferenceActivity mPrefActivity;
     private PreferenceScreen mPrefScreen;
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;
+        }
     }
 
     /**