OSDN Git Service

Make hasIccCard return true if RUIM card is present.
authorNaveen Kalla <nkalla@codeaurora.org>
Sun, 27 Jun 2010 05:52:39 +0000 (22:52 -0700)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 5 Aug 2011 08:05:43 +0000 (16:05 +0800)
Currently hasIccCard method works only for GSM phones with SIM/USIM
cards. Extend that to RUIM as well.

Change-Id: Iefbfc35025074e7414f4abdffea844e9e0325053

telephony/java/com/android/internal/telephony/IccCard.java

index d3a34ec..90f9e8c 100644 (file)
@@ -672,12 +672,11 @@ public abstract class IccCard {
      * @return true if a ICC card is present
      */
     public boolean hasIccCard() {
-        boolean isIccPresent;
-        if (mPhone.getPhoneName().equals("GSM")) {
-            return mIccCardStatus.getCardState().isCardPresent();
-        } else {
-            // TODO: Make work with a CDMA device with a RUIM card.
+        if (mIccCardStatus == null) {
             return false;
+        } else {
+            // Returns ICC card status for both GSM and CDMA mode
+            return mIccCardStatus.getCardState().isCardPresent();
         }
     }