Loading src/java/com/android/internal/telephony/Phone.java +12 −7 Original line number Original line Diff line number Diff line Loading @@ -2430,24 +2430,29 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { * * * @param reason reason to configure allowed network type * @param reason reason to configure allowed network type * @param networkTypes one of the network types * @param networkTypes one of the network types * @param response callback Message */ */ public void setAllowedNetworkTypes(@TelephonyManager.AllowedNetworkTypesReason int reason, public void setAllowedNetworkTypes(@TelephonyManager.AllowedNetworkTypesReason int reason, @TelephonyManager.NetworkTypeBitMask long networkTypes, Message response) { @TelephonyManager.NetworkTypeBitMask long networkTypes, @Nullable Message response) { int subId = getSubId(); int subId = getSubId(); if (!TelephonyManager.isValidAllowedNetworkTypesReason(reason)) { if (!TelephonyManager.isValidAllowedNetworkTypesReason(reason)) { loge("setAllowedNetworkTypes: Invalid allowed network type reason: " + reason); loge("setAllowedNetworkTypes: Invalid allowed network type reason: " + reason); if (response != null) { AsyncResult.forMessage(response, null, AsyncResult.forMessage(response, null, new CommandException(CommandException.Error.INVALID_ARGUMENTS)); new CommandException(CommandException.Error.INVALID_ARGUMENTS)); response.sendToTarget(); response.sendToTarget(); } return; return; } } if (!SubscriptionManager.isUsableSubscriptionId(subId) if (!SubscriptionManager.isUsableSubscriptionId(subId) || !mIsAllowedNetworkTypesLoadedFromDb) { || !mIsAllowedNetworkTypesLoadedFromDb) { loge("setAllowedNetworkTypes: no sim or network type is not loaded. SubscriptionId: " loge("setAllowedNetworkTypes: no sim or network type is not loaded. SubscriptionId: " + subId + ", isNetworkTypeLoaded" + mIsAllowedNetworkTypesLoadedFromDb); + subId + ", isNetworkTypeLoaded" + mIsAllowedNetworkTypesLoadedFromDb); if (response != null) { AsyncResult.forMessage(response, null, AsyncResult.forMessage(response, null, new CommandException(CommandException.Error.MISSING_RESOURCE)); new CommandException(CommandException.Error.MISSING_RESOURCE)); response.sendToTarget(); response.sendToTarget(); } return; return; } } String mapAsString = ""; String mapAsString = ""; Loading Loading
src/java/com/android/internal/telephony/Phone.java +12 −7 Original line number Original line Diff line number Diff line Loading @@ -2430,24 +2430,29 @@ public abstract class Phone extends Handler implements PhoneInternalInterface { * * * @param reason reason to configure allowed network type * @param reason reason to configure allowed network type * @param networkTypes one of the network types * @param networkTypes one of the network types * @param response callback Message */ */ public void setAllowedNetworkTypes(@TelephonyManager.AllowedNetworkTypesReason int reason, public void setAllowedNetworkTypes(@TelephonyManager.AllowedNetworkTypesReason int reason, @TelephonyManager.NetworkTypeBitMask long networkTypes, Message response) { @TelephonyManager.NetworkTypeBitMask long networkTypes, @Nullable Message response) { int subId = getSubId(); int subId = getSubId(); if (!TelephonyManager.isValidAllowedNetworkTypesReason(reason)) { if (!TelephonyManager.isValidAllowedNetworkTypesReason(reason)) { loge("setAllowedNetworkTypes: Invalid allowed network type reason: " + reason); loge("setAllowedNetworkTypes: Invalid allowed network type reason: " + reason); if (response != null) { AsyncResult.forMessage(response, null, AsyncResult.forMessage(response, null, new CommandException(CommandException.Error.INVALID_ARGUMENTS)); new CommandException(CommandException.Error.INVALID_ARGUMENTS)); response.sendToTarget(); response.sendToTarget(); } return; return; } } if (!SubscriptionManager.isUsableSubscriptionId(subId) if (!SubscriptionManager.isUsableSubscriptionId(subId) || !mIsAllowedNetworkTypesLoadedFromDb) { || !mIsAllowedNetworkTypesLoadedFromDb) { loge("setAllowedNetworkTypes: no sim or network type is not loaded. SubscriptionId: " loge("setAllowedNetworkTypes: no sim or network type is not loaded. SubscriptionId: " + subId + ", isNetworkTypeLoaded" + mIsAllowedNetworkTypesLoadedFromDb); + subId + ", isNetworkTypeLoaded" + mIsAllowedNetworkTypesLoadedFromDb); if (response != null) { AsyncResult.forMessage(response, null, AsyncResult.forMessage(response, null, new CommandException(CommandException.Error.MISSING_RESOURCE)); new CommandException(CommandException.Error.MISSING_RESOURCE)); response.sendToTarget(); response.sendToTarget(); } return; return; } } String mapAsString = ""; String mapAsString = ""; Loading