Remove References to ALLOWED_NETWORK_TYPES_REASON_USER_RESTRICTIONS
Bug: 266472206
Test: atest TelephonyManagerTest # cts test covers these cases
Change-Id: I03ac8b5277b09dee1b47e809f871b2c2a125d575
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 29d02ef..f82769a 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -6810,12 +6810,10 @@
// any network types which were set for security reasons.
if (mApp.checkCallingOrSelfPermission(Manifest.permission.MODIFY_PHONE_STATE)
!= PERMISSION_GRANTED
- && (reason == TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G
- || reason == TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_USER_RESTRICTIONS)) {
+ && reason == TelephonyManager.ALLOWED_NETWORK_TYPES_REASON_ENABLE_2G) {
throw new SecurityException(
"setAllowedNetworkTypesForReason cannot be called with carrier privileges for"
- + " reason "
- + reason);
+ + " reason " + reason);
}
if (!TelephonyManager.isValidAllowedNetworkTypesReason(reason)) {
loge("setAllowedNetworkTypesForReason: Invalid allowed network type reason: " + reason);