Commit Graph

43701 Commits

Author SHA1 Message Date
Patrick Rohr
361b859b00 Merge libtraffic_controller_jni into libservice-connectivity
There is not really a point to separate these two as they are all used
in ConnectivityService.
As a future TODO, we might want to rename libservice-connectivity to
libcom_android_server_jni to be more inline with the jarjar'ed jni lib
versions.

Test: atest FrameworksNetTests:ConnectivityServiceTest
Change-Id: I1b9f4fde345038bda6b3ffcf8e3f47cf9262e052
2022-01-31 16:18:51 +01:00
Wayne Ma
2fde98c87b [NETD-TC#15] Make ConnectivityService and PermissionMonitor
calls BpfNetMaps on T

Since TrafficController moves to mainline module for T, so some netd binder
interfaces revelant to BPF are going to deprecated. Provide JNI APIs to
call TrafficController inside mainline module for T.

Bug: 209935649
Test: atest CtsHostsideNetworkTests
Change-Id: Ib3b43cf2840e02806395af9f1e019ca6fccd032e
2022-01-31 09:19:08 +01:00
Treehugger Robot
dd5bc74532 Merge "Increase the number of test service names" 2022-01-28 08:08:01 +00:00
Treehugger Robot
2be7b1d5fb Merge "Conditionally disable TetheringApiCurrentLib" 2022-01-28 05:21:22 +00:00
Lorenzo Colitti
2a947ceb50 Merge changes from topic "dscp_policies"
* changes:
  Don't enable DscpPolicyTracker on pre-T devices.
  Allow service JNI in FrameworksNetIntegrationTests.
  Don't manually load the JNI library in DscpPolicyTracker.
  Process DSCP QoS events for policies
  Allow using BpfMap and TcUtils in unit tests.
2022-01-27 23:25:54 +00:00
Treehugger Robot
3755d9048a Merge "[LSC] Add LOCAL_LICENSE_KINDS to packages/modules/Connectivity" 2022-01-27 23:23:33 +00:00
Bob Badour
e7ebed2849 [LSC] Add LOCAL_LICENSE_KINDS to packages/modules/Connectivity
Added SPDX-license-identifier-Apache-2.0 to:
  service/native/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: Ibfaed81348fca9e5cf313a4d29fd0b72bc746e06
2022-01-27 10:45:30 -08:00
Chalard Jean
47e778e301 Use the T shims in AOSP
Test: m
Change-Id: I10bbe36ba867aa77ea6f32cc3b8fd37d5b15145e
Merged-In: I0c4e29568eadb6ef85ddadebbb37723adb9f29cd
2022-01-27 16:37:51 +00:00
Lorenzo Colitti
debd9eaffa Don't enable DscpPolicyTracker on pre-T devices.
The code cannot work before T because before T the tethering
module can only load BPF programs/maps into /sys/fs/tethering/bpf
and the system server cannot access that directory.

Additionally, this is causing unit tests to fail on pre-T devices
because on those devices the seccomp filter blocks the bpf
syscall from apps (including Java tests).

Test: revert aosp/1907693 and atest FrameworksNetTests:ConnectivityServiceTest
Change-Id: I6c398031dffb840da1d723b11ea4d0845ad6c6f2
2022-01-27 14:16:49 +00:00
Lorenzo Colitti
82ed9e6058 Allow service JNI in FrameworksNetIntegrationTests.
Add libcom_android_connectivity_com_android_net_module_util_jni
to the JNI libraries for FrameworksNetIntegrationTests. This is
needed for service code (e.g., ConnectivityService,
DscpPolicyTracker) to use JNI.

Test: atest FrameworksNetIntegrationTests
Change-Id: Iebe7ef31057c7a3b10bd7bad42ca74a25fe24473
2022-01-27 12:00:36 +00:00
Remi NGUYEN VAN
e9370c5ef4 Merge "Add var to enable/disable tethering next APEX" 2022-01-27 11:41:26 +00:00
Treehugger Robot
ce0df5a6ed Merge "Correct some errno values before throw ServiceSpecificException" 2022-01-27 11:07:42 +00:00
Patrick Rohr
fff2733066 Merge "Load tcutils in ConnectivityService" 2022-01-27 10:31:02 +00:00
Lorenzo Colitti
f84e2f8e0d Don't manually load the JNI library in DscpPolicyTracker.
This is not necessary because TcUtils already loads its library,
and unlike this code, it correctly loads it using JniUtils so
will succeed even when the code is jarjard in unit tests.

Test: atest ConnectivityServiceTest
Change-Id: I57eb46178d58777769f5497a0ea93cd037d598cb
2022-01-27 10:20:01 +00:00
Tyler Wear
723882126a Process DSCP QoS events for policies
New events to handle adding and removing of DSCP QoS policies.
Async indication sends status back to client if the policy
has been added, failed, or if the policy limit has been
reached.

Bug: 202871011
Change-Id: I7988d22ae625ad0dd415927d2943de4a749e6fb8
2022-01-27 10:19:27 +00:00
Lorenzo Colitti
0c26c9ed37 Allow using BpfMap and TcUtils in unit tests.
Create a Java library that allows the BpfMap class and the
TcUtils class to find their JNI code when they are jarjard to the
package name we use in our unit tests.

Test: atest ConnectivityServiceTest
Change-Id: I2f17b1c366b2b8164eac34b94c9659bc7c0f68e0
2022-01-27 10:18:35 +00:00
Mark Chien
dd26c5709e Merge "Test UidCounterSetMap in NetworkStatsServiceTest" 2022-01-27 10:02:35 +00:00
Chiachang Wang
e84d7d90d3 Expose local route exclusion API in NetworkAgentConfig
Bug: 184750836
Test: make update-api
Test: atest FrameworksNetTests
Change-Id: I70470ab3a945570a23607e39d18f9825d9e1d7aa
CTS-Coverage-Bug: 184750836
2022-01-27 09:53:33 +00:00
Remi NGUYEN VAN
1d4e537a2b Increase the number of test service names
Append a random number between 0 and 999999999 to the service name,
instead of 0 to 999 (and historically 0 to 9999). This reduces chances
that a collision can happen, if the test is run simultaneously on
devices on the same network.

Bug: 190249673
Test: atest NsdManagerTest
Change-Id: I14a7a60a45c41b920f50d9ccc4dd3f98fd623c42
2022-01-27 18:49:32 +09:00
Remi NGUYEN VAN
f826bce37a Conditionally disable TetheringApiCurrentLib
The "current" targets are only necessary in branches that can use
non-stable APIs, and can fail to build otherwise.

Apply ConnectivityNextEnableDefaults so they are disabled on such
branches. Also deprecate NetworkStackNextEnableDefaults, so
ConnectivityNextEnableDefaults is used everywhere.

Bug: 190249673
Test: m
Change-Id: I1b152f3cc22f1bed6444d280f0066e480980e949
2022-01-27 18:49:19 +09:00
markchien
8f3917501b Test UidCounterSetMap in NetworkStatsServiceTest
Test: atest FrameworksNetTests
Change-Id: I1ae720fcc3192712b3dcbe69619f97f7df1a1f5e
2022-01-27 17:28:19 +08:00
Junyu Lai
bfdd0f3c3c Merge "[MS59.2] Add unit test for NetworkStatsDataMigrationUtils" 2022-01-27 09:20:10 +00:00
Aaron Huang
85a2ef3dd5 Merge "Change NETWORK_TYPE_5G_NSA reference package" 2022-01-27 08:36:23 +00:00
Patrick Rohr
e258c5913d Load tcutils in ConnectivityService
Bug: 157552970
Test: TreeHugger
Change-Id: Ic2204260e822b082f58e5f01e5da8dad879ab22f
2022-01-27 09:07:36 +01:00
Jean Chalard
6c24db946d Merge "Use the network stack shims in services connectivity" 2022-01-27 07:36:53 +00:00
Sooraj Sasindran
71c9ca453d Merge "Add getEnterpriseId api to network request" 2022-01-27 05:52:54 +00:00
Rahul Sabnis
d97f3a1901 Merge "Adding bt dependency" 2022-01-27 05:42:18 +00:00
Remi NGUYEN VAN
f24553d950 Add var to enable/disable tethering next APEX
This is necessary to disable the .inprocess APEX, in branches that only
use stable APIs, as it depends on unstable stubs. override_apex does not
support defaults.

Bug: 190249673
Test: m
Change-Id: Ib4a27b65f3c5b6d4b0ac69e85cf671038efc5744
2022-01-27 13:21:25 +09:00
Wayne Ma
41c2448ff9 Correct some errno values before throw ServiceSpecificException
For those functions which return statusFromErrno() in TrafficController,
it would return positive errno so shouldn't construct with -errno.

Test: m
Change-Id: I94b9294c4e200c43e33f8280469dfad9e9fbf5ea
2022-01-27 11:55:24 +08:00
Wei Li
c7231f3e79 Merge "Set exclude_kotlinc_generated_files to false explicitly since kotlin reflection is used in some Connectivity test cases kotlin code." 2022-01-27 00:22:49 +00:00
Wei Li
8a177f694a Set exclude_kotlinc_generated_files to false explicitly since kotlin reflection is used in some Connectivity test cases kotlin code.
Property "exclude_kotlinc_generated_files" is recently added to exclude some kotlinc generated files that are not needed if kotlin reflection is not used. Currently it defaults to false since there are test failures(b/213966211) which is in FullScoreTest#testToString and FullScoreTest#testMinMaxPolicyConstants that uses kotlin reflection and fails if exclude_kotlinc_generated_files defaults to true. By setting explicitly exclude_kotlinc_generated_files to false on tests like FullScoreTest#testToString, we will be able to finally default this property to true so the kotlinc generated files can be removed for most modules that don't need them.
Bug: 204888276
Bug: 213966211
Test: atest
FrameworksNetTests: com.android.server.connectivity.FullScoreTest
Change-Id: I4ed2d27c27841cb7127f669c8db34c90b4a41b1f
2022-01-26 18:25:23 +00:00
Sooraj Sasindran
7e9b25e7f9 Add getEnterpriseId api to network request
Bug: 194332512
CTS-Coverage-Bug: 216481336
Test: build
Change-Id: I1446f8eecf43f7c6d243dc82af08d04957dd60e3
2022-01-26 17:26:50 +00:00
junyulai
a1bb3a36cd [MS59.2] Add unit test for NetworkStatsDataMigrationUtils
Test: atest NetworkStatsDataMigrationUtilsTest
Bug: 204830222
Change-Id: Ia6e8aec9a828072a2a1e63bec600c2e20d3699b3
2022-01-26 16:53:06 +00:00
Aaron Huang
b4ce0fa9b1 Change NETWORK_TYPE_5G_NSA reference package
NETWORK_TYPE_5G_NSA is moved to NetworkStatsManager

Bug: 210073043
Test: builds, FrameworksNetTests
Change-Id: I9226119ee4f67688a1b4ffdab7e5a86ec0b8e974
2022-01-26 23:41:17 +08:00
Nucca Chen
f8ed984e9c Merge changes Ie826477d,I5125a3ac
* changes:
  [CLATJ#26] ClatCoordinator: reword clatd starting failure logging
  [CLATJ#25] ClatCoordinator: stop clatd process gracefully
2022-01-26 14:50:11 +00:00
Hungming Chen
6fb21144b8 [CLATJ#26] ClatCoordinator: reword clatd starting failure logging
Bug: 212345928
Test: build
Change-Id: Ie826477d27db26cc49d113ec8bfacaaa3006e26e
2022-01-26 12:23:45 +00:00
Hungming Chen
1ff914a543 [CLATJ#25] ClatCoordinator: stop clatd process gracefully
Send SIGTERM with timeout first, if fail, SIGKILL.

Bug: 212345928
Test: connect/disconnect to IPv6 only network and ping 8.8.8.8
      repeat 3 times
Change-Id: I5125a3ac7e8ab6d4e8ae7fc7134b8ac8e42ce5dd
2022-01-26 12:23:22 +00:00
Chalard Jean
96400daaa9 Use the network stack shims in services connectivity
Test: m
Change-Id: I8ac4f291cd78720fd3b0d433872881aa98f10d73
2022-01-26 03:12:21 -08:00
Junyu Lai
30f06afda3 [MS78.2] Fix NetworkIdentity#Builder crashing on 5G NSA networks
Test: atest NetworkIdentityTest
Fix: 216193400
Change-Id: I00abc97a98dfdf17d5f0c2e6b45d28be9899c5c3
2022-01-26 07:53:57 +00:00
Roopa Sattiraju
27acf0b677 Adding bt dependency
Bug: 206121418
Test: Compile
Merged-In: I92f3971ba1bb7e873166482f7051dcd2b9df5bf2
Change-Id: I92f3971ba1bb7e873166482f7051dcd2b9df5bf2
2022-01-25 20:27:30 -08:00
Chiachang Wang
317be96553 Merge "Send exclude local routes value to netd for VPN network" 2022-01-26 02:09:35 +00:00
Maciej Żenczykowski
43f9729e90 Merge changes from topic "preparation_fork_clatd_from_system_server"
* changes:
  [CLATJ#24] ClatCoordinatorTest: add basic unit tests
  [CLATJ#23] Close the file descriptor manually
  [CLATJ#22] ClatCoordinator: stop clatd
  [CLATJ#21] ClatCoordinator: start clatd
2022-01-26 00:26:48 +00:00
Maciej Żenczykowski
1b5f93df43 Merge "Correct typos in libnetworkstats" 2022-01-25 23:52:32 +00:00
Maciej Żenczykowski
e1f8ad4d59 Merge changes from topic "libnetworkstats"
* changes:
  Rename libnetdbpf to libnetworkstats
  Copy libnetdbpf from system/net to tethering module
2022-01-25 23:52:06 +00:00
Sooraj Sasindran
d8645e27c7 Merge "Add low latency and high bandwidth network capabilities" 2022-01-25 21:06:16 +00:00
Maciej Żenczykowski
e0904b5a12 Merge "adjust BpfCompatTest now that clatd & netd bpf program have been mainlined" 2022-01-25 19:07:13 +00:00
Maciej Żenczykowski
45f940a9ee adjust BpfCompatTest now that clatd & netd bpf program have been mainlined
The purpose of this test is to verify that the bpfloader related
stuff in the platform is compatible with mainline module bpf .o's.

To be more precise: the test is trying to check that platform/OEM
BPF programs (and, by implication, the platform/OEM bpfloader) have
a struct layout that is known, and thus that BPF programs shipped
in mainline modules will be compatible (with the OEM bpfloader).

(ie. basically this is trying to make sure that the vendor/oem
haven't made incompatible changes to the bpfloader parsed structs,
these can only be extended safely in aosp master)

Since clatd/netd.o have been moved to mainline they are no longer
a useful representation of the state of the platform side of things.
(we'd simply be testing that mainline is compatible with mainline,
which of course it is...)

As such we pick two other bpf .o files that are still shipped
as part of the platform.

Verified on cuttlefish via 'atest CtsNativeNetTestCases':
  x86 CtsNativeNetTestCases
  -------------------------
  CtsNativeNetTestCases (2 Test(s))
  [1/2] BpfTest#bpfStructSizeTestPreT: IGNORED (0ms)
  [2/2] BpfTest#bpfStructSizeTest: PASSED (0ms)

  Summary (Test executed with 1 device(s).)
  -------
  x86 CtsNativeNetTestCases: Passed: 1, Failed: 0, Ignored: 1, Assumption Failed: 0,

  All tests passed!

Note: it's not clear to me if this code can even ever be run on pre-T devices...
but I guess it shouldn't hurt.

Bug: 215718693
Test: atest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1b2d76e5ef95d8e4b94068f5525263653879d1f4
2022-01-25 19:06:51 +00:00
Sooraj Sasindran
f8eb713874 Add low latency and high bandwidth network capabilities
Bug: 194332512
Test: build
Change-Id: I415ca1ba90ea54c4106f806fe855bcb84d3e38ba
2022-01-25 09:35:30 -08:00
Junyu Lai
41483efa02 Merge "[DU09-1]Adding the NetworkStatsCollection Builder" 2022-01-25 16:44:16 +00:00
Junyu Lai
bc8328bda4 Merge "[MS68.2] Adapt NetworkPolicyManagerService to use registerUsageCallback" 2022-01-25 13:30:57 +00:00