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

Commit 72e3b7bb authored by Shuo Qian's avatar Shuo Qian Committed by android-build-merger
Browse files

Merge "Use InetAddresses.parseNumericAddress instead of...

Merge "Use InetAddresses.parseNumericAddress instead of NetworkUtils.numericToInetAddress for Mainline."
am: ba7433e6

Change-Id: I5649cc62dd8f5330971246d7a917f1cab5c5590c
parents f20c54d2 ba7433e6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.annotation.Nullable;
import android.app.PendingIntent;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.InetAddresses;
import android.net.KeepalivePacketData;
import android.net.LinkAddress;
import android.net.LinkProperties;
@@ -32,7 +33,6 @@ import android.net.NetworkFactory;
import android.net.NetworkInfo;
import android.net.NetworkMisc;
import android.net.NetworkRequest;
import android.net.NetworkUtils;
import android.net.ProxyInfo;
import android.net.RouteInfo;
import android.net.SocketKeepalive;
@@ -1428,7 +1428,7 @@ public class DataConnection extends StateMachine {
                        if (dnsAddr.isEmpty()) continue;
                        InetAddress ia;
                        try {
                            ia = NetworkUtils.numericToInetAddress(dnsAddr);
                            ia = InetAddresses.parseNumericAddress(dnsAddr);
                        } catch (IllegalArgumentException e) {
                            throw new UnknownHostException("Non-numeric dns addr=" + dnsAddr);
                        }
+9 −9
Original line number Diff line number Diff line
@@ -111,8 +111,8 @@ import android.hardware.radio.V1_0.SmsWriteArgs;
import android.hardware.radio.V1_5.IRadio;
import android.hardware.radio.deprecated.V1_0.IOemHook;
import android.net.ConnectivityManager;
import android.net.InetAddresses;
import android.net.LinkAddress;
import android.net.NetworkUtils;
import android.os.Handler;
import android.os.IPowerManager;
import android.os.Looper;
@@ -1635,15 +1635,15 @@ public class RILTest extends TelephonyTest {

        DataCallResponse response = new DataCallResponse(0, -1, 0, 2, ApnSetting.PROTOCOL_IPV4V6,
                "ifname",
                Arrays.asList(new LinkAddress(NetworkUtils.numericToInetAddress("10.0.2.15"), 32),
                Arrays.asList(new LinkAddress(InetAddresses.parseNumericAddress("10.0.2.15"), 32),
                        new LinkAddress("2607:fb90:a620:651d:eabe:f8da:c107:44be/64")),
                Arrays.asList(NetworkUtils.numericToInetAddress("10.0.2.3"),
                        NetworkUtils.numericToInetAddress("fd00:976a::9")),
                Arrays.asList(NetworkUtils.numericToInetAddress("10.0.2.15"),
                        NetworkUtils.numericToInetAddress("fe80::2")),
                Arrays.asList(NetworkUtils.numericToInetAddress("fd00:976a:c206:20::6"),
                        NetworkUtils.numericToInetAddress("fd00:976a:c206:20::9"),
                        NetworkUtils.numericToInetAddress("fd00:976a:c202:1d::9")), 1500);
                Arrays.asList(InetAddresses.parseNumericAddress("10.0.2.3"),
                        InetAddresses.parseNumericAddress("fd00:976a::9")),
                Arrays.asList(InetAddresses.parseNumericAddress("10.0.2.15"),
                        InetAddresses.parseNumericAddress("fe80::2")),
                Arrays.asList(InetAddresses.parseNumericAddress("fd00:976a:c206:20::6"),
                        InetAddresses.parseNumericAddress("fd00:976a:c206:20::9"),
                        InetAddresses.parseNumericAddress("fd00:976a:c202:1d::9")), 1500);

        assertEquals(response, RIL.convertDataCallResult(result10));

+19 −19
Original line number Diff line number Diff line
@@ -22,8 +22,8 @@ import static com.android.internal.telephony.dataconnection.DcTrackerTest.FAKE_G
import static com.android.internal.telephony.dataconnection.DcTrackerTest.FAKE_IFNAME;
import static com.android.internal.telephony.dataconnection.DcTrackerTest.FAKE_PCSCF_ADDRESS;

import android.net.InetAddresses;
import android.net.LinkAddress;
import android.net.NetworkUtils;
import android.os.Parcel;
import android.telephony.data.ApnSetting;
import android.telephony.data.DataCallResponse;
@@ -38,10 +38,10 @@ public class DataCallResponseTest extends AndroidTestCase {
    public void testParcel() throws Exception {
        DataCallResponse response = new DataCallResponse(0, -1, 1, 2,
                ApnSetting.PROTOCOL_IP, FAKE_IFNAME,
                Arrays.asList(new LinkAddress(NetworkUtils.numericToInetAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_DNS)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_GATEWAY)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_PCSCF_ADDRESS)),
                Arrays.asList(new LinkAddress(InetAddresses.parseNumericAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_DNS)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_GATEWAY)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_PCSCF_ADDRESS)),
                1440);

        Parcel p = Parcel.obtain();
