Merge "Add the subId chceking before the DB write allowed network type"
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index fa52f48..958c860 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -6214,7 +6214,11 @@
TelephonyPermissions.enforceCallingOrSelfModifyPermissionOrCarrierPrivilege(
mApp, subId, "setAllowedNetworkTypesForReason");
if (!TelephonyManager.isValidAllowedNetworkTypesReason(reason)) {
- Rlog.e(LOG_TAG, "Invalid allowed network type reason: " + reason);
+ loge("setAllowedNetworkTypesForReason: Invalid allowed network type reason: " + reason);
+ return false;
+ }
+ if (!SubscriptionManager.isUsableSubscriptionId(subId)) {
+ loge("setAllowedNetworkTypesForReason: Invalid subscriptionId:" + subId);
return false;
}