Commit graph

95,258 commits

Message SHA1
[Thread] add ThreadNetworkIntegrationTests to mts-tethering
Bug: 299853805
Change-Id: I567142a8bf8c735b65048d985e94d958a7feef03

Kangping Dong   commited 2024-01-28 13:10:52 +08:00
25bcfee4e3
Merge changes from topic "set-thread-enabled" into main
* changes:
  Add service implementation for ThreadNetworkController#setEnabled
  Add setEnabled API

Yang Sun   authored and   Gerrit Code Review   commited 2024-01-26 11:22:37 +00:00
8f9544539b
Add service implementation for ThreadNetworkController#setEnabled
ThreadNetworkControllerService handles setEnabled requests and
asks ot-daemon to enable/disable Thread. The desired Thread enabled state
is saved in thread persistent setttings, the setting is loaded at bootup.

Bug: 299243765

Test: atest CtsThreadNetworkTestCases:android.net.thread.cts.ThreadNetworkControllerTest

Change-Id: Ifd0135433df25d9c6cfd3f365dd06ec7908268e7

Yang Sun   commited 2024-01-26 15:53:43 +08:00
625353b5bf
Add setEnabled API
setEnabled API is added to ThreadNetworkController, this
can be used by applications with privileged permission to set
Thread to enable/disabled state.

The Thread enabled state can be subscribed with
ThreadNetworkController#registerStateCallback.

When Thread is disabled, the join/scheduleMigration APIs will
fail with ERROR_THREAD_DISABLED.

When Thread is disabling, all commands will fail with ERROR_BUSY.

Bug: 299243765

Test: atest CtsThreadNetworkTestCases:android.net.thread.cts.ThreadNetworkControllerTest

Change-Id: Ifa7845bf1d5664ecd31ce74e24b3a839f92bba13

Yang Sun   commited 2024-01-26 15:53:33 +08:00
0797d9d501
Merge "Check whether the WiFi country code is a valid Thread country code" into main
Zhanglong Xia   authored and   Gerrit Code Review   commited 2024-01-26 06:29:20 +00:00
71524f2bf0
Merge "clearInlineMocks from DevSdkIgnoreRunner after running test" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-01-26 06:00:06 +00:00
424ef18848
Merge changes from topic "mdns-subtype-discovery" into main
* changes:
  [mdns] add service-side impl for subtypes discovery
  [mdns] add API for discovery with subtype

Kangping Dong   authored and   Gerrit Code Review   commited 2024-01-26 04:48:24 +00:00
61fba508f8
Check whether the WiFi country code is a valid Thread country code
The Thread country code should be a 2-Character alphabetical country
code. The `00` is an invalid country code for Thread country code,
but it is the default country code for WiFi country code. If setiting
the `00` as the Thread country code, the ThreadCountryCode throws
an exception.

This CL checks whether the country code is a valid Thread country
code before setting the WiFi country code as the Thread country code.

Bug: b/322404467
Test: atest ThreadNetworkUnitTests
Change-Id: Ic5fd69fc254ee25ad1e75e17096a5f5310a9140f

Zhanglong Xia   commited 2024-01-26 11:51:44 +08:00
a888e726b3
eliminate getIfaceNameFromMap()
this helper doesn't really help...

all it does is a bpf map lookup and call a function on failure.

Test: TreeHugger, atest libnetworkstats_test
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7846eee3a37bcc8be82497cdf22ade5b214795da

Maciej Żenczykowski   commited 2024-01-25 16:36:09 -08:00
14360030e4
Bpf: open code PRE_T - too complex for errorprone linter
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1ad2d0dd288882e84925f0b59961dcd33612f3f7

Maciej Żenczykowski   commited 2024-01-25 16:09:11 -08:00
0d450d3e4d
service-t/lint-baseline.xml - remove BpfInterfaceMapUpdater
(class was fixed and then renamed)

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Idbcacf79b0a8bca81cd37ca0cbd593388df798d5

Maciej Żenczykowski   commited 2024-01-25 15:15:26 -08:00
1870f94a9e
service/lint-baseline.xml - remove BpfNetMaps
(class was fixed)

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id5c67af2de5465dc12856f26e5dacec6d7138326

Maciej Żenczykowski   commited 2024-01-25 15:15:26 -08:00
7426e5756c
BpfNetMaps - add RequiresApi(T) annotations
netd.o bpf program was mainlined in T

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I6d2b34e26f5640840b74d4c761b01668e44dc9d6

Maciej Żenczykowski   commited 2024-01-25 15:15:26 -08:00
6b9d921f1c
clearInlineMocks from DevSdkIgnoreRunner after running test
Memory leak was observed and inline mock is one of the reasons.
This CL updates DevSdkIgnoreRunner to clear mock state if there is no
thread leak.

Test: TH
Bug: 321603955
Change-Id: I50fd03f14c6703bd38b5729f577d7ea516cd5b44

Motomu Utsumi   commited 2024-01-25 21:55:10 +09:00
05bf4f398f
[mdns] add service-side impl for subtypes discovery
This is the servide-side impl of the subtypes discovery added in
aosp/2864728. See that CL for more backgrounds.

