diff options
| author | 2018-08-29 00:24:09 +0000 | |
|---|---|---|
| committer | 2018-08-29 00:24:09 +0000 | |
| commit | db1cc81a90ca98ec51629942b25532c09b3c9e37 (patch) | |
| tree | 27ee4ced555d4bd750854619201440d6fd39e67a | |
| parent | 6f4cc2bdf572eb662bb9c009b48861dda9b36f7f (diff) | |
| parent | 3f8278865abf2def16e663abeb13b3331fa87812 (diff) | |
Merge "Update TelephonyManager document"
| -rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 56 |
1 files changed, 40 insertions, 16 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 82e3a9df23d6..dab62f157e78 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -2843,9 +2843,11 @@ public class TelephonyManager { } /** - * Return if the current radio is LTE on CDMA. This - * is a tri-state return value as for a period of time - * the mode may be unknown. + * Return if the current radio is LTE on CDMA. This is a tri-state return value as for a period + * of time the mode may be unknown. + * + * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the + * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()} * * @return {@link PhoneConstants#LTE_ON_CDMA_UNKNOWN}, {@link PhoneConstants#LTE_ON_CDMA_FALSE} * or {@link PhoneConstants#LTE_ON_CDMA_TRUE} @@ -5630,6 +5632,9 @@ public class TelephonyManager { /** * Sets the network selection mode to automatic. * + * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the + * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()} + * * <p>Requires Permission: * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling * app has carrier privileges (see {@link #hasCarrierPrivileges}). @@ -5652,27 +5657,36 @@ public class TelephonyManager { /** * Perform a radio scan and return the list of available networks. * - * The return value is a list of the OperatorInfo of the networks found. Note that this - * scan can take a long time (sometimes minutes) to happen. + * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the + * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()} + * + * <p> Note that this scan can take a long time (sometimes minutes) to happen. * * <p>Requires Permission: - * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling - * app has carrier privileges (see {@link #hasCarrierPrivileges}). + * {@link android.Manifest.permission#MODIFY_PHONE_STATE} or that the calling app has carrier + * privileges (see {@link #hasCarrierPrivileges}) + * + * @return {@link CellNetworkScanResult} with the status + * {@link CellNetworkScanResult#STATUS_SUCCESS} and a list of + * {@link com.android.internal.telephony.OperatorInfo} if it's available. Otherwise, the failure + * caused will be included in the result. * * @hide - * TODO: Add an overload that takes no args. */ - public CellNetworkScanResult getCellNetworkScanResults(int subId) { + @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) + public CellNetworkScanResult getAvailableNetworks() { try { ITelephony telephony = getITelephony(); - if (telephony != null) - return telephony.getCellNetworkScanResults(subId); + if (telephony != null) { + return telephony.getCellNetworkScanResults(getSubId()); + } } catch (RemoteException ex) { - Rlog.e(TAG, "getCellNetworkScanResults RemoteException", ex); + Rlog.e(TAG, "getAvailableNetworks RemoteException", ex); } catch (NullPointerException ex) { - Rlog.e(TAG, "getCellNetworkScanResults NPE", ex); + Rlog.e(TAG, "getAvailableNetworks NPE", ex); } - return null; + return new CellNetworkScanResult( + CellNetworkScanResult.STATUS_UNKNOWN_ERROR, null /* OperatorInfo */); } /** @@ -5722,6 +5736,9 @@ public class TelephonyManager { /** * Ask the radio to connect to the input network and change selection mode to manual. * + * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the + * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()} + * * <p>Requires Permission: * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} or that the calling * app has carrier privileges (see {@link #hasCarrierPrivileges}). @@ -7474,6 +7491,9 @@ public class TelephonyManager { /** * Returns the current {@link ServiceState} information. * + * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the + * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()} + * * <p>Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * or that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}). */ @@ -7941,8 +7961,12 @@ public class TelephonyManager { } /** - * Check if phone is in emergency callback mode - * @return true if phone is in emergency callback mode + * Checks if phone is in emergency callback mode. + * + * <p>If this object has been created with {@link #createForSubscriptionId}, applies to the + * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultDataSubscriptionId()} + * + * @return true if phone is in emergency callback mode. * @hide */ @SystemApi |