@@ -56,18 +56,18 @@ public class DataCallResponseTest extends AndroidTestCase {
    public void testEquals() throws Exception {
        DataCallResponse response = new DataCallResponse(0, -1, 1, 2,
                ApnSetting.PROTOCOL_IP, FAKE_IFNAME,
                Arrays.asList(new LinkAddress(NetworkUtils.numericToInetAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_DNS)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_GATEWAY)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_PCSCF_ADDRESS)),
                Arrays.asList(new LinkAddress(InetAddresses.parseNumericAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_DNS)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_GATEWAY)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_PCSCF_ADDRESS)),
                1440);

        DataCallResponse response1 = new DataCallResponse(0, -1, 1, 2,
                ApnSetting.PROTOCOL_IP, FAKE_IFNAME,
                Arrays.asList(new LinkAddress(NetworkUtils.numericToInetAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_DNS)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_GATEWAY)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_PCSCF_ADDRESS)),
                Arrays.asList(new LinkAddress(InetAddresses.parseNumericAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_DNS)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_GATEWAY)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_PCSCF_ADDRESS)),
                1440);

        assertEquals(response, response);
@@ -75,12 +75,12 @@ public class DataCallResponseTest extends AndroidTestCase {

        DataCallResponse response2 = new DataCallResponse(1, -1, 1, 3,
                ApnSetting.PROTOCOL_IP, FAKE_IFNAME,
                Arrays.asList(new LinkAddress(NetworkUtils.numericToInetAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_DNS),
                        NetworkUtils.numericToInetAddress(FAKE_DNS)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_GATEWAY)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_PCSCF_ADDRESS),
                        NetworkUtils.numericToInetAddress(FAKE_PCSCF_ADDRESS)),
                Arrays.asList(new LinkAddress(InetAddresses.parseNumericAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_DNS),
                        InetAddresses.parseNumericAddress(FAKE_DNS)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_GATEWAY)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_PCSCF_ADDRESS),
                        InetAddresses.parseNumericAddress(FAKE_PCSCF_ADDRESS)),
                1441);
        assertNotSame(response1, response2);
        assertNotSame(response1, null);
+49 −49
Original line number Diff line number Diff line
@@ -40,13 +40,13 @@ import static org.mockito.Mockito.verify;

