diff options
author | Wink Saville <wink@google.com> | 2011-02-01 21:06:38 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-02-01 21:06:38 -0800 |
commit | 12bf1133bd45039e8498d188731c546829faa1a2 (patch) | |
tree | 12b58605841138d3299740117799c3dbc321e6d6 /telephony | |
parent | c3e59272a4b7f1ca022730ff19240c7a266aa4fc (diff) | |
parent | ff34565fcb366d4bd0066bd7fe6f588e42a9a9cc (diff) | |
download | frameworks_base-12bf1133bd45039e8498d188731c546829faa1a2.zip frameworks_base-12bf1133bd45039e8498d188731c546829faa1a2.tar.gz frameworks_base-12bf1133bd45039e8498d188731c546829faa1a2.tar.bz2 |
am ff34565f: am 1bf518d8: Merge "Add TelephonyManager.getCurrentPhoneType" into honeycomb
* commit 'ff34565fcb366d4bd0066bd7fe6f588e42a9a9cc':
Add TelephonyManager.getCurrentPhoneType
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/android/telephony/CellLocation.java | 8 | ||||
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 26 |
2 files changed, 24 insertions, 10 deletions
diff --git a/telephony/java/android/telephony/CellLocation.java b/telephony/java/android/telephony/CellLocation.java index 2edfc23..5eaa5a0 100644 --- a/telephony/java/android/telephony/CellLocation.java +++ b/telephony/java/android/telephony/CellLocation.java @@ -61,9 +61,9 @@ public abstract class CellLocation { * @hide */ public static CellLocation newFromBundle(Bundle bundle) { - // TelephonyManager.getDefault().getPhoneType() handles the case when + // TelephonyManager.getDefault().getCurrentPhoneType() handles the case when // ITelephony interface is not up yet. - switch(TelephonyManager.getDefault().getPhoneType()) { + switch(TelephonyManager.getDefault().getCurrentPhoneType()) { case Phone.PHONE_TYPE_CDMA: return new CdmaCellLocation(bundle); case Phone.PHONE_TYPE_GSM: @@ -89,9 +89,9 @@ public abstract class CellLocation { * */ public static CellLocation getEmpty() { - // TelephonyManager.getDefault().getPhoneType() handles the case when + // TelephonyManager.getDefault().getCurrentPhoneType() handles the case when // ITelephony interface is not up yet. - switch(TelephonyManager.getDefault().getPhoneType()) { + switch(TelephonyManager.getDefault().getCurrentPhoneType()) { case Phone.PHONE_TYPE_CDMA: return new CdmaCellLocation(); case Phone.PHONE_TYPE_GSM: diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 01f2bae..b0f0a43 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -276,19 +276,18 @@ public class TelephonyManager { public static final int PHONE_TYPE_SIP = Phone.PHONE_TYPE_SIP; /** - * Returns a constant indicating the device phone type. This - * indicates the type of radio used to transmit voice calls. + * Returns the current phone type. + * TODO: This is a last minute change and hence hidden. * * @see #PHONE_TYPE_NONE * @see #PHONE_TYPE_GSM * @see #PHONE_TYPE_CDMA * @see #PHONE_TYPE_SIP + * + * {@hide} */ - public int getPhoneType() { + public int getCurrentPhoneType() { try{ - if (!isVoiceCapable()) { - return PHONE_TYPE_NONE; - } ITelephony telephony = getITelephony(); if (telephony != null) { return telephony.getActivePhoneType(); @@ -307,6 +306,21 @@ public class TelephonyManager { } } + /** + * Returns a constant indicating the device phone type. This + * indicates the type of radio used to transmit voice calls. + * + * @see #PHONE_TYPE_NONE + * @see #PHONE_TYPE_GSM + * @see #PHONE_TYPE_CDMA + * @see #PHONE_TYPE_SIP + */ + public int getPhoneType() { + if (!isVoiceCapable()) { + return PHONE_TYPE_NONE; + } + return getCurrentPhoneType(); + } private int getPhoneTypeFromProperty() { int type = |