- Support formatting AIDL files. I found the formatter from b/144540481.
- Support working for other Thread repos like external/ot-br-posix.
Test: verified locally
Change-Id: I805af4989c80629264b53f46fa58afa4a04bb26f
Add unit test to test feature
BROADCAST_NETWORK_STATS_UPDATED_RATE_LIMIT_ENABLED_FLAG.
When feature is on, broadcast message should be delivered
with the designated interval(b/343844995),
When feature is off, each message should be delivered
regardless of previous intent.
Test: atest FrameworksNetTests:android.net.connectivity.com.android\
.server.net.NetworkStatsServiceTest\
#testNetworkStatsUpdatedIntentSpam_rateLimitOn
Test: atest FrameworksNetTests:android.net.connectivity.com.android\
.server.net.NetworkStatsServiceTest\
#testNetworkStatsUpdatedIntentSpam_rateLimitOff
Bug: 343844995
Change-Id: I4b89497c336a310c6959db579ca9ae3c572ff70c
While the reason of triggering frequently polls is still unknown
(b/343844995), this commit prevents the spamming of network stats
update intents by sending broadcast messages at intervals of at
least one second. It also ensures that update requests experience
a delay of no more than one second. This is safe since
NETWORK_STATS_UPDATED intent is only use for signaling updated
of NetworkStats, which is stateless and not very time sensitive.
A kill-switch flag is included for rollback if needed.
However, while the intent was not be able to deprecated, all
callers should migrate to use registerDataUsageCallback
with proper threshold instead.
Test: atest FrameworksNetTests:android.net.connectivity.com.android.\
server.net.NetworkStatsServiceTest\
#testNetworkStatsUpdatedIntentSpam_rateLimitOn
Test: atest FrameworksNetTests:android.net.connectivity.com.android.\
server.net.NetworkStatsServiceTest\
#testNetworkStatsUpdatedIntentSpam_rateLimitOff
Bug: 343844995
Change-Id: I972f0778b823ed0dc1f35b1b011f1ad225ca020c
Junyu Laiauthored and Yun-Chen Chengcommited 2024-08-09 08:32:03 +00:00
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
Instead of blocking the broadcast until onReceive returns on the
handler, only post in onReceive.
This should make no difference for the only user, the
mCarrierConfigChange listener in Tethering.java, as the callback still
runs on the handler.
Bug: 349919195
Test: atest
Change-Id: Ie8ce7afbe905b4c6972b3aabda2d7792c96eda6c
- 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
This simply cannot happen as the NetBpfLoad binary is built
and shipped together with *all* of the bpf .o files it parses
(we *only* look in /apex/com.android.tethering/etc/bpf/ and subdirectories
thereof, while the loader itself is /apex/com.android.tethering/bin/netbpfload).
So the only way an unrecognized value can happen is a code bug:
someone adds something new to a .o without also updating NetBpfLoad
(in a previous or the same commit).
That's worth explicitly flagging in TreeHugger via refusal to boot.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I29b9ef982bf728a35b6c9d9abbbab1138a4796ce
Maciej Żenczykowskicommited 2024-08-07 15:38:03 -07:00
This actually makes things build,
and removes some duplication.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie5f95c7cc7f21525e649db0eebccb8e6933678b3
Maciej Żenczykowskicommited 2024-08-07 15:18:31 -07:00
This eliminates loader.{h,cpp} which exist only for historical
reasons (this stuff used to be the libbpf_android library,
but the split between what was in and outside the lib never
really made all that much sense, and now it is not even a lib...).
Generated via:
cd //packages/modules/Connectivity/netbpfload
cat loader.h loader.cpp NetBpfLoad.cpp > z
cat z > NetBpfLoad.cpp
rm z loader.cpp loader.h
git add NetBpfLoad.cpp
git rm loader.cpp loader.h
Test: does not build, see follow up
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie1a41a9ce935a7db6be5af810ce92a2d3e290264
Maciej Żenczykowskicommited 2024-08-07 15:17:21 -07:00
ensureValidatedNetwork does not request network.
So this fails if MOBILE_DATA_ALWAYS_ON is disabled and the cell network
is down
Bug: 356291552
Test: ConnectivityManagerTest
Change-Id: I0e5f67467d6ef591028225ddb138d8ed5f4fa32a
This CL refactors the code of ThreadNetworkControllerService to use
immutable BorderRouterConfiguration.
Bug: 358012289
Test: CI
Change-Id: Ifabf0144d5e8f5b5da2b8d64fc9e53c46f917dbb
This CL adds an integration test case for NAT64. Because the feature is
not fully ready, we need some extra setup steps to make the feature
work. That is, specifying a CIDR for NAT64. Also, this test case is
based on `ot-ctl` but eventually the test should be based on API.
This CL requires https://github.com/openthread/openthread/pull/10566.
Bug: 356770473
Test: atest ThreadNetworkIntegrationTests
Change-Id: Idfb5ad848f7b2369591e47558ea67017c0b31e19
This CL also refactors the IntegratoinTestUtils a bit to make it more
reusable.
Bug: 356770473
Test: CI
Change-Id: Ief94e312e06e4b62c71284c8ff0ef710f0b632fb
OEM VPNs might need to receive packets to VPN address via
non-VPN interface.
Bug: 352424251
Test: CsIngressDiscardRuleTest
Change-Id: Ia9000bcbb5b3b9e1e0d396ba78946be36e2fc5ba
`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
(I believe this will end up in M-2024-11+)
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0aff17c58aeb36b337d58cc3be3bedde81c39c4a
Maciej Żenczykowskicommited 2024-08-05 22:21:20 +00:00
This CL adds a test case to verify the upstream network request has
desired transport types and network capabilities.
Bug: 356346764
Test: CI
Change-Id: Id81b5f60ce2ca574582aaf106840eab0b7aca927
This method can remove all services that match the given
CacheKey.
Bug: 355421878
Test: atest FrameworksNetTests NsdManagerTest
Change-Id: I83e1a0cbdd4355d92510b5f9a550f96ef0154682
"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
Some legacy VPNs need to receive packets to VPN address via
non-VPN interface.
Bug: 352424251
Test: CsIngressDiscardRuleTest
Change-Id: Iad06dc69c5bf5ccda476e89ed9b0fc1bc63d2ebe
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
This is a no-op refactoring, which is preparation for follow-up
changes to add more apf tests.
This includes:
1. Add a method to send packet and expect counter increases.
2. Inline the packet construction code in the test method.
Test: atest NetworkStaticLibHostPythonTests
Test: m connectivity_multi_devices_snippet && \
atest CtsConnectivityMultiDevicesTestCases
Bug: 350880989
Change-Id: Iadcfd97740033306af1b6a474004cbf0699ddd1b
This is a no-op refactoring, which is preparation for follow-up
changes to add more apf test classes.
This includes:
1. Move initialization code to a base class, which setup a hotspot
and a client connects to it, and enable doze mode to
activate the apf.
2. Check whether send raw packet is supported before testing.
Test: m connectivity_multi_devices_snippet && \
atest CtsConnectivityMultiDevicesTestCases
Test: atest NetworkStaticLibHostPythonTests
Bug: 350880989
Change-Id: I6376935883653182728e473e2f5533407d993d7b
This is a no-op refactoring, which is preparation for follow-up
changes to add more apfv4 tests.
This includes:
1. Add a entry point for multi-device tests to collect
test cases from different files.
2. Move multi-device initialization code to a base class.
3. Make different test classes inherit the base class.
Test: m connectivity_multi_devices_snippet && \
atest CtsConnectivityMultiDevicesTestCases
Bug: 350880989
Change-Id: I294c85d8e09633bbf02ba1543b9f2ea3e988e20d
Previously the upstream network selector wrongly cleared the default
network capabilities so there's a risk of choosing VPN as the upstream
network, which is undesired.
Bug: 356346764
Test: atest ThreadNetworkIntegrationTests
ThreadNetworkControllerServiceTest
Change-Id: Ic1762775734d734f1974a753f100814b61d66589