Bug: 265095929
Test: atest CtsNetTestCases FrameworksNetTests
Change-Id: I0c1d5038fc46347bfb6bec4fdec295ca815c0885

Kangping Dong   commited 2024-01-25 20:15:25 +08:00
1f1a379140
[mdns] add API for discovery with subtype
This commit adds support of discovering services with explicit subtype.

With this change, a service can be discovered with subtype with:
```
nsdManager.discoverServices(
        new DiscoveryRequest.Builder("_http._tcp", PROTOCOL_DNS_SD)
	        .setSubtype("_printer").build(),
	executor, listener);
```

Bug: 265095929
Test: atest CtsNetTestCases FrameworksNetTests
Change-Id: Iba76283a003cf2d52a8c26e1de872c3e8e433350

Kangping Dong   commited 2024-01-25 20:15:21 +08:00
97d6aeb3a2
Merge "Add OEM country code to Thread country code sources" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-01-25 09:39:13 +00:00
869394241e
Add OEM country code to Thread country code sources
Bug: b/309357909
Test: Run `atest ThreadNetworkUnitTests`.
Change-Id: Ic3c9ef69fc77c44a50f6dc856e1af26c43be1aa2

Zhanglong Xia   commited 2024-01-25 16:08:04 +08:00
5c0d8a6603
Merge "BpfInterfaceMapUpdater is only viable on T+" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-01-25 07:15:14 +00:00
7b2643f65f
Merge "Implement offload priority" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2024-01-25 06:09:19 +00:00
0b29cbf114
Merge "Fix thread leak in HttpEngineTest" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2024-01-25 05:58:53 +00:00
c1f1b29ca4
BpfInterfaceMapUpdater is only viable on T+
(since the maps were only mainlined in T)

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I8d6af19f9dc339b722c5b2836b6085e0c9dd4705

Maciej Żenczykowski   commited 2024-01-25 05:42:28 +00:00
ce25003a8e
Merge "Baseline NewApi issues" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-01-25 05:37:36 +00:00
d421562323
Merge "BpfNetworkStats: implement bpfRegisterIface() and wire it up" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-01-25 05:20:49 +00:00
fe4f8c48f6
Merge "getIfaceNameFromMap - better type safety" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-01-25 05:20:38 +00:00
90e69eb8a8
Merge "[Thread] remove thread_user_restriction_enabled" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-01-25 05:08:08 +00:00
670793d58e
Merge "Specify aconfig_declaration modules in java_sdk_library" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-01-25 03:42:18 +00:00
286d892e92
Merge "Support mDns Multipacket Known-Answer Suppression" into main
Paul Hu   authored and   Gerrit Code Review   commited 2024-01-25 03:00:45 +00:00
eeb79c6937
Baseline NewApi issues
NewApi is a lint check that you don't call framework methods that were
introduced in versions later than your min_sdk_version. We want to
make this an error, so we're baselineing all existing issues.

This cl was generated automatically, by taking all the NewApi issues
from the reference baselines, and all the non-NewApi issues from the
existing checked in baselines.

Bug: 268261262
Test: Presubmits
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4ecdedda379e4e9040eb87b01dc3d8efb89be810)
Merged-In: I0393f24f101876abc458ca139eefdb279dcb2b03
Change-Id: I0393f24f101876abc458ca139eefdb279dcb2b03

Cole Faust   authored and   Android Build Cherrypicker Worker   commited 2024-01-25 02:41:58 +00:00
be30b3e96e
Specify aconfig_declaration modules in java_sdk_library
java_sdk_library modules should specify the aconfig_declarations modules
in order to generate the exportable stubs (i.e. the stubs that exclude
the disabled aconfig flags) by providing the information about the
aconfig flag values.

The exportable stubs will be used when generating the module sdk
snapshots and to generate the hiddenapi flags, in order to prevent
exposing the disabled apis in runtime.

Test: m framework-connectivity-t
Bug: 317290555
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:60b21f877f88a6848ee6d0f0e5316362714b9d25)
Merged-In: Ieb8f41921054ed6f62db2edfc7d695ba0a2a0055
Change-Id: Ieb8f41921054ed6f62db2edfc7d695ba0a2a0055

Jihoon Kang   authored and   Android Build Cherrypicker Worker   commited 2024-01-25 02:17:28 +00:00
49bbfc92f9
BpfNetworkStats: implement bpfRegisterIface() and wire it up
Test: TreeHugger
  atest libnetworkstats_test
  a_test --iterations=100 NetworkStackIntegrationTests:android.net.NetworkStatsIntegrationTest
Bug: 292156770
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I3b1038f6fb306ed8f2d20a73d2f7c36593cbd739

Maciej Żenczykowski   commited 2024-01-24 17:51:34 -08:00
80efc3a697
getIfaceNameFromMap - better type safety
Test: atest libnetworkstats_test NetworkStackIntegrationTests:android.net.NetworkStatsIntegrationTest FrameworksNetTests:android.net.connectivity.com.android.server.net.BpfInterfaceMapUpdaterTest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4d60180764f2325025e9903457f8eb56cb9cfa48

