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

Commit 3884eeeb authored by Remi NGUYEN VAN's avatar Remi NGUYEN VAN Committed by android-build-merger
Browse files

Merge changes from topic "bindprocess-resolv" am: 643e60b0 am: 291e3726

am: 7a71796b

Change-Id: I3f35e6719db4a1152281d1143e8756e726d51e64
parents c85d681c 7a71796b
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -4022,10 +4022,17 @@ public class ConnectivityManager {
    @Deprecated
    public static boolean setProcessDefaultNetwork(@Nullable Network network) {
        int netId = (network == null) ? NETID_UNSET : network.netId;
        if (netId == NetworkUtils.getBoundNetworkForProcess()) {
            return true;
        boolean isSameNetId = (netId == NetworkUtils.getBoundNetworkForProcess());

        if (netId != NETID_UNSET) {
            netId = network.getNetIdForResolv();
        }

        if (!NetworkUtils.bindProcessToNetwork(netId)) {
            return false;
        }
        if (NetworkUtils.bindProcessToNetwork(netId)) {

        if (!isSameNetId) {
            // Set HTTP proxy system properties to match network.
            // TODO: Deprecate this static method and replace it with a non-static version.
            try {
@@ -4039,10 +4046,9 @@ public class ConnectivityManager {
            // Must flush socket pool as idle sockets will be bound to previous network and may
            // cause subsequent fetches to be performed on old network.
            NetworkEventDispatcher.getInstance().onNetworkConfigurationChanged();
            return true;
        } else {
            return false;
        }

        return true;
    }

    /**