Commit Graph

225 Commits

Author SHA1 Message Date
Benedict Wong
b1f2cc2814 Merge "Add VCN underlying networks" am: 447fbc3788 am: b9c06bc020
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1750241

Change-Id: I93ec50a1004dc79352dd72270828cb199e0e150d
2021-07-02 19:12:53 +00:00
Benedict Wong
447fbc3788 Merge "Add VCN underlying networks" 2021-07-02 18:42:43 +00:00
Benedict Wong
1bfdfa2754 Add VCN underlying networks
This change declares underlying networks for the VCN for the purposes of
app data accounting

Bug: 190620024
Test: atest FrameworksVcnTests
Change-Id: Ida2cd5975250604064b0baed00bc7c201ea97c5e
2021-07-01 19:49:57 -07:00
Benedict Wong
f241f1c3af Merge "Fix dangling NetworkAgent" am: 6ff2b288f6 am: 7d3359abba
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1748961

Change-Id: Ie8acd1ef22cf1edf82068c2b814970dde6e6af7e
2021-06-25 23:42:03 +00:00
Benedict Wong
6ff2b288f6 Merge "Fix dangling NetworkAgent" 2021-06-25 23:02:37 +00:00
Benedict Wong
7207a83ca8 Fix dangling NetworkAgent
This change fixes the potential for a networkAgent to be left dangling,
due to a situation where a VcnGatewayConnection shuts down, but fails to
unregister it's NetworkAgent.

The root cause was that the NetworkAgent was not unregistered when
moving to the DisconnectedState from the RetryTimeoutState, and the new
state assumed that there was no NetworkAgent, and thus failed to close
it when disconnecting.

Thus, this change ensures that the NetworkAgent is closed before moving
to the DisconnectedState. Additionally, it adds safety-checks to
onQuitting(), ensuring that if all else fails, these fields are cleaned
up.

Lastly, this change adds the specific gateway reference to facilitate
future debugging of issues such as this where there is potential for
duplicate networks, or gateway connections.

Bug: 191707296
Test: atest FrameworksVcnTests
Change-Id: I84cd43a0c136662f5c2d229650f1f5f889e6f144
2021-06-25 19:37:17 +00:00
Yan Yan
627f34fab2 Merge "Include IkeTunnelConnectionParams in #hashCode and #equals" am: 320056b32d am: 8d9fa0b9e6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1742657

Change-Id: I061ad3d218a460a7f859fe442b1111f3432ae28c
2021-06-23 02:18:09 +00:00
Yan Yan
320056b32d Merge "Include IkeTunnelConnectionParams in #hashCode and #equals" 2021-06-22 22:41:03 +00:00
Yan Yan
16006a61b9 Include IkeTunnelConnectionParams in #hashCode and #equals
This commit includes IkeTunnelConnectionParams in
VcnGatewayConnectionConfig#hashCode and
VcnGatewayConnectionConfig#equals.

This commit fixes the issue that VcnGatewayConnection was not
being restarted as expected.

Bug: 191317512
Test: atest FrameworksVcnTests (new tests added)
Test: atest CtsVcnTestCases
Change-Id: I70182f9b645e55eced1e0a048a1bd87778c1c0f6
2021-06-22 11:37:38 -07:00
Cody Kesting
3cda366aec Merge "Update Mobile Data State on subscription changes." am: cb85575990 am: e8dca29970
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1740514

Change-Id: I5a668d555b9cd9ade06d9c68bccc83f97c5d4792
2021-06-18 02:18:22 +00:00
Cody Kesting
0da0fb106e Update Mobile Data State on subscription changes.
This CL ensures that Vcn instances refresh their mobile data state
when they receive a new TelephonySubscriptionSnapshot. A new snapshot
may contain different subId -> subGroup mappings, which can affect
whether a Vcn instance's subGroup has mobile data enabled or not. This
in turn can change which VcnGatewayConnections are brought up by the
Vcn.

Bug: 191394092
Test: atest FrameworksVcnTests CtsVcnTestCases
Change-Id: Ib59b4ed7900a177b17ed4a6e197e271b10937f65
2021-06-17 14:58:45 -07:00
Cody Kesting
705021aa6b Convert VcnNetworkProvider to use NetworkOffers
This change brings VcnNetworkProvider to full functionality in the new
NetworkProvider paradigm, where NetworkProviders offer networks, and are
notified based on NetworkOfferCallbacks.

Bug: 185204197
Test: atest FrameworksVcnTests
Change-Id: I88c69c0be9f6fd81839fb1595ed00341001694a5
Merged-In: I88c69c0be9f6fd81839fb1595ed00341001694a5
2021-06-15 18:13:56 -07:00
Cody Kesting
c3b6259903 Merge "Allow MANAGE_TEST_NETWORKS to register and get VCN policies." am: 7b02279e0a am: 9a83740d0e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1719273

