Revert "[NS D07] Use the unmodified legacy score"

Revert submission 10343065

Reason for revert: This is part of a feature that was punted out of R.
Reverted Changes:
Ic9a3d3363:[NS D05] Rework how to tear down networks
I7d815f873:[NS D06] Implement more policies
I561098476:[NS D07] Use the unmodified legacy score

Change-Id: I184817e3aa290afdbe6721a7c36332b940434d3a
This commit is contained in:
Chalard Jean
2020-02-20 07:32:12 +00:00
parent 4bb5b45830
commit b104cd7c12
3 changed files with 4 additions and 2 deletions

View File

@@ -58,7 +58,7 @@ public class NetworkRanker {
NetworkAgentInfo bestNetwork = null;
int bestScore = Integer.MIN_VALUE;
for (final NetworkAgentInfo nai : candidates) {
final int score = nai.getNetworkScore().getLegacyScore();
final int score = nai.getCurrentScore();
if (score > bestScore) {
bestNetwork = nai;
bestScore = score;

View File

@@ -5846,7 +5846,7 @@ public class ConnectivityServiceTest {
mWiFiNetworkAgent = new TestNetworkAgentWrapper(TRANSPORT_WIFI);
mWiFiNetworkAgent.connect(true);
trustedCallback.expectAvailableThenValidatedCallbacks(mWiFiNetworkAgent);
trustedCallback.expectAvailableDoubleValidatedCallbacks(mWiFiNetworkAgent);
verify(mNetworkManagementService).setDefaultNetId(eq(mWiFiNetworkAgent.getNetwork().netId));
reset(mNetworkManagementService);

View File

@@ -28,6 +28,8 @@ import androidx.test.filters.SmallTest
import androidx.test.runner.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.ArgumentMatchers.any
import org.mockito.Mockito.doReturn
import org.mockito.Mockito.mock
import kotlin.test.assertEquals
import kotlin.test.assertNull