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

Commit 6aa6a502 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "server: Corrected the L MR1 Merge issues"

parents 5195a45d 4cc54665
Loading
Loading
Loading
Loading
+15 −18
Original line number Diff line number Diff line
@@ -2283,29 +2283,26 @@ public class ConnectivityService extends IConnectivityManager.Stub

    private void handleRegisterNetworkRequest(Message msg) {
        final NetworkRequestInfo nri = (NetworkRequestInfo) (msg.obj);
        final NetworkCapabilities newCap = nri.request.networkCapabilities;	
        int score = 0;
        mNetworkRequests.put(nri.request, nri);

        // Check for the best currently alive network that satisfies this request
        NetworkAgentInfo bestNetwork = null;
        for (NetworkAgentInfo network : mNetworkAgentInfos.values()) {
            if (DBG) log("handleRegisterNetworkRequest checking " + network.name());
            if (newCap.satisfiedByNetworkCapabilities(network.networkCapabilities)) {
            if (network.satisfies(nri.request)) {
                if (DBG) log("apparently satisfied.  currentScore=" + network.getCurrentScore());
                if ((bestNetwork == null) ||
                        bestNetwork.getCurrentScore() < network.getCurrentScore()) {
                if (!nri.isRequest) {
                   // Not setting bestNetwork here as a listening NetworkRequest may be
                   // satisfied by multiple Networks.  Instead the request is added to
                   // each satisfying Network and notified about each.
                   network.addRequest(nri.request);
                   notifyNetworkCallback(network, nri);
                    } else {
                } else if (bestNetwork == null ||
                   bestNetwork.getCurrentScore() < network.getCurrentScore()) {
                   bestNetwork = network;
                }
            }
        }
        }
        if (mNetworkForRequestId.get(nri.request.requestId)!=null) {
            if (DBG) log("ignoring duplicate request");
        } else {
@@ -2320,7 +2317,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
                bestNetwork.addRequest(nri.request);
                mNetworkForRequestId.put(nri.request.requestId, bestNetwork);
                notifyNetworkCallback(bestNetwork, nri);
                score = bestNetwork.getCurrentScore();
                if (nri.isRequest && nri.request.legacyType != TYPE_NONE) {
                    //To support legacy calls for network request
                    mLegacyTypeTracker.add(nri.request.legacyType, bestNetwork);
@@ -2329,6 +2325,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
            mNetworkRequests.put(nri.request, nri);
            if (nri.isRequest) {
                if (DBG) log("sending new NetworkRequest to factories");
                final int score = bestNetwork == null ? 0 : bestNetwork.getCurrentScore();
                    for (NetworkFactoryInfo nfi : mNetworkFactoryInfos.values()) {
                    nfi.asyncChannel.sendMessage(android.net.NetworkFactory.CMD_REQUEST_NETWORK,
                            score, 0, nri.request);
@@ -4461,8 +4458,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
                // TODO: support proxy per network.
            }
            // Consider network even though it is not yet validated.
            //FIXME: L-MR1 fix
            //rematchNetworkAndRequests(networkAgent, false);
            rematchNetworkAndRequests(networkAgent, NascentState.NOT_JUST_VALIDATED,
                                         ReapUnvalidatedNetworks.REAP);
            int val = SystemProperties.getInt("persist.cne.feature", 0);
            boolean isPropFeatureEnabled = (val == 3) ? true : false;
            if (isPropFeatureEnabled) {