Set TRANSPORT_PRIMARY for VCN NetworkOffers and NetworkAgents

This change sets TRANSPORT_PRIMARY for all NetworkScore objects passed
to ConnectivityService by the VCN. Without this patch, a VCN in safe
mode will never get any NetworkRequests, since the new Policy-based
NetworkRanker always prioritizes a existing satisfier of a network,
regardless of score. However, a higher-priority policy check ensures
that a TRANSPORT_PRIMARY request is used if it exists. This changes the
VCN to utilize that functionality.

Bug: 194122634
Test: atest FrameworksVcnTests
Original-Change: https://android-review.googlesource.com/1772025
Merged-In: I3a298a6c4c594c6e224f3f05764614802c00e9b0
Change-Id: I3a298a6c4c594c6e224f3f05764614802c00e9b0
This commit is contained in:
Benedict Wong
2021-07-21 02:05:47 +00:00
parent 019189c35a
commit 8d35744f98
2 changed files with 8 additions and 3 deletions

View File

@@ -87,8 +87,8 @@ public class VcnNetworkProviderTest {
eq(mVcnNetworkProvider),
argThat(
score ->
score.getLegacyInt()
== Vcn.getNetworkScore().getLegacyInt()),
score.getLegacyInt() == Vcn.getNetworkScore().getLegacyInt()
&& score.isTransportPrimary()),
any(),
any(),
cbCaptor.capture());