summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Gil Cukierman <cukie@google.com> 2022-11-17 14:32:13 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-11-17 14:32:13 +0000
commitaf2c8359647fd225f4a4dcfd88e84c027f32f469 (patch)
tree2471c1239cd3c95608d7347735d3121ca248cb80
parent42bfb0ae9ed76701ae72f3532fffa1a4f2f74e97 (diff)
parent44f53112ecb248d65a7c2daeedc8a67b41eacd24 (diff)
Merge "Update TelephonyManager.setAllowedNetworkTypeForReason Docs" am: 44f53112ec
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2240933 Change-Id: Icc26671e9b9cbd14389d86bff36b30a0489ef07f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index a081bc320921..3b376fb4c605 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -9409,12 +9409,13 @@ public class TelephonyManager {
/**
* Set the allowed network types of the device and provide the reason triggering the allowed
* network change.
- * <p>Requires permission: android.Manifest.MODIFY_PHONE_STATE or
+ * <p>Requires permission: {@link android.Manifest.permission#MODIFY_PHONE_STATE} or
* that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}).
*
- * This can be called for following reasons
+ * This can be called for following reasons:
* <ol>
- * <li>Allowed network types control by USER {@link #ALLOWED_NETWORK_TYPES_REASON_USER}
+ * <li>Allowed network types control by USER
+ * {@link TelephonyManager#ALLOWED_NETWORK_TYPES_REASON_USER}
* <li>Allowed network types control by carrier {@link #ALLOWED_NETWORK_TYPES_REASON_CARRIER}
* </ol>
* This API will result in allowing an intersection of allowed network types for all reasons,
@@ -9424,7 +9425,13 @@ public class TelephonyManager {
* @param allowedNetworkTypes The bitmask of allowed network type
* @throws IllegalStateException if the Telephony process is not currently available.
* @throws IllegalArgumentException if invalid AllowedNetworkTypesReason is passed.
- * @throws SecurityException if the caller does not have the required privileges
+ * @throws SecurityException if the caller does not have the required privileges or if the
+ * caller tries to use one of the following security-based reasons without
+ * {@link android.Manifest.permission#MODIFY_PHONE_STATE} permissions.
+ * <ol>
+ * <li>{@code TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G}</li>
+ * <li>{@code TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER_RESTRICTIONS}</li>
+ * </ol>
*/
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
@RequiresFeature(