Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c1e3ba1 authored by Ling Ma's avatar Ling Ma Committed by Automerger Merge Worker
Browse files

Merge "BugFix - null check" am: 3356457d am: 5bdecb61 am: d1af2d34

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1960980

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