Change-Id: I75e45e456321eceaf4489379afa952df27ec9b41
2021-06-10 23:29:55 +00:00
Cody Kesting
1fd3dadc22 Allow MANAGE_TEST_NETWORKS to register and get VCN policies.
This CL updates VcnManagementService to allow permission
MANAGE_TEST_NETWORKS to register/unregister VCN policy listers as
well as apply VCN policies. Previously, only permission
NETWORK_FACTORY was allowed to perform this operations.

Bug: 189125789
Test: atest FrameworksVcnTests CtsVcnTestCases
Change-Id: I6ad3a58f4ef87d931917fbd772a810af81b27da1
2021-06-09 11:52:53 -07:00
Benedict Wong
66a2885fa5 Merge changes I5ce7fe05,I2d5dc5b9,Ibcc4bdc0 into sc-dev am: 211f7f9e20
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14702006

Change-Id: I83e9611f1bb3442b77a9ee72f6bfa0575033b8f8
2021-05-26 11:05:10 +00:00
Benedict Wong
e237e35dff Copy up/downstream bandwidth and TCP buffer sizes from underlying
This change copies the relevant pieces of information used to tune the
system for performance

Bug: 188943592
Test: atest FrameworksVcnTests
Change-Id: I2d5dc5b9000fa9d0da9d34772b3704110694c526
Merged-In: I2d5dc5b9000fa9d0da9d34772b3704110694c526
(cherry picked from commit 9d92b77ad7)
2021-05-25 15:48:40 -07:00
Benedict Wong
9d92b77ad7 Copy up/downstream bandwidth and TCP buffer sizes from underlying
This change copies the relevant pieces of information used to tune the
system for performance

Bug: 188943592
Test: atest FrameworksVcnTests
Change-Id: I2d5dc5b9000fa9d0da9d34772b3704110694c526
2021-05-24 17:23:04 -07:00
Benedict Wong
b9b8c45d66 Merge "Make VcnTransportInfo unparcel to null if no data contained" into sc-dev am: e0ee346120
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14554154

Change-Id: I419ab78dbca7e418f702ad93b90dc481ff90578b
2021-05-14 23:18:15 +00:00
Benedict Wong
6452f6f978 Merge "Remove underlying network caps" am: 886e94b0a3 am: a6006f1d44
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1709008

Change-Id: I9dc2ede9a3e01b1f6988e847d2176a33c159a7fb
2021-05-14 23:13:41 +00:00
Nathan Harold
e386a1fbe8 Merge "Update VCN Owners Post-Initial-Development" am: 4b8d448b3b am: b9ec9c28ef
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1709010

Change-Id: I5fd07130187aed119c27d25082981964b7d12597
2021-05-14 23:12:57 +00:00
Benedict Wong
e0ee346120 Merge "Make VcnTransportInfo unparcel to null if no data contained" into sc-dev 2021-05-14 23:00:21 +00:00
Benedict Wong
d9695aced3 Make VcnTransportInfo unparcel to null if no data contained
When VcnTransportInfo is redacted, it contains no useful information. In
order to preserve the abstraction, the VcnTransportInfo should be
unparcelled to null


Bug: 8675309
Test: atest VcnTransportInfoTest
Change-Id: Ia9dbb9f259027acc74004eb1207e0a13cea56088
2021-05-14 22:53:51 +00:00
Benedict Wong
886e94b0a3 Merge "Remove underlying network caps" 2021-05-14 22:40:54 +00:00
Benedict Wong
b2632543c0 Remove underlying network caps
Bug: 182219992
Test: atest FrameworksVcnTests
Change-Id: Ic2fec8a87fd19a1780333c61759c4092598d349e
2021-05-14 15:28:34 -07:00
Nathan Harold
e0f865d554 Update VCN Owners Post-Initial-Development
Owners files update for VCN now that primary development
is complete and the codebase is stable.

Bug: 8675309
Test: compilation
Change-Id: Ie686729b33f0a7e1c3414374ce4bf3d7ef514a22
2021-05-14 15:05:26 -07:00
Benedict Wong
d9c05c23e6 Merge "Custom network selection" am: bc3638ce5d am: b3f0495383 am: 2a86eae65e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1706226

Change-Id: Icdf319d564e4eab468d9d4e722716a2ef7d2c3cd
2021-05-14 05:25:38 +00:00
Benedict Wong
9028cac4fe Custom network selection
This change adds a basic prioritization framework in the VCN, and signal
strength thresholds for WiFi.