import android.content.IntentFilter;
import android.content.pm.ServiceInfo;
import android.net.InetAddresses;
import android.net.KeepalivePacketData;
import android.net.LinkAddress;
import android.net.LinkProperties;
import android.net.NattKeepalivePacketData;
import android.net.NetworkCapabilities;
import android.net.NetworkInfo;
import android.net.NetworkUtils;
import android.os.AsyncResult;
import android.os.Handler;
import android.os.HandlerThread;
@@ -422,29 +422,29 @@ public class DataConnectionTest extends TelephonyTest {
    public void testModemSuggestRetry() throws Exception {
        DataCallResponse response = new DataCallResponse(0, 0, 1, 2,
                ApnSetting.PROTOCOL_IP, FAKE_IFNAME,
                Arrays.asList(new LinkAddress(NetworkUtils.numericToInetAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_DNS)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_GATEWAY)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_PCSCF_ADDRESS)),
                Arrays.asList(new LinkAddress(InetAddresses.parseNumericAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_DNS)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_GATEWAY)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_PCSCF_ADDRESS)),
                1440);

        assertEquals(response.getSuggestedRetryTime(), getSuggestedRetryDelay(response));

        response = new DataCallResponse(0, 1000, 1, 2,
                ApnSetting.PROTOCOL_IP, FAKE_IFNAME,
                Arrays.asList(new LinkAddress(NetworkUtils.numericToInetAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_DNS)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_GATEWAY)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_PCSCF_ADDRESS)),
                Arrays.asList(new LinkAddress(InetAddresses.parseNumericAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_DNS)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_GATEWAY)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_PCSCF_ADDRESS)),
                1440);
        assertEquals(response.getSuggestedRetryTime(), getSuggestedRetryDelay(response));

        response = new DataCallResponse(0, 9999, 1, 2,
                ApnSetting.PROTOCOL_IP, FAKE_IFNAME,
                Arrays.asList(new LinkAddress(NetworkUtils.numericToInetAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_DNS)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_GATEWAY)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_PCSCF_ADDRESS)),
                Arrays.asList(new LinkAddress(InetAddresses.parseNumericAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_DNS)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_GATEWAY)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_PCSCF_ADDRESS)),
                1440);
        assertEquals(response.getSuggestedRetryTime(), getSuggestedRetryDelay(response));
    }
@@ -454,29 +454,29 @@ public class DataConnectionTest extends TelephonyTest {
    public void testModemNotSuggestRetry() throws Exception {
        DataCallResponse response = new DataCallResponse(0, -1, 1, 2,
                ApnSetting.PROTOCOL_IP, FAKE_IFNAME,
                Arrays.asList(new LinkAddress(NetworkUtils.numericToInetAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_DNS)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_GATEWAY)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_PCSCF_ADDRESS)),
                Arrays.asList(new LinkAddress(InetAddresses.parseNumericAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_DNS)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_GATEWAY)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_PCSCF_ADDRESS)),
                1440);

        assertEquals(RetryManager.NO_SUGGESTED_RETRY_DELAY, getSuggestedRetryDelay(response));

        response = new DataCallResponse(0, -5, 1, 2,
                ApnSetting.PROTOCOL_IP, FAKE_IFNAME,
                Arrays.asList(new LinkAddress(NetworkUtils.numericToInetAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_DNS)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_GATEWAY)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_PCSCF_ADDRESS)),
                Arrays.asList(new LinkAddress(InetAddresses.parseNumericAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_DNS)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_GATEWAY)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_PCSCF_ADDRESS)),
                1440);
        assertEquals(RetryManager.NO_SUGGESTED_RETRY_DELAY, getSuggestedRetryDelay(response));

        response = new DataCallResponse(0, Integer.MIN_VALUE, 1, 2,
                ApnSetting.PROTOCOL_IP, FAKE_IFNAME,
                Arrays.asList(new LinkAddress(NetworkUtils.numericToInetAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_DNS)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_GATEWAY)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_PCSCF_ADDRESS)),
                Arrays.asList(new LinkAddress(InetAddresses.parseNumericAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_DNS)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_GATEWAY)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_PCSCF_ADDRESS)),
                1440);
        assertEquals(RetryManager.NO_SUGGESTED_RETRY_DELAY, getSuggestedRetryDelay(response));
    }
