From 110066ff59ae02c26d2f1d2cd7234d8667b22ca7 Mon Sep 17 00:00:00 2001 From: Andrew Solovay Date: Wed, 4 Nov 2015 18:44:16 -0800 Subject: [PATCH] docs: Noted that getAllCellInfo() requires FEATURE_TELEPHONY Also cleaned up some phrasing & style for that method (and that method only) while I had it on the table. See first comment for doc stage location. bug: 25374858 Change-Id: I0c2c39a8953861563988eb5c8de1abedb302128b --- .../android/telephony/TelephonyManager.java | 50 ++++++++++++------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 24151658675fa..4b496bf760e81 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -2823,24 +2823,40 @@ public class TelephonyManager { /** * 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 CellInfoWcdma} 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. + * device including the primary and neighboring cells. Calling this method does + * not trigger a call to {@link android.telephony.PhoneStateListener#onCellInfoChanged + * onCellInfoChanged()}, or change the rate at which + * {@link android.telephony.PhoneStateListener#onCellInfoChanged + * onCellInfoChanged()} is called. + * + *

+ * The list can include one or more {@link android.telephony.CellInfoGsm CellInfoGsm}, + * {@link android.telephony.CellInfoCdma CellInfoCdma}, + * {@link android.telephony.CellInfoLte CellInfoLte}, and + * {@link android.telephony.CellInfoWcdma CellInfoWcdma} objects, in any combination. + * On devices with multiple radios it is typical to see instances of + * one or more of any these in the list. In addition, zero, one, or more + * of the returned objects may be considered registered; that is, their + * {@link android.telephony.CellInfo#isRegistered CellInfo.isRegistered()} + * methods may return true. + * + *

This method returns valid data for registered cells on devices with + * {@link android.content.pm.PackageManager#FEATURE_TELEPHONY}. + * + *

+ * This method is preferred over using {@link + * android.telephony.TelephonyManager#getCellLocation getCellLocation()}. + * However, for older devices, getAllCellInfo() may return + * null. In these cases, you should call {@link + * android.telephony.TelephonyManager#getCellLocation getCellLocation()} + * instead. + * + *

Requires permission: + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION} + * + * @return List of {@link android.telephony.CellInfo}; null if cell + * information is unavailable. * - *

Requires Permission: {@link android.Manifest.permission#ACCESS_COARSE_LOCATION} */ public List getAllCellInfo() { try {