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

Commit 6f0328c5 authored by Sooraj Sasindran's avatar Sooraj Sasindran
Browse files

Remove usage of hidden APIs

Remove usage of hidden core/net APIs

Test: build
Bug: 137202333
Change-Id: I9660dfe6cd6b5a1faf046ad739d93e17c59e9a3d
parent 083c03cc
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;
@@ -1377,7 +1379,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,
@@ -1451,7 +1457,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
@@ -2822,7 +2822,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;