@@ -486,10 +486,10 @@ public class DataConnectionTest extends TelephonyTest {
    public void testModemSuggestNoRetry() throws Exception {
        DataCallResponse response = new DataCallResponse(0, Integer.MAX_VALUE, 1, 2,
                ApnSetting.PROTOCOL_IP, FAKE_IFNAME,
                Arrays.asList(new LinkAddress(NetworkUtils.numericToInetAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_DNS)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_GATEWAY)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_PCSCF_ADDRESS)),
                Arrays.asList(new LinkAddress(InetAddresses.parseNumericAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_DNS)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_GATEWAY)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_PCSCF_ADDRESS)),
                1440);
        assertEquals(RetryManager.NO_RETRY, getSuggestedRetryDelay(response));
    }
@@ -673,10 +673,10 @@ public class DataConnectionTest extends TelephonyTest {

        DataCallResponse response = new DataCallResponse(0, -1, 1, 2,
                ApnSetting.PROTOCOL_IP, FAKE_IFNAME,
                Arrays.asList(new LinkAddress(NetworkUtils.numericToInetAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_DNS)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_GATEWAY)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_PCSCF_ADDRESS)),
                Arrays.asList(new LinkAddress(InetAddresses.parseNumericAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_DNS)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_GATEWAY)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_PCSCF_ADDRESS)),
                1440);

        LinkProperties linkProperties = new LinkProperties();
@@ -686,28 +686,28 @@ public class DataConnectionTest extends TelephonyTest {
        assertEquals(response.getAddresses().size(), linkProperties.getAddresses().size());
        for (int i = 0; i < response.getAddresses().size(); ++i) {
            assertEquals(response.getAddresses().get(i).getAddress(),
                    NetworkUtils.numericToInetAddress(linkProperties.getLinkAddresses().get(i)
                    InetAddresses.parseNumericAddress(linkProperties.getLinkAddresses().get(i)
                            .getAddress().getHostAddress()));
        }

        assertEquals(response.getDnsAddresses().size(), linkProperties.getDnsServers().size());
        for (int i = 0; i < response.getDnsAddresses().size(); ++i) {
            assertEquals("i = " + i, response.getDnsAddresses().get(i),
                    NetworkUtils.numericToInetAddress(
                    InetAddresses.parseNumericAddress(
                            linkProperties.getDnsServers().get(i).getHostAddress()));
        }

        assertEquals(response.getGatewayAddresses().size(), linkProperties.getRoutes().size());
        for (int i = 0; i < response.getGatewayAddresses().size(); ++i) {
            assertEquals("i = " + i, response.getGatewayAddresses().get(i),
                    NetworkUtils.numericToInetAddress(linkProperties.getRoutes().get(i)
                    InetAddresses.parseNumericAddress(linkProperties.getRoutes().get(i)
                            .getGateway().getHostAddress()));
        }

        assertEquals(response.getPcscfAddresses().size(), linkProperties.getPcscfServers().size());
        for (int i = 0; i < response.getPcscfAddresses().size(); ++i) {
            assertEquals("i = " + i, response.getPcscfAddresses().get(i),
                    NetworkUtils.numericToInetAddress(linkProperties.getPcscfServers().get(i)
                    InetAddresses.parseNumericAddress(linkProperties.getPcscfServers().get(i)
                            .getHostAddress()));
        }

@@ -722,9 +722,9 @@ public class DataConnectionTest extends TelephonyTest {
        DataCallResponse response = new DataCallResponse(0, -1, 1, 2,
                ApnSetting.PROTOCOL_IP, FAKE_IFNAME,
                null,
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_DNS)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_GATEWAY)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_PCSCF_ADDRESS)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_DNS)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_GATEWAY)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_PCSCF_ADDRESS)),
                1440);

        LinkProperties linkProperties = new LinkProperties();
