diff options
author | Wink Saville <wink@google.com> | 2009-09-03 13:34:04 -0700 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2009-09-03 13:34:04 -0700 |
commit | e40f66ffc11cfc7e1bbe3e4c2ae1cf6dbc24cc17 (patch) | |
tree | bf28e9954cff02cfbec83423b8553c3b5a4eb7ce /telephony | |
parent | f619028470b63ba1c8e9d86fd2faab7bbece873b (diff) | |
download | frameworks_base-e40f66ffc11cfc7e1bbe3e4c2ae1cf6dbc24cc17.zip frameworks_base-e40f66ffc11cfc7e1bbe3e4c2ae1cf6dbc24cc17.tar.gz frameworks_base-e40f66ffc11cfc7e1bbe3e4c2ae1cf6dbc24cc17.tar.bz2 |
Allow hasIccCard to be useable by any processes.
This is accomplished by adding hasIccCard to ITelephony and do
the implemenation in PhoneInterfaceManager.java. Then change
TelephonyManager to use getITelephony().hasIccCard().
Change-Id: I26970fdf92a058502b8156a4f52c14e213217fc6
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 7 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/ITelephony.aidl | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index a690e3c..a744486 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -484,7 +484,12 @@ public class TelephonyManager { * @return true if a ICC card is present */ public boolean hasIccCard() { - return PhoneFactory.getDefaultPhone().getIccCard().hasIccCard(); + try { + return getITelephony().hasIccCard(); + } catch (RemoteException ex) { + // Assume no ICC card if remote exception which shouldn't happen + return false; + } } /** diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 63c23ae..2328717 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -252,5 +252,10 @@ interface ITelephony { * Returns the network type */ int getNetworkType(); + + /** + * Return true if an ICC card is present + */ + boolean hasIccCard(); } |