summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPengquan Meng <mpq@google.com>2018-09-12 17:13:13 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-09-12 17:13:13 -0700
commit523cf0bbcb170dff661b7d96d331bc2c6de5d866 (patch)
treea03710c8daddd71be52238bf06df94dcc39f8bac
parent0561f2c570d3de84ecbe6824c412b03ca844353d (diff)
parenteda353bc524e1d1eafee4f4ba8c41be08456105e (diff)
Merge "Update TelephonyManager document" am: 14faaf660d
am: eda353bc52 Change-Id: Id78189ec61aff200b4724da46e85bc69e01e95af
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java56
1 files changed, 40 insertions, 16 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 8ebcdcd8e319..3d8455064113 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -2862,9 +2862,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}
@@ -5682,6 +5684,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}).
@@ -5704,27 +5709,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 */);
}
/**
@@ -5774,6 +5788,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}).
@@ -7526,6 +7543,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}).
*/
@@ -7993,8 +8013,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