am 65d62c77: Add hasIccCard to IccCard and TelephonyManager.

Merge commit '65d62c774e42d8bf9a55ef50e153ffc9e277ef37' into eclair-plus-aosp

* commit '65d62c774e42d8bf9a55ef50e153ffc9e277ef37':
  Add hasIccCard to IccCard and TelephonyManager.
This commit is contained in:
Wink Saville
2009-09-01 15:58:10 -07:00
committed by Android Git Automerger
3 changed files with 31 additions and 0 deletions

View File

@@ -117394,6 +117394,17 @@
visibility="public"
>
</method>
<method name="hasIccCard"
return="boolean"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
<method name="isNetworkRoaming"
return="boolean"
abstract="false"

View File

@@ -480,6 +480,13 @@ public class TelephonyManager {
/** SIM card state: Ready */
public static final int SIM_STATE_READY = 5;
/**
* @return true if a ICC card is present
*/
public boolean hasIccCard() {
return PhoneFactory.getDefaultPhone().getIccCard().hasIccCard();
}
/**
* Returns a constant indicating the state of the
* device SIM card.

View File

@@ -667,6 +667,19 @@ public abstract class IccCard {
return false;
}
/**
* @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.
return false;
}
}
private void log(String msg) {
Log.d(mLogTag, "[IccCard] " + msg);
}