setCdmaSubscription/RoamingMode returns when not CDMA
NoOp instead of return ISE when the device is not CDMA capable. Test: atest TelephonyManagerTest Fix: 175665470 Change-Id: I36d69f4bf337ef9c102327bfe87752c56847af87
This commit is contained in:
@@ -9956,7 +9956,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()}
|
||||
@@ -9979,6 +9980,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) {
|
||||
@@ -10059,7 +10061,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.
|
||||
@@ -10078,6 +10081,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) {
|
||||
|
||||
Reference in New Issue
Block a user