This API is designed to set the UID of the app that is allowed to
perform network traffic for captive protal login, communication will
bypass network access restrictions such as VPNs and private DNS settings
when a portal page is launched by Android Custom Tabs and bind the
upcoming traffic to that portal network.
Bug: 373773542
Test: atest ConnectivityCoverageTests
Change-Id: I9992671634b8e88f5a647455811a6157fb15a44b
Patrick Rohrauthored and Xiao Macommited 2024-12-11 20:27:10 +09:00
This patch exposes Connectivity libraries to allow migrating VCN to
its own non-updatable framework and service libraries. It also
creates a utility library for VCN.
Bug: 369703242
Test: atest FrameworksVcnTests && atest CtsVcnTestCases
Flag: EXEMPT no functional change
Change-Id: I1981f1cc824dcf426a76a0af8e4e3460fccb754e
This is supposed to be used only from the Zygote during the
initialization phase to preload HttpEngine. Currently, the
implementation only preloads a single class which is used to initialize
the backend for HttpEngine.
Bug: 380349437
Change-Id: If3ebcb37e51104a69473491e9f230d1b043c7bd0
It should not be valid to queue messages before
registering a NetworkAgent, but the current design
makes it possible in practice. Log a metric so
that we have a handle on whether or not anybody
is doing this in the field.
Bug: 296355968
Test: manual
Change-Id: I83ea92e39a860cebe58d1d82cb024313e244b9aa
Introduced FrameworkConnectivityStatsLog within the
framework-connectivity module. This enables logging of metrics, such as
terrible error events, from components residing in the bootclasspath.
Test: manual
Change-Id: I478d957b06721b35135a45dbbcda72a2c3e9f9ce
modules should specify the submodule of java_sdk_library that the module
actually depends on
Test: CI
Bug: 358613520
Change-Id: I0367068c901df98483f6cf95160d3e7801881b0a
As NetworkStackApi*Shims modules defined in
packages/modules/NetworkStack depends on the impl libs of
framework-connectivity and framework-tethering
Test: m nothing
Bug: 358613520
Change-Id: I5c90d4ae6eeb51f42f1ae1c88dd726bfdcd093e8
INGRESS_TO_VPN_ADDRESS_FILTERING is disabled due to b/352424251 and
testDropPacketToVpnAddress fails if the feature is disabled.
So skip testDropPacketToVpnAddress if the feature is disabled.
Bug: 362434644
Test: adb shell device_config put tethering
ingress_to_vpn_address_filtering -1
Test: atest CtsHostsideNetworkTests
Change-Id: Ib16a7550dcf93dd9ecf29047b1c4f101ff6d610d
Connectivity repo now can use java_aconfig_library since this target is
available on all downstream branches.
This CL removes framework-connectivity-t-mdns-standalone-build-sources.
Files in this target use flags which won't be available in the
out-of-tree build but the next out-of-tree library import will not use
the classes in that filegroup anymore.
So the standalone build rule will still match the out-of-tree build.
Bug: 345121279
Test: TH
Change-Id: I2a9aa02bd0c9aa00d460f98cd51d5dec4098fb89
Currently, NetworkStats#addEntry creates a new instance
containing the requested result instead of mutating the
original object. This creates a heavy memory footprint
when the caller invokes it in a loop because a new NetworkStats
instance is created whenever an addEntry is called.
This change introduces a new API that allows callers to
add a set of entries to a NetworkStats instance. This new
API will clone the instance only once, return the newly
created (and modified) instance, and ensure that the original
instance remains immutable.
Additionally, the change adopts config libraries for flagging
the API and corresponding CTS tests, since Android U-based
branches are no longer downstream of current development branches.
Test: atest FrameworksNetTests:android.net.connectivity.android.net.netstats.NetworkStatsApiTest
Test: atest CtsNetTestCases:NetworkStatsApiTest
Bug: 335680025
Fix: 357772271
API-Coverage-Bug: 357772271
Change-Id: I58513844e681c0621a6107ec4b198cd3957f289d
To avoid filling the binder buffers, and sending unnecessary callbacks
when apps are unfrozen (for example successive LinkProperties changes or
onAvailable+onLost are not useful), queue and aggregate callbacks for
apps that are suspended.
Test: atest
Bug: 327038794
Bug: 279392981
Change-Id: I6de357ac2834f1f7e960dfbaa63adfc3825f2a82
This is required to build cronet against ConnectivityManager hidden APIs
Since framework-connectivity contains cronet, cronet target can not
depend on framework-connectivity.
So this CL splits framework-connectivity-pre-jarjar.
Cronet target can depend on
framework-connectivity-pre-jarjar-without-cronet and use
ConnectivityManager hidden APIs.
Test: TH
Bug: 311792075
Change-Id: Ib7724e8e6bd0226b437ed6f0010658d45aaa1150
The class will be used to build memory-efficient objects (int arrays)
used to queue ConnectivityService callbacks while an app is frozen.
This is very similar to an ArrayList<Pair<Short, Short>>, but avoids
object boxing which would use a lot more memory.
This is intended to be used by ConnectivityService both as a builder,
and as a utility to read lists of callbacks that it stores. Long-lived
references to the CallbackQueue would not be kept to minimize memory
usage; only the array returned by toArray needs to be stored.
Test: atest
Bug: 327038794
Bug: 279392981
Change-Id: I187ea15d14dfd160e577e9e9e87b1aded27b1938
framework-connectivity is in the bootclasspath on S+, while framework-connectivity-tiramisu is in the bootclasspath on T+.
This is consistent with the RequiresApi annotations in this class.
Change-Id: I619759aa1c714738f988f77fd8fcb9de4b1ffdbf
Test: comment only change
- This CL puts RoutingCoordinator into staticlibs to make it usable by
both Tethering and ConnectivityService on R.
- This CL also changes the return type of
ConnectivityInternalApi#getRoutingCoordinatorManager() to IBinder so
it has fewer dependencies.
Bug: 350699020
Test: CI
Change-Id: Iba096e940795cd33e61c5141721394ad39e5ce6d
This CL introduces net-utils-framework-connectivity, net-utils-tethering
and net-utils-service-connectivity as staticlibs.
- net-utils-framework-connectivity will be used by
framework-connectivity-pre-jarjar.
- net-utils-service-connectivity and net-utils-tethering are the
static liraries used by service-connectivity-pre-jarjar and Tethering
respectively.
Bug: 350699020
Test: CI
Change-Id: I4dbb2b0de905a576cfcf24d2d5d1f1a261d2bd68
Most users of NetworkCallback do not override all methods, so callbacks
from ConnectivityService end up being unused by the app.
To save resources, check which callback methods are overridden in
ConnectivityManager, and inform ConnectivityService so it can skip
preparing and sending the corresponding binder calls when the callback
is not used by the app.
This is flagged off by default.
Test: flag enabled: atest CtsNetTestCases ConnectivityCoverageTests
Bug: 327038794
Bug: 279392981
Change-Id: Iaf490f416fb6e1437d40497fba1a40a899a9f523
The check is_system_uid should mirror the definition of core_uids in
UserHandle.isCore until it is available to be read from mainline code.
isUidNetworkingBlocked should also do the same.
Test: All existing tests should pass.
Test: atest CtsHostsideNetworkPolicyTests
Test: atest FrameworksNetTests
Bug: 348316140
Change-Id: Id5e01289b301a725b162ef249062e0f2806876dc
The Lint FlaggedApi checks are currently configured as warnings. Add
existing violations to baselines files to prepare for turning the
FlaggedApi checks into errors.
Bug: 303434307
Test: treehugger
Flag: EXEMPT not possible to flag baseline changes
Merged-In: I990ce57cd5cdac44ee8b93565b45aa15790ad697
Change-Id: I990ce57cd5cdac44ee8b93565b45aa15790ad697
On V+, this capability is set by default.
Constrained satellite networks never become the system default network.
Test: CSSatelliteNetworkTest
Bug: 343823469
Change-Id: I020ba48e74f1f180e1807cbe1c066209bedb0454
Add a DeviceConfig flag that will be used to control whether callbacks
should be sent selectively based on whether the receiving method has
been overridden (will be implemented in a future change).
This adds utilities to allow ConnectivityManager to check whether a
ConnectivityService flag is enabled, as that feature will work across
ConnectivityManager and ConnectivityService. ConnectivityManager runs in
app process and does not necessarily have permissions to use
DeviceConfig. Also if it checked DeviceConfig separately from
ConnectivityService, values may be out-of-sync.
Test: atest, and see change using this
Change-Id: I204fa719cc627e84edc5c1e043d947f5ef3f8dee
When new capability is introduced and added to capaility or
forbiddenCapability by default, module rollback could cause system
server crash since JobScheduler persists network request that contains
new capability that is invalid for old code.
This CL updates capability validation not to throw exception to avoid
system crash in this case.
Bug: 343823469
Bug: 313030307
Test: NetworkCapabilitiesTest
Change-Id: I5708c475f3b4974284531212b77f9788ca9f497e
This reverts commit ee96ba0e60.
Reason for revert: Droidmonitor triggered revert due to b/342557183. Will be verifying through ABTD before submission.
Change-Id: I7e185c3ac11da27c7bb9d95e4221f7dfc22cf48c
Priyanka Advaniauthored and Gerrit Code Reviewcommited 2024-05-24 18:11:45 +00:00
Currently, even if apps don't have INTERNET permission and can not use
network, network access is considered not blocked and
ConnectivityService send onBlockedStatusChanged callback with
blocked=false.
This CL introduced BLOCKED_REASON_NETWORK_RESTRICTED and consider
network access from apps targetting W+ on V+ releases is blocked if apps
don't have INTERNET permission.
Permission is set when the user is added or package is installed and
permission is removed when the user is removed or packages is
uninstalled.
So ConnectivityService does not need to monitor permission change to
send onBlockedStatusChanged callback by permission change.
Test: CSBlockedReasonsTest
Bug: 339559837
Change-Id: I58d2a4eddc714e205f5b96219f95b637f2826c58
This allows apps built against V but run on older platform
can adopt this feature. This keep compatibility for older
apps which does not built against newest platform.
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest
Fix: 339154075
Change-Id: Ia12997595579190ae0d65ad36ce39d011dde37ce
NETWORKINFO_WITHOUT_INTERNET_BLOCKED compat flag only changed the
behavior of getActiveNetworkInfo that depends on
bpfNetMaps#isUidNetworkingBlocked.
But isUidNetworkingBlocked is used from other APIs(e.g. getActiveNetwork)
This CL update all APIs that depends on isUidNetworkingBlocked to follow
the compat flag to make behavior consistent between APIs.
aosp/3079290 will update onBlockedStatusChanged callback to follow this
compat flag.
Bug: 340773991
Bug: 339780435
Test: TH
Change-Id: If64ec800f21c2adc613884838202e2dece4a8d95
Before aosp/3001087, getNetworkActiveInfo did not return network info
with blocked state for apps without PERMISSION_INTERNET even if the
network is actually blocked.
aosp/3001087 updated getNetworkActiveInfo to return correct blocked
state on V+.
However, this broke some apps that use getNetworkActiveInfo in wrong way
and depends on the previous behavior.
So this CL introduces the compat flag to keep previous behavior for apps
targeting U or older releases.
Test: TH
Bug: 333340911
Change-Id: I0e0950f2148de0ffdb45495903a5a87e0d4c1c0b
FIREWALL_CHAIN_OEM_DENY_x chains were added by aosp/2114533 but
corresponding blocked reasons were not added.
Upcoming aosp/3027488 updates CS to generate blocked reasons based on
bpf map contents.
Without blocked reasons for oem deny chains, onBlockedStatusChanged
callback will have inconsistency from the actual network blocked status.
This CL adds BLOCKED_REASON_OEM_DENY for FIREWALL_CHAIN_OEM_DENY_x chains
Bug: 328732146
Test: TH
Change-Id: I3793aa0e231d32fea5eb202ed69e170f74d66b02
With this annotation, errorprone build will fail if callers don't check
sdk version before calling any methods in BpfNetMapsUtils.
Bug: 328732146
Test: TH
Change-Id: Ifa52dc1d2766f8d46dfdc4f6ca9dbb963406c084