This commit introduces checks for APF version, VSR API level,
and Android version to decide whether an APFv4 test should be
run, skipped, or fail:
* If Android version is less than V, skip the test
* If VSR API level is greater than or equal to 14 and APF
version is less than 4, fail the test
* Otherwise, if APF version is less than 4, skip the test
Test: m connectivity_multi_devices_snippet && \
atest CtsConnectivityMultiDevicesTestCases:ConnectivityMultiDevicesTest
Fix: 352132428
Change-Id: I023164fb59ad40f489abea2e0c45761efc39699b
modules should specify the submodule of java_sdk_library that the module
actually depends on
Test: CI
Bug: 358613520
Change-Id: I0367068c901df98483f6cf95160d3e7801881b0a
This commit throws IllegalStateException instead of
IllegalArgumentException when inserting an existing item
to TestBpfMap to fit the current behavior in the
production code.
This is safe given that this is only for test and no one is
currently check the exception.
Test: atest TetheringTests:com.android.networkstack.tethering.BpfCoordinatorTest
Bug: 354619988
Change-Id: I1e5c6e99a0d95b44dd556de8805bb16c3d1a4f61
Currently, checkLocationPermissionInternal throws if the package does
not exist or package name and uid doest not match.
This caused system server crash in ConnectivityService.
ConnectivityService is an only caller of checkLocationPermissionInternal
and ConnectivityService should consider uid does not have location
permission in this case.
So this CL updates checkLocationPermissionInternal return
ERROR_LOCATION_PERMISSION_MISSING instead of throwing exception.
Bug: 337473824
Test: LocationPermissionCheckerTest
Change-Id: Ic42d6203bafa95aea7e5428c490b0a298e3bd260
doReturn is less prone to races since when().thenReturn will fail if the
mock is used by other thread between when() and thenReturn()).
Bug: 337473824
Test: LocationPermissionCheckerTest
Change-Id: Ie07f3f3cf23b57296a7db4fb9296b84be5b57214
This removes the need of pip install absl-py and
virtual env usage from the tests.
Test: atest NetworkStaticLibHostPythonTests
Bug: N/A
Change-Id: I2259f7702ecc6b5e7b7b23e2bf44fa28a5a2e07b
Generated via:
git mv staticlibs/native/bpf_headers bpf/headers
cd bpf/headers/include
git mv bpf/bpf_helpers.h .
git mv bpf/bpf_map_def.h .
manually fix up bpf/bpf_map_def.h include path
bpf_helpers.h is only used by bpf programs so the 'bpf/'
prefix is spurious.
bpf_map_def.h is only used by bpf programs and the two
bpfloaders, which effectively means the 'bpf/' prefix isn't
useful.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ic3fc4e354a15821c27c23b7dbc019daad9f6ad85
Maciej Żenczykowskicommited 2024-08-21 13:18:59 -07:00
cat'ing this text file from a terminal results in
shell prompt being in the middle of the screen - fix it.
Test: N/A
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Iabc6225e2698b13013be2c630f0c415c8832817f
Maciej Żenczykowskicommited 2024-08-20 19:52:18 -07:00
Step 3 of moving bpf related stuff into a common directory,
will ease development.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9ec90e2f58c68e17d6e83b48b8dea2cdf31a3694
Maciej Żenczykowskicommited 2024-08-20 19:51:50 -07:00
Instant mode does not have access to WifiManager
Test: atest MultinetworkApiTest --instant
Bug: 356644514
Change-Id: I310cd8a614006c391407829ada587d892a0ac3b4
It's not possible to directly create a mocked `NetworkStats`
instance because of limitations with `NetworkStats#getNextBucket`.
As a workaround for testing, create a mock by controlling the
return values from the mocked service that provides the
`NetworkStats` data.
Test: atest FrameworksServicesTests:com.android.server.stats.pull.netstats.NetworkStatsUtilsTest
Bug: 335680025
Change-Id: I4be8420de50040781557587fba4a50b9c0587f61
This is a no-op refactor to reduce complexity to prevent from
accessing trunk stable flags from static libs. Also it
makes more sense since statsd is the only caller.
Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.NetworkStatsUtilsTest
Bug: 335680025
Change-Id: Ied563bd685bdba9d514414c05d58009304d5baa4
Since all mainline shipped bpf .o files have BTF loading disabled,
we might as well make it the default.
Especially since currently neither the platform nor the mainline
bpf loaders even support BTF and thus don't even parse these settings.
We do need to keep it around to prevent a boot time regression on
(at least) Android U.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibc6f9d7168c1d61c435de7e641cc0aaa5db4603a
Maciej Żenczykowskicommited 2024-08-17 02:06:51 +00:00
Afterwards:
git grep 'DEFAULT_BPFLOADER_(MIN|MAX)_VER'
comes up empty
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9c7736c2c247987263e40c336bdea3a135cfda9a
Maciej Żenczykowskicommited 2024-08-15 16:15:13 -07:00
This hasn't ever been useful.
Afterwards:
git grep 'DEFAULT_BPF_PROG_(SELINUX_CONTEXT|PIN_SUBDIR)'
comes up empty
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7694d0bb3aa4e424247da7f79251412ff549ce63
Maciej Żenczykowskicommited 2024-08-15 15:21:15 -07:00
Both the loader and all the bpf .o's are in the same apex, they're thus
built from the same source and have the same struct bpf_map_def
definition, and this is no longer required.
We do still need to populate the field in the .o's though,
since offload.o and test.o are still read by the Android S
platform bpfloader.
Afterwards:
git grep 'DEFAULT_SIZEOF_BPF_MAP_DEF|sizeOfBpfMapDef'
is empty
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I152151e3713b1002f603f298dae060decb4c19fe
Maciej Żenczykowskicommited 2024-08-15 15:17:22 -07:00
Both the loader and all the bpf .o's are in the same apex, they're thus
built from the same source and have the same struct bpf_prog_def
definition, and this is no longer required.
We do still need to populate the field in the .o's though,
since offload.o and test.o are still read by the Android S
platform bpfloader.
Afterwards:
git grep 'DEFAULT_SIZEOF_BPF_PROG_DEF|sizeOfBpfProgDef'
is empty
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibb82f5ffda7ff5404eb3217067a9d7bcec34ce94
Maciej Żenczykowskicommited 2024-08-15 15:04:39 -07:00
In the current design, NetworkStats.addEntry is used within a
loop to create a NetworkStats instance from entries. This results
in a large memory footprint because the addEntry() method clones
the original NetworkStats instance each time it is called.
This change utilizes the newly created API to add a list of
entries at once. This approach only clones the instance once,
thereby reducing the required memory footprint.
Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.NetworkStatsUtilsTest#testPublicStatsToAndroidNetStats
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.net.module.util.NetworkStatsUtilsTest
(on S device)
Test: atest ConnectivityCoverageTests:com.android.testutils.NetworkStatsUtilsTest
(on S device)
Bug: 335680025
Change-Id: I5c635613ed3ba34d840ee71b6bef21d10105df0d
This change enables comparison of android.net.NetworkStats
instances even when their interface name is null. This scenario
arises when deriving a android.net.NetworkStats instance
from an app.usage.NetworkStats, which lacks interface name
information. However, the original utility method relies on
NetworkStats.Entry#equals, which is incompatible with null
interface names on T- devices, because they do not run
mainlined NetworkStats.
This change refactor assertEntryEquals and makes
assertNetworkStatsEquals to use it to compare android.net.NetworkStats
instances.
Test: atest NetworkStaticLibTests
Test: atest ConnectivityCoverageTests:com.android.testutils.NetworkStatsUtilsTest
(on S device)
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.net.module.util.NetworkStatsUtilsTest
(on S device)
Bug: 335680025
Change-Id: I25a685e4c2d4cf70132b2c4374b2bb8129c844cb
Since the testutils.NetworkStatsUtils is in Connectivity.
Move it to Connectivity git makes more senses.
Test: atest NetworkStaticLibTests
Bug: 335680025
Change-Id: Ia59cc8f74417b1dbbcccf12c5c79c3ed22454b78
- Add comments clarifying the use cases of
net-utils-framework-connectivity and net-utils-service-connectivity
- Apply stricter visibility for the staticlibs
Bug: 357803496
Test: CI
Change-Id: I0d13b436976c3194c0fe350a905a8edf3e4df73a
`net-utils-connectivity-apks` has the dependency on
`net-utils-non-bootclasspath-aidl`, to make sure the CaptivePortalLogin
apk module still can use `net-utils-connectivity-apks`, expand the
`net-utils-non-bootclasspath-aidl` to support apk module in platform.
Bug: 329361366
Test: TH
Change-Id: I6d2f723fdc28037ed40072565d93b4307d7f5a45
"Shrinked" should actually be "shrunk" or "shrunken"; in any case
"minimized" is simpler and possibly more accurate (it's the minimum size
required to hold the values).
Test: atest
Change-Id: If787d3f3d6e1046338d4e89ed924bce183e74bd6
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
CaptivePortalLogin module also require the static lib
net-utils-tethering, rename it to net-utils-connectivity-apks for more
usage scope.
Bug: 329361366
Test: TH
Change-Id: Id68255fec9b1586f445bbd7bf290df3403e4ca11