Maciej Żenczykowski   commited 2024-01-24 17:37:07 -08:00
f798c91551
NetworkStatsService - add void nativeRegisterIface(iface)
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I8dd893d09fd5b01676b08fb87f0e01b5d2ab9efd

Maciej Żenczykowski   commited 2024-01-24 22:07:47 +00:00
bfb3a3c5b4
change NULL to nullptr
(for consistency with the rest of the file)

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I78be4ca1c22e266a658288ee714a6f952b2ad529

Maciej Żenczykowski   commited 2024-01-24 22:07:32 +00:00
b6d091ccf2
use a singleton for ifaceStatsMap(IFACE_STATS_MAP_PATH)
Test: TreeHugger, atest libnetworkstats_test
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id9783d3ce502ba68533b14a1080b9ed1792b1082

Maciej Żenczykowski   commited 2024-01-24 22:07:10 +00:00
60eba16aed
use a singleton for ifaceIndexNameMap(IFACE_INDEX_NAME_MAP_PATH)
Test: TreeHugger, atest libnetworkstats_test
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibff5f9c2989b071a0af804ea1ba80a6d11ac53c2

Maciej Żenczykowski   commited 2024-01-24 22:06:50 +00:00
022b286f2b
new BpfMap<> - remove spurious generic type arguments
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ic32ccd7c2c415c462c4e1fdc9002cf7858ed587c

Maciej Żenczykowski   commited 2024-01-24 12:15:44 -08:00
3863c094f3
Merge "Revert "[Thread] add Android.bp for Thread flags"" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-01-24 11:46:00 +00:00
61a823471f
Merge "Add test for SkDestroyListener::dump()" into main
Ken Chen   authored and   Gerrit Code Review   commited 2024-01-24 11:37:48 +00:00
c930f3e8e5
Revert "[Thread] add Android.bp for Thread flags"
This reverts commit a59a6e304b.

Reason for revert: this should not be added in the mainline module but in platform

Merged-In: I88c993680976d2e10d672bfdbf45119f2db13868
Change-Id: I680f23b5f8099b1ea4a316b768a56f1be5c78862

Kangping Dong   commited 2024-01-24 11:20:22 +00:00
2d238dd7f9
Merge "[Thread] create socket dev/socket/ot-daemon/thread-wpan.sock" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-01-24 10:08:28 +00:00
3457225fa3
[Thread] remove thread_user_restriction_enabled
this flag is moved to frmeworks/base.

Bug: 319044650
Bug: 321624552
Change-Id: Ic068eb5e3cd2a7b4898a4f9a33b24ed8eed661f3

Kangping Dong   commited 2024-01-24 17:18:54 +08:00
ee864ef51a
Merge "Add aconfig flags for Connectivity FlaggedAPI annotations" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-01-24 09:12:38 +00:00
8c951c32df
Support mDns Multipacket Known-Answer Suppression
When a query packet is truncated, the responder should defer
the generation of a response until all packets have been received
and processed. If an answer present in the query packet's answer
section also appears in the responder's response, and the
known-answer's TTL exceeds half of the original TTL, suppress
the corresponding response.

Bug: 312657709
Test: atest FrameworksNetTests NsdManagerTest
      Passed DISTRIBUTED DUPLICATE SUPPRESSION and \
      MULTIPLE QUESTIONS - DISTRIBUTED DUPLICATE SUPPRESSION \
      test cases of BCT
Change-Id: I781cd813d46f7d0db267f3fe23a15a81ae319e51

Paul Hu   commited 2024-01-24 08:54:58 +00:00
3aaa285293
Merge "Revert "Add experiment flag for tethering refactor"" into main
Mark Chien   authored and   Gerrit Code Review   commited 2024-01-24 07:41:19 +00:00
e48d106863
Add test for SkDestroyListener::dump()
A simple unit test for the SkDestroyListener::dump().
(The follow-up of aosp/2916465)

Bug: 306919485
Bug: 319348954
Test: atest FrameworksNetTests:android.net.connectivity.com.android.serv
er.net.SkDestroyListenerTest

Change-Id: Ica70b2b344ffb2df8047cd936e8edc583e636ceb

Ken Chen   commited 2024-01-24 13:26:50 +08:00
8b33caa55e
Merge "BpfMap - add R/W constructor alias" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-01-24 04:53:54 +00:00
8552cd82b9
Merge "BpfMap.java - remove spurious import" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-01-24 04:49:35 +00:00
d769babaab
Fix thread leak in HttpEngineTest
Locally created test http server was not terminated.
Use the test http server globally available instead.

Test: atest NetHttpCoverageTests --rerun-until-failure 3
Fix: 320964365
Change-Id: Ida01664df1640da7db22d03519d842f0c49309c7

Junyu Lai   commited 2024-01-24 11:15:41 +08:00
54fddc3e54
Merge "Do not check active socket from other callbacks" into main
Paul Hu   authored and   Gerrit Code Review   commited 2024-01-24 03:15:16 +00:00
95d380fefd