Bug: 188104094
Test: atest FrameworksVcnTests
Change-Id: Iee4e3dbecf1102ddc127a8c8daf08a00b6fccbbd
2021-05-13 18:57:05 -07:00
Lorenzo Colitti
34748be150 Make VcnTransportInfoTest pass on AOSP.
AOSP contains the core networking redaction changes, but not the
wifi redaction changes, so the tests that depend on wifi S
behaviour will not pass on AOSP.

Fix testApplicableRedactions by checking that the applicable
redactions are the same ones as returned by the underlying
WifiInfo object.

Fix testMakeCopyRedactForAccessFineLocation by testing the wifi
redaction code iff Build.VERSION.SDK_INT is S or later. This is
different from SdkLevel.isAtLeastS, because the latter returns
true in AOSP.

Bug: 183938194
Test: atest VcnTransportInfoTest
Change-Id: Ia5bc896c92be19f570638f8051492e0f2d7342f9
2021-05-13 20:24:20 +09:00
Lorenzo Colitti
1ad18702f1 Immediately redact VcnTransportInfo.
Redaction of NetworkCapabilities is changing from redacting at
parcel time to redacting immediately when makeCopy() is called.
Update VcnTransportInfo redaction accordingly.

Bug: 183938194
Test: atest VcnTransportInfoTest
Change-Id: I0c9406f426b66fd36b47d11799955def531c16ba
2021-05-13 20:24:20 +09:00
Cody Kesting
be6088d11c Merge changes I4b135749,If4fcaa52 am: 576dad4673 am: cd4e6ae6d6 am: 5cdc27d2ac
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1704175

Change-Id: I7d636497dbc26008e659495e4236f161c90599ab
2021-05-12 23:40:05 +00:00
Cody Kesting
576dad4673 Merge changes I4b135749,If4fcaa52
* changes:
  Restructure Test Network requests for VCN connections.
  Correct variable name in VcnManagementService.
2021-05-12 22:55:17 +00:00
Lorenzo Colitti
79d74a6448 Merge changes from topic "transportinfo-explicit-redaction" into sc-dev
* changes:
  Immediately redact VcnTransportInfo.
  Do not automatically redact TransportInfo objects.
2021-05-12 22:46:36 +00:00
Treehugger Robot
1761a873cb Merge changes Icb59b15d,I6fc6a266,I5cc340e5,I94db52a8 am: b79dcb24d0 am: 5804521e8c am: 32c2d34383
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1700309

Change-Id: Ifab0469fb2687cae7b361b5009abe152a35048c5
2021-05-12 17:16:19 +00:00
Treehugger Robot
b79dcb24d0 Merge changes Icb59b15d,I6fc6a266,I5cc340e5,I94db52a8
* changes:
  Request Test Networks for VCNs when in Test Mode.
  Specify if a VCN is in 'test-mode' in VcnContext.
  Create test-mode for VcnConfig.
  Require MOBIKE for IkeSessionParams in VCN configs.
2021-05-12 16:21:25 +00:00
Cody Kesting
da188b3719 Restructure Test Network requests for VCN connections.
This CL restructures the NetworkRequests used for TestNetworks
in UnderlyingNetworkTracker to clearly show that they only require
TRANSPORT_TEST and the relevant subIds.

Bug: 182291467
Test: atest FrameworksVcnTests CtsVcnTestCases
Change-Id: I4b135749fdde9f91c66b87b1ded921700e6440fd
2021-05-11 19:27:36 -07:00
Cody Kesting
88c5fe5e60 Request Test Networks for VCNs when in Test Mode.
This CL updates UnderlyingNetworkTracker to request Test
Networks for route selection  when the VCN it is tracking
for is in test-mode.

Bug: 182291467
Test: atest FrameworksVcnTests CtsVcnTestCases
Change-Id: Icb59b15df61ec43fe76e250977a985caa6a1dffc
2021-05-11 18:32:32 -07:00
Cody Kesting
5f65a440e2 Specify if a VCN is in 'test-mode' in VcnContext.
This CL updates VcnContext to include whether the VCN instance
it is created for is in test-mode (as specified by the VcnConfig).
This also changes the lifetime of VcnContext to be created uniquely
for each VCN instance (as opposed to a single VcnContext created in
VcnManagementService and used for all VCNs).

Bug: 182291467
Test: atest FrameworksVcnTests CtsVcnTestCases
Change-Id: I6fc6a266bf67ab2aa64202153c3c109ee98a16ca
2021-05-11 18:32:32 -07:00
Cody Kesting
fd57083e39 Create test-mode for VcnConfig.
This CL creates a test-mode for VcnConfig so that they will only
match with Test Networks. This is necessary for CTS testing so
that VCNs can run on test networks and IKE negotiations can be
injected over the Test Networks.

