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

Commit 4be10a24 authored by Lorenzo Colitti's avatar Lorenzo Colitti
Browse files

Keep ConnectivityServiceMock in sync with reality.

Bug: 23113288
Change-Id: Ic16841cc746a1a35eb6b9325d350c9c860b81dd6
parent 64fbcce9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -315,7 +315,7 @@ public class ConnectivityServiceMock extends IConnectivityManager.Stub
        NetworkAgentInfo nai = mNetworkAgentInfos.get(msg.replyTo);
        if (nai != null) {
            if (DBG) {
                log(nai.name() + " got DISCONNECTED, was satisfying " + nai.networkRequests.size());
                log(nai.name() + " got DISCONNECTED, was satisfying " + nai.numNetworkRequests());
            }
            // A network agent has disconnected.
            // TODO - if we move the logic to the network agent (have them disconnect
@@ -948,8 +948,8 @@ public class ConnectivityServiceMock extends IConnectivityManager.Stub
    }

    private void sendUpdatedScoreToFactories(NetworkAgentInfo nai) {
        for (int i = 0; i < nai.networkRequests.size(); i++) {
            NetworkRequest nr = nai.networkRequests.valueAt(i);
        for (int i = 0; i < nai.numNetworkRequests(); i++) {
            NetworkRequest nr = nai.requestAt(i);
            // Don't send listening requests to factories. b/17393458
            if (!isRequest(nr)) continue;
                sendUpdatedScoreToFactories(nr, nai.getCurrentScore());