253 Commits

Author SHA1 Message Date
Treehugger Robot
1a0f225c83 Merge "Support parsing VcnGatewayConnectionConfig without UnderlyingNetworkPriorities" 2021-12-09 01:56:52 +00:00
Yan Yan
eae9b5d0c4 Support parsing VcnGatewayConnectionConfig without UnderlyingNetworkPriorities
This commit fixes the NullPointerException issue in converting a
PersistableBundle without UnderlyingNetworkPriorities to a
VcnGatewayConnectionConfig, by adding a null check and building
the VcnGatewayConnectionConfig with the default
UnderlyingNetworkPriority list.

Bug: 209142575
Test: atest FrameworksVcnTests (new tests), CtsVcnTestCases
Change-Id: I888d2994c86ba250c3fc9ee1851dccb5e6ef3e77
2021-12-08 12:23:28 -08:00
Yan Yan
9df3f48cb0 Merge "Update #hashCode & #equals with mUnderlyingNetworkPriorities" 2021-12-08 20:15:08 +00:00
Yan Yan
d3a7de1333 Update #hashCode & #equals with mUnderlyingNetworkPriorities
Update VcnGatewayConnectionConfig to consider
mUnderlyingNetworkPriorities in #hashCode and #equals methods

Rename #setAllowedPlmnIds and #getAllowedPlmnIds
to #setAllowedOperatorPlmnIds and #getAllowedOperatorPlmnIds

Bug: 206044122
Test: atest FrameworksVcnTests(new tests), CtsVcnTestCases
Change-Id: Id16d88024bbb7ef275da0304f2dde1413a18de10
2021-12-07 19:18:05 -08:00
Yan Yan
36a25527b4 Merge "Calculate priority based on caller configurations" 2021-12-07 18:10:47 +00:00
Yan Yan
738ed7b7b2 Calculate priority based on caller configurations
Update NetworkPriorityClassifier to calculate priority
according to the VcnUnderlyingNetworkPriority list
configured in VcnGatewayConnectionConfig

Bug: 206044122
Test: atest FrameworksVcnTests(new)
Test: atest CtsVcnTestCses
Change-Id: I55afa916af44db655a568aae2488877f2c177d59
2021-12-06 18:52:23 -08:00
Benedict Wong
4bfa0ebc53 Merge "Immediately tear down VCN network when entering Airplane Mode" 2021-12-03 21:26:06 +00:00
Benedict Wong
c0e108a497 Immediately tear down VCN network when entering Airplane Mode
This change immediately tears down the VCN network if all underlying
networks are lost, and the device is in airplane mode. This ensures
consistency where other components may not understand the lingering
behavior of the VCN network

Bug: 207014742
Test: atest FrameworksVcnTests
Change-Id: Ib05f0c4255e847eed7d8623b35c5a7dfedd920d6
2021-12-03 01:48:21 +00:00
Yan Yan
fee736f47c Support configuring VcnUnderlyingNetworkPriority in VcnGatwayConnectionConfig
Bug: 206044122
Test: atest FrameworksVcnTests(new tests)
Test: atest CtsVcnTestCases
Change-Id: I5cd2982fcbfe5ce4ee36edb91f1f9f9b55d28d9a
2021-12-01 10:34:02 -08:00
Yan Yan
0376684dea Create VcnCellUnderlyingNetworkPriority
Create VcnCellUnderlyingNetworkPriority to allow VCN callers
to configure network prioritization.

Bug: 206044122
Test: atest FrameworksVcnTests(new tests)
Test: atest CtsVcnTestCases
Change-Id: Ia7f44c5f956ff75c39e20d9761f1bd5c987644ee
2021-12-01 10:33:49 -08:00
Yan Yan
629cb6935e Create VcnUnderlyingNetworkPriority and the subclass for Wifi
Create VcnUnderlyingNetworkPriority and VcnWifiUnderlyingNetworkPriority
to allow VCN callers to configure network prioritization.

Bug: 206044122
Test: atest FrameworksVcnTests(new tests)
Test: atest CtsVcnTestCases
Change-Id: I540f826176c7085780be93e42fdbc3ff0ad537d7
2021-11-30 16:55:55 -08:00
Yan Yan
3628ecb45f Split out NetworkPriorityClassifier and UnderlyingNetworkRecord
Move UnderlyingNetworkRecord to a spearate file, and
move calculatePriorityClass to a new class NetworkPriorityClassifier.

This is a preparation CL to support vcn routeselection with
configurable network priority classes and network metric
monitors.

Bug: 206044122
Test: atest FrameworksVcnTests, CtsVcnTestCases
Change-Id: I88aa9e8dcf01524ddce9f913f40a4c712f8c878d
2021-11-23 18:11:50 -08:00
Yan Yan
3d20aa2cf8 Rename UnderlyingNetworkTracker to UnderlyingNetworkController
Bug: 206044122
Test: atest FrameworksVcnTests, CtsVcnTestCases
Change-Id: I6b4888f8252999446a29076937d9695278ff6a66
2021-11-23 18:08:26 -08:00
Benedict Wong
5fcdfc99f1 Merge "Pull underlying network MTU using Java APIs" 2021-11-09 18:08:14 +00:00
Benedict Wong
12fd089484 Pull underlying network MTU using Java APIs
This change ensures that if the VCN's underlying network MTU is not
reported via the LinkProperties APIs (as in the case of Carrier WiFi),
the kernel values will be used (as possible).

