This change switches from primarily using unwanted(NOT_VCN_MANAGED) to
list-of-subIds. This opens the door for a soft-start, predicated on the
VCN-exposed networks not populating their respective subId fields.
Allowing the potential for soft-start means that the VCN can exit safe
mode without carrier app intervention, when all requested configurations
are active.
Bug: 183174340
Test: atest FrameworksVcnTests
Change-Id: I57ecf4f5f04dc5d15589b17d647661674595b872
- ConnectivityManager will be a part of mainline module, so its
hidden API cannot be called by external caller.
- There is no need to listen onNetworkSuspended() and
onNetworkResumed() because if the network is suspended, then
NET_CAPABILITY_NOT_SUSPENDED will be removed and
onCapabilitiesChanged() will be called and the network capabilities
will be different from the previous one. And when the network is
resumed, NET_CAPABILITY_NOT_SUSPENDED will be added back to the
network capabilities. So the current design can be simplified.
Bug: 182963397
Test: atest FrameworksVcnTests
Change-Id: Ib8f8ea1c95503c946b8229670512af2db8be3165
Merged-In: Ib8f8ea1c95503c946b8229670512af2db8be3165
(cherry-picked from ag/13927656)
This change registers listeners for package installs and uninstalls,
ensuring that changes to app install statuses are reflected in the VCN
Bug: 183465258
Test: atest FrameworksVcnTests
Change-Id: I8d2afd351208cac12392bf945439845cc521b7ec
This change ensures that carrier privileges for the right packages are
always checked.
Bug: 183465199
Test: atest FrameworksVcnTests
Change-Id: If46c660e54870529868a7b4b1e271c9009b81d45
This CL updates Vcn.java to reevaluate its VcnGatewayConnections when it
receives a new VcnConfig. This may result in VcnGatewayConnections being
torn down (if their VcnGatewayConnectionConfig is not in the updated
VcnConfig) or established (if a NetworkRequest matches a new
VcnGatewayConnectionConfig).
Bug: 181815405
Test: atest FrameworksVcnTests CtsVcnTestCases
Change-Id: I7da60f60e972bd968e1ff4fe416fb9a1d3309a18
This replaces the existing mechanism for redacting location sensitive
fields with a more extensible mechanism. Currently supported redactions
are for the following permissions:
i. ACCESS_FINE_LOCATION
ii. LOCAL_MAC_ADDRESS
iii. NETWORK_SETTINGS
Also, removed WifiInfo from ConnectivityServiceTest to reduce cross
dependencies on wifi code.
Bug: 156867433
Bug: 162602799
Test: atest android.net
Test: atest com.android.server
Change-Id: I2bb980c624667a55c1383f13ab71b9b97ed6eeab
As attested by numerous TODOs in the code, a new way of
representing network quality and policy is needed instead
of an int.
An int representing the quality of the network requires
all parties using it to know how all other parties are
using it, and implementation details about the decision
algorithm. For all intents and purposes, the selection
is left to individual network factories who try to
achieve a desired result while piecing together all
possible states of the system.
As the number of such cases and desires increases, this
becomes both intractable and unmaintainable. Indeed, at
this time in the codebase nobody can really predict exactly
how a given change in score will affect selection across
the board, and it is essentially impossible to figure out
the behavior of network selection by inspecting the code
because the moving parts are scattered throughout the
entire codebase.
Having an object encapsulating policy and quality values
will let us centralize the selection and make it again
possible to maintain without knowledge of all behaviors
of all network factories. It will also provide better
guarantees of respecting policy, and allow bugfixes that
were not possible before because they'd touch too many
parts of the code.
Test: FrameworksNetTests FrameworksWifiTests NetworkStackTests
Change-Id: I3185a6412b9b659798faf0c6882699e9c63cc115
This CL changes the policy listener API to be
VcnNetworkPolicyChangeListener (it was previously
VcnNetworkPolicyListener) per API Council guidance.
This CL also requires permission NETWORK_FACTORY for removing registered
policy listeners.
Bug: 181562364
Test: atest FrameworksVcnTests
Change-Id: I026eaefa62d8f64b9180fc182a7cf0605d83bf97
Merged-In: I026eaefa62d8f64b9180fc182a7cf0605d83bf97
(cherry picked from commit a96ec13821)
* changes:
Declare VCN exposed networks as NOT_VCN_MANAGED
Allow underlying cell without unwanted NOT_VCN_MANAGED capability
Override network and use config IKE session
Remove usage of hidden Connectivity APIs
This change marks VCN-exposed networks as generic use, NOT_VCN_MANAGED
networks. This is the result of changes to the default NetworkCapability
set, where NOT_VCN_MANAGED was removed from the default capabilities.
Bug: 182212201
Test: atest FrameworksVcnTests
Change-Id: Iad296830201d7317537fac6bea53c79d4e41cae3
This change updates the UnderlyingNetworkTracker to rely on the
TelephonyNetworkSpecifier for selecting underlying networks. This
ensures that there is always a cellular NetworkRequest filed for
Cellular to bring up an underlying Network.
Bug: 182211364
Test: FrameworksVcnTests
Change-Id: I826711bb671440054c2090793315a5f1d57596c0
This change ensures the IKE configs are used with the correct network
Bug: 163604823
Test: FrameworksVcnTests
Change-Id: Ieb2a9b202204577f6e6969ef30245baed6382aa6
This CL updates VCN error callbacks to return the exposed capabilities
for a gateway connection for identification purposes. Previously, the
required underlying capabilities were returned (which are not meaningful
to the caller for identification purposes).
Bug: 182281888
Test: atest FrameworksVcnTests
Change-Id: Ic62bd0b524f24f2577d9abc7635112a6419d35ed
LocationPermissionChecker was written to be used by multiple
connectivity modules, so it belongs in the frameworks/libs/net library.
The file is moved as-is with minor modifications in the test to avoid
usage of the privileged ActivityManager.getCurrentUser API.
Bug: 181837977
Test: atest NetworkStaticLibTests
Change-Id: I63bce35ba87c45138b3aaf6244367e982dfec455
This CL updates VCN instances to exit Safe Mode when they receive a
new VcnConfig. When a VCN exits Safe Mode, they will re-register a
request listener to receive all cached requests and start the
needed VcnGatewayConnections.
Bug: 179429339
Test: atest FrameworksVcnTests
Change-Id: Id1c2dc287e1ec56f37821cf0ae77f066f22d22bb
This CL updates VcnManagementService to notify VcnStatusCallbacks when a
VCN is started or stopped. VcnStatusCallbacks will also be notified for
config changes that cause a VCN to exit Safe Mode.
Bug: 180659281
Test: atest FrameworksVcnTests
Change-Id: I4168c868185880621333855dfcb51e46cb662741
This CL updates VcnMangementService to notify VcnStatusCallbacks on
registration with the current status of the VCN for the specified
subscription group.
Bug: 180659281
Test: atest FrameworksVcnTests
Change-Id: Id2c74e855fa12d21d292ee94a72ad047f2d56aca
This change updates the underlying network for the VCN in order to
ensure full MOBIKE switches are handled.
Bug: 169788130
Test: atest FrameworksVcnTests
Change-Id: Ib439bde4217beeb28f425c08ed9f3376dfe0033c
This change updates the Vcn when any GatewayConnection StateMachine
quits, removing it from the map of active GatewayConnections, and
triggering a re-evaluation of all existing NetworkRequests. This may (in
the event of a updated policy) result in an immediate restart.
Bug: 179944275
Test: atest FrameworksVcnTests
Change-Id: I72abf1e270a772760a17a03173d5a110e15bd01d
This change adds the ability for disconnection requests to specify
whether the full VcnGatewayConnection should be torn down. This is
useful in cases where the cause is an ephemeral failure, and can be
restarted at some later point (eg an underlying network appears, or a
new NetworkRequest is filed that brings the VCN up.)
Bug: 179944275
Test: atest FrameworksVcnTests
Change-Id: Id1813bcbbb80541be97cc383ea9d1fe08554b7ae
This CL updates VcnManagementService to notify callbacks when VCNs enter
Safe Mode via #onVcnStatusChanged. Callbacks were previously notified
via #onEnteredSafeMode - however, VcnStatusCallbacks were changed to
provide more status information by defining onVcnStatusChanged(int) per
API Council feedback.
Bug: 1597023
Test: atest FrameworksVcnTests
Change-Id: I34ef76ec29f4369390449b70b37bc3cf99c09c77
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
* changes:
Notify status callbacks when a VCN enters Safemode.
Change all 'safemode' references to use 'safe mode'.
Define VcnStatusCallback register/unregister.
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 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 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