Bug: 182291467
Test: atest FrameworksVcnTests CtsVcnTestCases
Change-Id: I5cc340e5aaa34c5de8efafa52de49185a18d4bd3
2021-05-11 18:32:32 -07:00
Cody Kesting
92959d6774 Require MOBIKE for IkeSessionParams in VCN configs.
This CL updates VcnGatewayConnectionConfigs to require
IkeTunnelConnectionParams with MOBIKE enabled for the
IkeSessionParams. This is necessary for VCNs - without it,
they do not support IPsec mobility (one of the main features
of the VCN).

Bug: 187851560
Test: atest FrameworksVcnTests CtsVcnTestCases
Change-Id: I94db52a8c42d9fa4681fefb8f787f006933caa18
2021-05-11 16:40:56 -07:00
Lorenzo Colitti
327cff1969 Immediately redact VcnTransportInfo.
Redaction of NetworkCapabilities is changing from redacting at
parcel time to redacting immediately when makeCopy() is called.
Update VcnTransportInfo redaction accordingly.

Bug: 183938194
Test: atest VcnTransportInfoTest
Change-Id: I0c9406f426b66fd36b47d11799955def531c16ba
2021-05-11 22:47:34 +09:00
Benedict Wong
275bf90709 Merge changes from topic "vcn-fwd" am: d7d2d2a15b am: f980436b32 am: 600401154a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1682047

Change-Id: I745687f69366657dc33bfdacd878e06affd6a8ec
2021-05-11 06:10:32 +00:00
Benedict Wong
0c1a3b9db2 Apply transform to FWD policy if configured to provide tethering
This change allows the VCN to trigger the application of IpSecTransforms
as in the FWD path, ensuring that tethering works across interfaces

Bug: 185495453
Test: atest FrameworksVcnTests
Test: manual testing with cross-device tethering
Change-Id: I90fc77226ca971dbd8ac549b96a4828da1079cd5
2021-05-07 15:09:42 -07:00
Cody Kesting
dc3608af59 Merge changes I01ffdde2,Iecab1226 am: a5786a15e1 am: cbf91b3e8c am: 88d6f01bae
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1696089

Change-Id: I7888e363733ac767c43a5b6c716b45da81544830
2021-05-05 22:31:12 +00:00
Cody Kesting
a5786a15e1 Merge changes I01ffdde2,Iecab1226
* changes:
  Set NOT_VCN_MANAGED capability for Networks in VcnMgmtSvc.
  Notify policy listeners when VCN subIds change.
2021-05-05 21:27:09 +00:00
Cody Kesting
2225648d47 Notify policy listeners when VCN subIds change.
This CL updates VcnManagementService to notify policy listeners
when the subIds for any VCN instances change. This is necessary to
ensure that NetworkFactories properly update their Networks in the
event that a Network comes up under an existing VCN are properly
marked as VCN-managed.

Bug: 187112989
Test: atest FrameworksVcnTests CtsVcnTestCases
Change-Id: Iecab1226119c8fd876131c381647267f18339db2
2021-05-04 15:57:32 -07:00
Treehugger Robot
36c49f6d34 Merge "Trigger reevaluation of all requests when mobile data state changes" am: 5a2abf1341 am: aa5e3e2164 am: 0ad647a679
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1692660

Change-Id: I9677e4ba520f55df0149359f4f02c33747dc0462
2021-05-01 02:27:01 +00:00
Benedict Wong
9d8fd5d82a Trigger reevaluation of all requests when mobile data state changes
This change ensures mobile data state changes result in the reevaluation
of all NetworkRequests; ensuring that any requests that can be fulfilled
as a result of the mobile data state change start the relevant
GatewayConnections

Test: atest FrameworksVcnTests
Change-Id: I442ca2ee0fc8b9ad962a2491ddc3818535d9e042
2021-04-30 23:29:20 +00:00
Benedict Wong
795d43d31d Merge "Update set|getRetryIntervalsMs to Millis" am: c6fe30068d am: 058149884f am: 33d2807b02
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1688783

Change-Id: Ica36f177bcb4a1d6625a0bf14288f6acd3ea4224
2021-04-29 05:44:56 +00:00
Benedict Wong
c6fe30068d Merge "Update set|getRetryIntervalsMs to Millis" 2021-04-29 04:35:45 +00:00
Benedict Wong
a344e94eda Merge "Set safe mode alarm when validation reports NOT_VALID" am: 19be41cb30 am: 5bf42637a8 am: d5af4baf80
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1689285

Change-Id: Id5c0d8688d3c9be59b66d253161b8e8c941556eb
2021-04-28 02:51:12 +00:00