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

Commit 7cb9bf2e authored by Sooraj Sasindran's avatar Sooraj Sasindran Committed by Android (Google) Code Review
Browse files

Merge "Remove usage of hidden APIs"

parents e9164979 6f0328c5
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -88,6 +88,8 @@ import com.android.internal.util.Protocol;
import com.android.internal.util.State;
import com.android.internal.util.StateMachine;

import libcore.net.InetAddressUtils;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.io.StringWriter;
@@ -1387,7 +1389,11 @@ public class DataConnection extends StateMachine {
    public static boolean isIpAddress(String address) {
        if (address == null) return false;

        return InetAddress.isNumeric(address);
        // Accept IPv6 addresses (only) in square brackets for compatibility.
        if (address.startsWith("[") && address.endsWith("]") && address.indexOf(':') != -1) {
            address = address.substring(1, address.length() - 1);
        }
        return InetAddressUtils.isNumericAddress(address);
    }

    private SetupResult setLinkProperties(DataCallResponse response,
@@ -1461,7 +1467,8 @@ public class DataConnection extends StateMachine {
                for (InetAddress gateway : response.getGatewayAddresses()) {
                    // Allow 0.0.0.0 or :: as a gateway;
                    // this indicates a point-to-point interface.
                    linkProperties.addRoute(new RouteInfo(gateway));
                    linkProperties.addRoute(new RouteInfo(null, gateway, null,
                            RouteInfo.RTN_UNICAST));
                }

                // set interface MTU
+2 −1
Original line number Diff line number Diff line
@@ -2770,7 +2770,8 @@ public class DcTracker extends Handler {
                checkDataRoamingStatus(false);

                boolean isProvApn = apnContext.isProvisioningApn();
                final ConnectivityManager cm = ConnectivityManager.from(mPhone.getContext());
                final ConnectivityManager cm = (ConnectivityManager) mPhone.getContext()
                        .getSystemService(Context.CONNECTIVITY_SERVICE);
                if (mProvisionBroadcastReceiver != null) {
                    mPhone.getContext().unregisterReceiver(mProvisionBroadcastReceiver);
                    mProvisionBroadcastReceiver = null;