Bug: 204813618
Test: Manual testing
Test: atest FrameworksVcnTests CtsVcnTestCases
Change-Id: If291aa6b915e4da39152a679bbe3e40216b42f44
2021-11-08 23:00:35 +00:00
Lucas Lin
74ef57b885 Merge "Set underlying network of VCN" 2021-11-03 00:44:40 +00:00
lucaslin
07ca5cb00e Set underlying network of VCN
VCN has already known its underlying network, so set it into
NetworkCapabilities directly.

Bug: 191918368
Test: atest FrameworksVcnTests
Change-Id: Ibfe4f12bc5f3a8b7679d8a2c3b1b2f2161b9c9e5
2021-11-01 22:56:53 +08:00
Nagendra Prasad Nagarle Basavaraju
3afaa9e51a Support encoding/decoding IkeSessionParams with
IKE_OPTION_INITIAL_CONTACT

This commit updates IkeSessionParamsUtils to be able
to encode/decode IkeSessionParams with IKE_OPTION_INITIAL_CONTACT
to/from a PersistableBundle

If this option is set for an IKE Session, The
INITIAL CONTACT  message is sent to the peer
to ensure that old security associations (SAs)
on the peer are deleted.

Bug: 186179788
Test: atest FrameworksIkeTests
Change-Id: I4ecd36ae222d95a84e8e6897a219f8accb9ed83b
2021-10-29 03:03:51 +00:00
Benedict Wong
24e038e8a4 Merge "Always trigger safe mode callbacks" am: 831f78825b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1811936

Change-Id: Ib8cf8010996f6eb52db438f5944af4b5ee66af7a
2021-09-10 18:56:56 +00:00
Benedict Wong
971ef77ddd Always trigger safe mode callbacks
This change ensures that safe mode callbacks are always triggered from
the VcnGatewayConnection up, ensuring that if a gateway connection
is restarted and successfully validates, it will notify the Vcn class,
and kick it out of safe mode.

Previously, if a VCN had entered safe mode, and a config was updated,
the newly updated VcnGatewayConnection would be brought up as "not" in
safe mode, and thus the onSafeModeStatusChanged() callback would never
be fired if the new VcnGatewayConnection successfully connected.

Calling onSafeModeStatusChanged() multiple times is safe, and serves as
a "connection status changed" callback.

Bug: 196841140
Test: atest FrameworksVcnTests
Test: manual testing
Change-Id: I43c82ada9e9429e8283be65ab73d13075dfd6038
2021-09-01 22:48:23 +00:00
Benedict Wong
2a1b0ab7cd Merge "Set TRANSPORT_PRIMARY for VCN NetworkOffers and NetworkAgents" am: d92daec786 am: 697971f693
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1772025

Change-Id: I3d678a8d3315f884bacfd3052218416604bf3e2c
2021-07-21 02:05:47 +00:00
Benedict Wong
d92daec786 Merge "Set TRANSPORT_PRIMARY for VCN NetworkOffers and NetworkAgents" 2021-07-21 01:29:25 +00:00
Benedict Wong
8d6f7c7280 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
Change-Id: I3a298a6c4c594c6e224f3f05764614802c00e9b0
2021-07-21 00:44:19 +00:00
Benedict Wong
adcba0ef9c Merge "Ensure VcnGatewayConnection#isQuitting never gets unset after being set" am: fc9e0c982f am: e98f254f96
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1768623

Change-Id: I418557047f10b0224583f9e99770169356f07fa9
2021-07-16 22:16:36 +00:00
Benedict Wong
fc9e0c982f Merge "Ensure VcnGatewayConnection#isQuitting never gets unset after being set" 2021-07-16 21:29:36 +00:00
Benedict Wong
e8c548fd02 Ensure VcnGatewayConnection#isQuitting never gets unset after being set
This change ensures that the VcnGatewayConnection can never abort a
quitting command; specifically, if a non-quitting disconnect request is
processed after a quitting disconnect request, the isQuitting value MUST
continue to stay set (as true).

Failure to OR the values results in orphaned VcnGatewayConnection(s),
and the VCN network thrashing.

Additionally reduce verbosity of local logs, to ensure it better
captures failures and logWtf(s)

Bug: 192776413
Test: atest FrameworksVcnTests
Change-Id: Iec8dae701838794261957609bae4e270eaa9cdc7
2021-07-16 12:10:08 -07:00
Benedict Wong
ee52376594 Merge "Limit VCNs to one running at a given time" am: 9e6e3ce643 am: 4d16027790
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1767050

Change-Id: I89be4b61ec4e3a7ed24b817acf52a9c58fb5b4f2
2021-07-16 03:27:31 +00:00
Benedict Wong
3433a8e5d9 Limit VCNs to one running at a given time
This change ensures that there is only ever one VCN running at a given
point in time, and that if the device has switched to using a
subscription in a different subscription group, the VCN will immediately
tear down.

This ensures that when on a DSDS device, when the VCN-enabled
subscription is not the default/active subscription, the other
subscription's network will never be outscored by the VCN, and thus get
torn down.

Bug: 190761448
Test: atest FrameworksVcnTests
Test: Manual testing to ensure common functionality
Change-Id: I8031fab7502880d38420058451df41f47567c458
2021-07-15 12:04:05 -07:00
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 9d92b77ad79048540640a3f206c5c60b9cc02670)
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