summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarah Chin <sarahchin@google.com>2021-03-17 00:36:06 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-03-17 00:36:06 +0000
commit1c97b8d7672c0dfc524cddf62b51fac9a0f949fc (patch)
tree0ca39c60f7e315e1146ba7219c09e9870ac0ece0
parentbb4be48b5193d581f80681f10154f8e1cae73a29 (diff)
parent0762c167650375fe4da128a530ce5e4d0eb72b7f (diff)
Merge "setCdmaSubscription/RoamingMode returns when not CDMA" into sc-dev
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 3e9133d0966b..faa5deed0f1c 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -9980,7 +9980,8 @@ public class TelephonyManager {
}
/**
- * Sets the roaming mode for CDMA phone to the given mode {@code mode}.
+ * Sets the roaming mode for CDMA phone to the given mode {@code mode}. If the phone is not
+ * CDMA capable, this method does nothing.
*
* <p>If this object has been created with {@link #createForSubscriptionId}, applies to the
* given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultSubscriptionId()}
@@ -10003,6 +10004,7 @@ public class TelephonyManager {
@SystemApi
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
public void setCdmaRoamingMode(@CdmaRoamingMode int mode) {
+ if (getPhoneType() != PHONE_TYPE_CDMA) return;
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
@@ -10083,7 +10085,8 @@ public class TelephonyManager {
}
/**
- * Sets the subscription mode for CDMA phone to the given mode {@code mode}.
+ * Sets the subscription mode for CDMA phone to the given mode {@code mode}. If the phone is not
+ * CDMA capable, this method does nothing.
*
* @param mode CDMA subscription mode.
* @throws SecurityException if the caller does not have the permission.
@@ -10102,6 +10105,7 @@ public class TelephonyManager {
@SystemApi
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
public void setCdmaSubscriptionMode(@CdmaSubscription int mode) {
+ if (getPhoneType() != PHONE_TYPE_CDMA) return;
try {
ITelephony telephony = getITelephony();
if (telephony != null) {