This CL updates VcnGatewayConnection to notify VcnManagementService
(through Vcn) when errors occur with a gateway. VcnManagementService
then notifies registered, permissioned VcnStatusCallbacks via
Bug: 163433613
Test: atest FrameworksVcnTests
Change-Id: I3be3cac4b591b19a0b0075767fde0ba2eb6e12a2
This CL updates VcnStatusCallback to have a onGatewayConnctionError()
function. This function will be used to notify callers when Gateway
Connection errors occur, such as authentication failures or the session
unexpectedly dying.
Bug: 163433613
Test: atest FrameworksVcnTests
Change-Id: I9ea6e9e850eb9d8b0d374c5447895f1f04121696
This CL requires callers to set a VcnControlPlaneConfig for
building VcnGatewayConnectionConfig
Bug: 163604823
Test: FrameworksVcnTests (new tests added)
Change-Id: If45cb2aa866d627f3bb9762309fe8b07bf729ba8
VcnControlPlaneConfig contains control plane configuration for
a VCN gateway connection. VcnControlPlaneIkeConfig is a
subclass that contains IKE configuration.
The followup CL will store VcnControlPlaneConfig in
VcnGatewayConnectionConfig.
Bug: 163604823
Test: FrameworksVcnTests(new tests added)
Change-Id: If7a85ae44e77fc4477b56ffa50c6e99ee96132d0
* changes:
Notify status callbacks when a VCN enters Safemode.
Change all 'safemode' references to use 'safe mode'.
Define VcnStatusCallback register/unregister.
Cody Kestingauthored and Gerrit Code Reviewcommited 2021-02-17 18:08:48 +00:00
This CL updates VcnManagementService to notify VcnStatusCallbacks when
the VCN for their specified subscription group enters Safemode. In order
to be notified, the registering app must also have permissions for the
specified permission.
Bug: 163433613
Test: atest FrameworksVcnTests
Change-Id: I3242ad0ee1dc406aef56253f884c2544a994869e
This CL defines VcnStatusCallbacks, which are callbacks used to register
for status updates to a specific subscription group. These Callbacks may
be registered with VcnManager at any time, but will only be invoked for
the specifies subscription group and only if the registering app has
carrier privileges for that subscription.
Bug: 163433613
Test: atest FrameworksVcnTests
Change-Id: Iefd284ae2d09676d195e2a12bf660be3596da59b
This CL updates VcnGatewayConnection to use WakeupMessages to support
Safemode detection. Safemode is entered if the VcnGatewayConnection
instance takes more than SAFEMODE_TIMEOUT_SECONDS seconds to a) go from
DisconnectedState to ConnectedState, or b) exit and re-enter
ConnectedState. If this timeout is exceeded, the instance will notify
its managing Vcn via VcnGatewayStatusCallback#onEnteredSafemode.
Bug: 178140973
Test: atest FrameworksVcnTests
Change-Id: Iff40aba639b465c3959ef383f1001be419daba4d
This change adds a VcnUnderlyingNetworkSpecifier as hidden API, for
internal use only. The purpose of the VcnUnderlyingNetworkSpecifier is to
match the specifiers for ONLY underlying (Telephony|Wifi) networks,
ensuring that the VCN does NOT create a routing loop
Bug: 179439329
Test: atest FrameworksVcnTests
Test: atest android.net.vcn
Change-Id: I0e158e1889d4462c117c46d9038f58d5adcc7e30
This CL updates VcnGatewayConnection to use WakeupMessages instead of
sendDelayedMessage() for delayed events. This change allows for
VcnGatewayConnection to guarantee that all its messages are processed
while holding WakeLocks.
Bug: 178140973
Test: atest FrameworksVcnTests
Change-Id: If8182378fe2e9dad08df88a84934b21e22e25752
This CL updates VcnGatewayConnection to acquire a WakeLock when sending
a message to the Handler queue. After every message is processed, the
state will check for additional messages and release the WakeLock if the
queue is empty.
Bug: 178140973
Test: atest FrameworksVcnTests
Change-Id: Ib108c834833cc8feb2c92c9a6c60f218618225ec
With the Network(int) constructor moving to mainline, we cannot use the
constructor, and should just create the IpSecTunnelInterface lazily, at
first use.
Bug: 165827287
Test: atest FrameworksVcnTests
Change-Id: Ic01858e0f9c80d316676cfbae5edca114655c3fe
This change removes the NOT_RESTRICTED capability for Carrier Wifi. This
is done even if a VCN is in safe mode, but will ONLY be performed if the
VCN is provisioned, and has the appropriate carrier privileges to run.
This change also fixes a test bug where the NOT_VCN_MANAGED capability
was not present in the query to getUnderlyingNetworkPolicy(), and
therefore was incorrectly passing.
Bug: 163432273
Test: atest FrameworksVcnTests
Change-Id: Iecb827b5341bdeb93ef8692c1d62f0eaf9d416ba
This CL updates VcnManager to provide a test-only method for getting
currently registered VcnUnderlyingNetworkPolicyListeners. This is
preferrable over the current method, which accesses VcnManager's private
Map directly.
Bug: 8675309
Test: atest FrameworksVcnTests
Change-Id: I7afd60ff55868ae44bfa74910ae02daf8a81b107
This change adds support for retries with incrementally increasing
delays.
Bug: 165827287
Test: atest FrameworksVcnTests
Change-Id: I414dce5882540bbe338d0bc1f40481df424821fe
Add additional tests based on proxy implementations of
ChildSessionCallback and ChildSessionConfiguration
Bug: 165827287
Test: atest FrameworksVcnTests
Change-Id: I165716a0212da7c06b9723656ffe35921cf81854
This CL updates VcnManagementService to support Safemode for VCN
instances. Specifically, VcnGatewayConnections will notify their Vcn
instance when they enter Safemode. Vcn instances will in-turn notify
VcnManagementService, which notifies all registered
UnderlyingNetworkPolicyListeners to update their policies.
Bug: 178140973
Test: atest FrameworksVcnTests
Change-Id: I3336c150e9406b3eb2330d2e86cae2ed835730bb
This CL updates VcnManagementService to notify all registered
VcnUnderlyingNetworkPolicyListeners to refresh their
UnderlyingNetworkPolicy when any VCN is added or removed.
Bug: 175914059
Test: atest FrameworksVcnTests
Change-Id: Ie87f4aa3401c6c4ba9f932130a1d475e35f59d4e
This CL adds unit testing for TelephonySubscriptionSnapshot updates in
UnderlyingNetworkTracker, Vcn, and VcnManagementService.
Bug: 177364490
Test: atest FrameworksVcnTests
Change-Id: I244744194a1360c7c7dee062a302e04f9b5efc32
This CL updates VcnManagementService to notify active VCNs when it is
notified of subscription changes by TelephonySubscriptionTracker. These
subscription changes are passed down to each VCN's
UnderlyingNetworkTracker, which determines whether it needs to register
or unregister bringup NetworkRequests based on subIds within that VCN's
Subscription Group.
Bug: 177364490
Test: atest FrameworksVcnTests
Change-Id: I15bc9aaf3d5f97046d0ce9fcf1e12c9b1e0e1446
This change implements the Connected state, ensuring that relevant
capabilities are mirrored from the underlying networks.
Bug: 165827287
Test: atest FrameworksVcnTests
Change-Id: Iedf6d879b4577d7efd40cce41cc1d5fd5021124f
This CL implements #getUnderlyingNetworkPolicy() for
VcnManagementService. Specifically, it takes the provided
NetworkCapabilities and checks for a corresponding VCN. If one exists,
a VcnUnderlyingNetworkPolicy will be returned with a copy of the
original NetworkCapabilities without the capability NOT_VCN_MANAGED and
with the unwanted capability NOT_VCN_MANAGED.
Any NetworkCapabilities without a corresponding VCN will be returned a
VcnUnderlyingNetworkPolicy with the original NetworkCapabilities intact.
Bug: 175914059
Test: atest FrameworksVcnTests
Change-Id: Icdffc4f586f58a0e5b6290d5c6449e2bbed5cab0
This CL updates UnderlyingNetworkTracker to register NetworkCallbacks.
UnderlyingNetworkTracker uses two types of NetworkCallbacks:
- bringup requests
- selection requests
Bringup requests ensure that VCN-managed Networks are not reaped.
Separate bringup requests are filed for wifi and cell Networks. One cell
request is filed for each subscription ID (subId) in the VCN's
subscription group.
Selection requests are used to allow ConnectivityService to perform
Network selection for the VCN's selected underlying Network (the Network
that VCN traffic will be routed through).
Bug: 177364490
Test: atest FrameworksVcnTests
Change-Id: Ic4dc13a3f7acf08589ddb25b343af2677cd7cf65
This CL updates VcnManager to allow system components with permission
NETWORK_FACTORY to request the current VcnUnderlingNetworkPolicy for a
specific Network's NetworkCapabilities and LinkProperties.
Bug: 175900686
Test: atest FrameworksVcnTests
Change-Id: I16416e619bdb03630582f5660260b0090730e9eb
This change implements the Connecting state, where the gateway
connection will be established. In the event of a network switch during
connection, the existing connection attempt will be aborted and
restarted on the new network in an attempt to avoid the case where the
old network is completely lost (eg wifi to cell switch), and IKE stalls
for the entire retry period.
Bug: 165827287
Test: atest FrameworksVcnTests
Change-Id: Id1c6337e8ba4cc1b97c6c20977153c230bd07723
Add @hide to methods to clearly show what is being exposed and cleanup
some visibilty/final modifiers.
Bug: 168833866
Test: atest FrameworksVcnTests
Test: atest android.net.vcn
Change-Id: I8e03133053b59fd5b8df640e4b22761f572f9548
This change implements the Disconnecting state, which provides facility
to attempt to gracefully close IKE sessions, and kill it after a few
seconds.
Bug: 165827287
Test: atest FrameworksVcnTests
Change-Id: I0d179085726b8125f2021679def75824cf71bd08
This change implements the signal handling for the Disconnected state.
Bug: 165827287
Test: atest FrameworksVcnTests
Change-Id: I4853b0801b82fddc4ef9e9c6e6a659f9b81e2ac3
This CL updates VcnManagementService to implement
VcnUnderlyingNetworkPolicyListener add and remove operations. It also
adds functionality to remove any listeners if the registering app dies
without unregistering.
Bug: 175739863
Test: atest FrameworksVcnTests
Change-Id: I9db2729d404f232b84577d2d90909b9152d53b5a