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

Commit d4a3d032 authored by Wink Saville's avatar Wink Saville Committed by Android (Google) Code Review
Browse files

Merge "Fix SETUP_DATA_CALL handling."

parents 7e54397b 70181e2a
Loading
Loading
Loading
Loading
+18 −14
Original line number Diff line number Diff line
@@ -401,6 +401,7 @@ public abstract class DataConnection extends HierarchicalStateMachine {
                try {
                    cid = response.cid;
                    linkProperties.setInterfaceName(response.ifname);
                    if (response.addresses != null && response.addresses.length > 0) {
                        for (String addr : response.addresses) {
                            LinkAddress la;
                            if (!InetAddress.isNumeric(addr)) {
@@ -415,8 +416,11 @@ public abstract class DataConnection extends HierarchicalStateMachine {
                            }
                            linkProperties.addLinkAddress(la);
                        }

                    if (response.dnses.length != 0) {
                    } else {
                        EventLogTags.writeBadIpAddress("no address for ifname=" + response.ifname);
                        throw new UnknownHostException("no address for ifname=" + response.ifname);
                    }
                    if (response.dnses != null && response.dnses.length > 0) {
                        for (String addr : response.dnses) {
                            if (!InetAddress.isNumeric(addr)) {
                                EventLogTags.writePdpBadDnsAddress("dns=" + addr); 
+19 −13
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import android.telephony.NeighboringCellInfo;
import android.telephony.PhoneNumberUtils;
import android.telephony.SmsManager;
import android.telephony.SmsMessage;
import android.text.TextUtils;
import android.util.Config;
import android.util.Log;

@@ -2945,7 +2946,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
            dataCall.type = p.readString();
            p.readString(); // Ignore apn
            String addresses = p.readString();
            if (addresses != null) {
            if (TextUtils.isEmpty(addresses)) {
                dataCall.addresses = addresses.split(" ");
            }
        } else {
@@ -2954,12 +2955,15 @@ public final class RIL extends BaseCommands implements CommandsInterface {
            dataCall.active = p.readInt();
            dataCall.type = p.readString();
            dataCall.ifname = p.readString();
            if (TextUtils.isEmpty(dataCall.ifname)) {
              throw new RuntimeException("getDataCallState, no ifname");
            }
            String addresses = p.readString();
            if (addresses != null) {
            if (!TextUtils.isEmpty(addresses)) {
                dataCall.addresses = addresses.split(" ");
            }
            String dnses = p.readString();
            if (addresses != null) {
            if (!TextUtils.isEmpty(dnses)) {
                dataCall.dnses = dnses.split(" ");
            }
        }
@@ -2991,23 +2995,25 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        DataCallState dataCall;

        if (ver < 5) {
            if (num != 3) {
                throw new RuntimeException(
                        "RIL_REQUEST_SETUP_DATA_CALL response expecting 3 strings got " + num);
            }
            dataCall = new DataCallState();
            dataCall.version = ver;
            dataCall.cid = Integer.parseInt(p.readString());
            dataCall.ifname = p.readString();
            if (dataCall.ifname == null) {
            if (TextUtils.isEmpty(dataCall.ifname)) {
                throw new RuntimeException(
                        "RIL_REQUEST_SETUP_DATA_CALL response ifname");
                        "RIL_REQUEST_SETUP_DATA_CALL response, no ifname");
            }
            String addresses = p.readString();
            if (addresses == null) {
                throw new RuntimeException(
                "RIL_REQUEST_SETUP_DATA_CALL response no addresses");
            }
            if (!TextUtils.isEmpty(addresses)) {
              dataCall.addresses = addresses.split(" ");
            }
            if (num >= 4) {
                String dnses = p.readString();
                Log.d(LOG_TAG, "responseSetupDataCall got dnses=" + dnses);
                if (!TextUtils.isEmpty(dnses)) {
                    dataCall.dnses = dnses.split(" ");
                }
            }
        } else {
            if (num != 1) {
                throw new RuntimeException(