From ca3597d4369b308c7c4d3553abfcc5788d10414a Mon Sep 17 00:00:00 2001 From: Wink Saville Date: Thu, 25 Apr 2013 15:02:34 -0700 Subject: Enhance TelephonyManger javadocs. Bug: 856818 Change-Id: Idd30361f57b0f6627132a25e5b9520f30fce548c --- .../java/android/telephony/TelephonyManager.java | 46 ++++++++++++++++------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 6400e6868394..c14d61b898a7 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -234,7 +234,14 @@ public class TelephonyManager { /** * Returns the current location of the device. - * Return null if current location is not available. + *

+ * If there is only one radio in the device and that radio has an LTE connection, + * this method will return null. The implementation must not to try add LTE + * identifiers into the existing cdma/gsm classes. + *

+ * In the future this call will be deprecated. + *

+ * @return Current location of the device or null if not available. * *

Requires Permission: * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_COARSE_LOCATION} or @@ -290,8 +297,11 @@ public class TelephonyManager { } /** - * Returns the neighboring cell information of the device. - * + * Returns the neighboring cell information of the device. The getAllCellInfo is preferred + * and use this only if getAllCellInfo return nulls or an empty list. + *

+ * In the future this call will be deprecated. + *

* @return List of NeighboringCellInfo or null if info unavailable. * *

Requires Permission: @@ -582,7 +592,7 @@ public class TelephonyManager { public static final int NETWORK_TYPE_HSPAP = 15; /** - * Returns the NETWORK_TYPE_xxxx for data transmission + * @return the NETWORK_TYPE_xxxx for current data connection. */ public int getNetworkType() { return getDataNetworkType(); @@ -865,8 +875,8 @@ public class TelephonyManager { * is a tri-state return value as for a period of time * the mode may be unknown. * - * @return {@link Phone#LTE_ON_CDMA_UNKNOWN}, {@link Phone#LTE_ON_CDMA_FALSE} - * or {@link Phone#LTE_ON_CDMA_TRUE} + * @return {@link PhoneConstants#LTE_ON_CDMA_UNKNOWN}, {@link PhoneConstants#LTE_ON_CDMA_FALSE} + * or {@link PhoneConstants#LTE_ON_CDMA_TRUE} * * @hide */ @@ -1341,13 +1351,25 @@ public class TelephonyManager { } /** - * Returns all observed cell information of the device. This does + * Returns all observed cell information from all radios on the + * device including the primary and neighboring cells. This does * not cause or change the rate of PhoneStateListner#onCellInfoChanged. - * + *

+ * The list can include one or more of {@link android.telephony.CellInfoGsm CellInfoGsm}, + * {@link android.telephony.CellInfoCdma CellInfoCdma}, + * {@link android.telephony.CellInfoLte CellInfoLte} and + * {@link android.telephony.CellInfoWcdma CellInfoCdma} in any combination. + * Specifically on devices with multiple radios it is typical to see instances of + * one or more of any these in the list. In addition 0, 1 or more CellInfo + * objects may return isRegistered() true. + *

+ * This is preferred over using getCellLocation although for older + * devices this may return null in which case getCellLocation should + * be called. + *

* @return List of CellInfo or null if info unavailable. * - *

Requires Permission: - * (@link android.Manifest.permission#ACCESS_COARSE_UPDATES} + *

Requires Permission: {@link android.Manifest.permission#ACCESS_COARSE_LOCATION} */ public List getAllCellInfo() { try { @@ -1362,11 +1384,11 @@ public class TelephonyManager { /** * Sets the minimum time in milli-seconds between {@link PhoneStateListener#onCellInfoChanged * PhoneStateListener.onCellInfoChanged} will be invoked. - * + *

* The default, 0, means invoke onCellInfoChanged when any of the reported * information changes. Setting the value to INT_MAX(0x7fffffff) means never issue * A onCellInfoChanged. - * + *

* @param rateInMillis the rate * * @hide -- cgit v1.2.3-59-g8ed1b