@@ -739,10 +739,10 @@ public class DataConnectionTest extends TelephonyTest {
        // Empty dns entry.
        DataCallResponse response = new DataCallResponse(0, -1, 1, 2,
                ApnSetting.PROTOCOL_IP, FAKE_IFNAME,
                Arrays.asList(new LinkAddress(NetworkUtils.numericToInetAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(new LinkAddress(InetAddresses.parseNumericAddress(FAKE_ADDRESS), 0)),
                null,
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_GATEWAY)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_PCSCF_ADDRESS)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_GATEWAY)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_PCSCF_ADDRESS)),
                1440);

        // Make sure no exception was thrown
@@ -766,9 +766,9 @@ public class DataConnectionTest extends TelephonyTest {
        // Construct a new KeepalivePacketData request as we would receive from a Network Agent,
        // and check that the packet is sent to the RIL.
        KeepalivePacketData kd = NattKeepalivePacketData.nattKeepalivePacket(
                NetworkUtils.numericToInetAddress("1.2.3.4"),
                InetAddresses.parseNumericAddress("1.2.3.4"),
                1234,
                NetworkUtils.numericToInetAddress("8.8.8.8"),
                InetAddresses.parseNumericAddress("8.8.8.8"),
                4500);
        mDc.obtainMessage(
                DataConnection.EVENT_KEEPALIVE_START_REQUEST, slotId, interval, kd).sendToTarget();
@@ -790,9 +790,9 @@ public class DataConnectionTest extends TelephonyTest {
        // Construct a new KeepalivePacketData request as we would receive from a Network Agent,
        // and check that the packet is sent to the RIL.
        KeepalivePacketData kd = NattKeepalivePacketData.nattKeepalivePacket(
                NetworkUtils.numericToInetAddress("1.2.3.4"),
                InetAddresses.parseNumericAddress("1.2.3.4"),
                1234,
                NetworkUtils.numericToInetAddress("8.8.8.8"),
                InetAddresses.parseNumericAddress("8.8.8.8"),
                4500);
        mDc.obtainMessage(
                DataConnection.EVENT_KEEPALIVE_START_REQUEST, slotId, interval, kd).sendToTarget();
@@ -869,9 +869,9 @@ public class DataConnectionTest extends TelephonyTest {
        // Construct a new KeepalivePacketData request as we would receive from a Network Agent,
        // and check that the packet is sent to the RIL.
        KeepalivePacketData kd = NattKeepalivePacketData.nattKeepalivePacket(
                NetworkUtils.numericToInetAddress("1.2.3.4"),
                InetAddresses.parseNumericAddress("1.2.3.4"),
                1234,
                NetworkUtils.numericToInetAddress("8.8.8.8"),
                InetAddresses.parseNumericAddress("8.8.8.8"),
                4500);
        mDc.obtainMessage(
                DataConnection.EVENT_KEEPALIVE_START_REQUEST, slotId, interval, kd).sendToTarget();
+5 −5
Original line number Diff line number Diff line
@@ -30,9 +30,9 @@ import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

import android.net.InetAddresses;
import android.net.LinkAddress;
import android.net.LinkProperties;
import android.net.NetworkUtils;
import android.os.AsyncResult;
import android.os.Handler;
import android.os.Looper;
@@ -118,10 +118,10 @@ public class DcControllerTest extends TelephonyTest {
        ArrayList<DataCallResponse> l = new ArrayList<DataCallResponse>();
        DataCallResponse dcResponse = new DataCallResponse(0, -1, 1,
                DATA_CONNECTION_ACTIVE_PH_LINK_DORMANT, ApnSetting.PROTOCOL_IP, FAKE_IFNAME,
                Arrays.asList(new LinkAddress(NetworkUtils.numericToInetAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_DNS)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_GATEWAY)),
                Arrays.asList(NetworkUtils.numericToInetAddress(FAKE_PCSCF_ADDRESS)),
                Arrays.asList(new LinkAddress(InetAddresses.parseNumericAddress(FAKE_ADDRESS), 0)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_DNS)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_GATEWAY)),
                Arrays.asList(InetAddresses.parseNumericAddress(FAKE_PCSCF_ADDRESS)),
                1440);

        l.add(dcResponse);
Loading