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
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
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
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
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
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
VCN has already known its underlying network, so set it into
NetworkCapabilities directly.
Bug: 191918368
Test: atest FrameworksVcnTests
Change-Id: Ibfe4f12bc5f3a8b7679d8a2c3b1b2f2161b9c9e5
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
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
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
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
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
This change declares underlying networks for the VCN for the purposes of
app data accounting
Bug: 190620024
Test: atest FrameworksVcnTests
Change-Id: Ida2cd5975250604064b0baed00bc7c201ea97c5e
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
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
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
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
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
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)
This change copies the relevant pieces of information used to tune the
system for performance
Bug: 188943592
Test: atest FrameworksVcnTests
Change-Id: I2d5dc5b9000fa9d0da9d34772b3704110694c526
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