[NS09] Implement the new ranking code
At this stage, this is turned off. Unit tests will be in a followup change. Test: In a followup Bug: 167544279 Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f Merged-In: I4448a3546fbc1a3dddf757982c031c5f39ba2889 Change-Id: I4448a3546fbc1a3dddf757982c031c5f39ba2889 (cherry-picked from ag/14010222 with fixes)
This commit is contained in:
@@ -7901,7 +7901,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
NetworkAgentInfo bestNetwork = null;
|
||||
NetworkRequest bestRequest = null;
|
||||
for (final NetworkRequest req : nri.mRequests) {
|
||||
bestNetwork = mNetworkRanker.getBestNetwork(req, nais);
|
||||
bestNetwork = mNetworkRanker.getBestNetwork(req, nais, nri.getSatisfier());
|
||||
// Stop evaluating as the highest possible priority request is satisfied.
|
||||
if (null != bestNetwork) {
|
||||
bestRequest = req;
|
||||
@@ -8154,7 +8154,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
@NonNull final NetworkOffer offer, @NonNull final NetworkRanker networkRanker) {
|
||||
final NetworkRequest activeRequest = nri.isBeingSatisfied() ? nri.getActiveRequest() : null;
|
||||
final NetworkAgentInfo satisfier = null != activeRequest ? nri.getSatisfier() : null;
|
||||
final FullScore satisfierScore = null != satisfier ? satisfier.getScore() : null;
|
||||
|
||||
// Multi-layer requests have a currently active request, the one being satisfied.
|
||||
// Since the system will try to bring up a better network than is currently satisfying
|
||||
@@ -8193,7 +8192,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
||||
&& satisfier.factorySerialNumber == offer.providerId;
|
||||
final boolean newNeeded = (currentlyServing
|
||||
|| (activeRequest.canBeSatisfiedBy(offer.caps)
|
||||
&& networkRanker.mightBeat(activeRequest, satisfierScore, offer)));
|
||||
&& networkRanker.mightBeat(activeRequest, satisfier, offer)));
|
||||
if (newNeeded != oldNeeded) {
|
||||
if (newNeeded) {
|
||||
offer.onNetworkNeeded(activeRequest);
|
||||
|
||||
Reference in New Issue
Block a user