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:
@@ -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"
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user