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

Commit 9956bada authored by Chalard Jean's avatar Chalard Jean
Browse files

[NS A31] Simplification

The condition this is testing for cannot actually be false.

The only place where the code writes a null value into this
map is at the end of computeRequestReassignmentForNetwork :
reassignedRequests.put(nri, null).
This proves the code the if() block, which proves that
newNetwork.isSatisfyingRequest(nri.request.requestId) is true.

By definition newNetwork.isSatisfyingRequest(nri) implies that
nri.mSatifier == newNetwork, which proves that
previousSatisfier == newNetwork whenever newSatisfier is null.

Fixes: 146482072
Test: FrameworksNetTests
Change-Id: Ifd6faedce7d49757b82a5f341076ab208b0ccfcb
parent 59954c81
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -6586,15 +6586,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
                            " request " + nri.request.requestId);
                }
                newNetwork.removeRequest(nri.request.requestId);
                if (previousSatisfier == newNetwork) {
                nri.mSatisfier = null;
                if (isDefaultRequest(nri)) mDefaultNetworkNai = null;
                sendUpdatedScoreToFactories(nri.request, null);
                } else {
                    Slog.wtf(TAG, "BUG: Removing request " + nri.request.requestId + " from " +
                            newNetwork.name() +
                            " without updating mSatisfier or providers!");
                }
            }
        }
    }