Commit graph android_packages_modules_Co.../service/Android.bp
Message SHA1
Add L2capPacketForwarder
L2capPacketForwarder forwards packets between an L2CAP BluetoothSocket
and a tun fd.

It uses blocking i/o to do so, since the BluetoothSocket API does not
expose a file descriptor to poll() on.

It remains to be seen whether shutdown() on a tun interface fd is
actually implemented. Currently, the test uses a pair of SOCK_SEQPACKET
sockets which require to be shutdown to interrupt the blocking read.

Test: L2capPacketForwarderTest
Change-Id: I03d2a2dd76ec2b71fdb9e3ea7008daa6d1d124fe

Patrick Rohr   commited 2025-02-07 10:50:48 -08:00
65dc1295dc
Rename net_utils_device_common_timerfdjni to serviceconnectivityjni
Test: builds and boots
Change-Id: I432da644ab6d212df736913089ff3b52d286ea0e

Patrick Rohr   commited 2025-01-16 14:28:13 -08:00
08bf056370
Move TestNetworkService JNI into ServiceConnectivityJni
Test: builds and boots
Change-Id: Ia15833a163604ddbbb9527dff59174f2643daa61

Patrick Rohr   commited 2025-01-16 14:28:13 -08:00
3c14078435
Conditionally include VCN in Tethering module
When the build system flag RELEASE_MOVE_VCN_TO_MAINLINE is true,
VCN framework lib will be included in the tethering boot classpath
fragment and the VCN service lib will be included in the
service-connectivity.jar

Bug: 375213246
Test: flag enabled: VCN libs are in the tethering module
      flag disabled: VCN libs are in the platform
Flag: RELEASE_MOVE_VCN_TO_MAINLINE
Change-Id: If0239eb1684b861b63794762915dab0d62379885

Yan Yan   commited 2024-12-09 12:04:12 -08:00
b4ccc6aff7
Create the timerfd helper class
Create a helper class in Java to provide easy access to timerfd
JNI methods.

Bug: 366373064
Test: atest NetworkStaticLibTests
Change-Id: Iea09cd29e2a6ed837ece30c512393be2e27e8c2e

Paul Hu   commited 2024-11-22 07:12:55 +00:00
8c8d2b1bd8
Merge "Remove dependencies on the 1-variant fallback" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-24 06:56:10 +00:00
ed99321230
Remove dependencies on the 1-variant fallback
When adding a dependencies, if the variants don't match, but the
dependency only has 1 variant anyways, soong will always use that
variant. This makes it hard to add new variants to soong, because the
1-variant fallback stops being used and you start getting missing
variant errors. Make changes to bp files such that all dependencies
correctly specify the variant to use.

Bug: 372091092
Flag: EXEMPT refactor
Test: m nothing
Change-Id: I8d4f59044f268088b44357d27322abbdcdc3001c

Cole Faust   commited 2024-10-22 16:31:00 -07:00
9ff8f4c81b
Create a timerfd JNI class
The timerfd delivers timer expiration notifications via a file
descriptor, which can be used to implement delayed callbacks.
Create a JNI class to interface with the timerfd system calls.

Bug: 366373064
Test: m
Change-Id: I0ae7a4cf618838e614b2fa4523b55a4d0e8f74e2

Paul Hu   commited 2024-10-16 06:29:48 +00:00
eb73d4ddda
Make java_sdk_library dependencies explicit
modules should specify the submodule of java_sdk_library that the module
actually depends on

Test: CI
Bug: 358613520
Change-Id: I0367068c901df98483f6cf95160d3e7801881b0a

Jihoon Kang   commited 2024-09-10 00:01:31 +00:00
8401b6a9f0
Add boilerplate code for CertificateTransparencyService
Flag: com.android.ct.flags.certificate_transparency_service
Bug: 319829948
Test: m
Change-Id: I69dd1b7346a013e9a990c9ae8cec1beb51be074d

Sandro Montanari   commited 2024-08-12 08:50:29 +00:00
9ffc0685d7
Refactor staticlibs
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

Handa Wang   commited 2024-07-05 05:26:46 +00:00
9b0df36ea4
Inform the DNS resolver of the interfaces in a network.
Also simplify DnsManagerTest by using the autogenerated equals()
method in ResolverParamsParcel instead of a hand-rolled
comparison method.

Test: covered by existing tests
Change-Id: Ie1b1bd011a440be0175420f903f39a4153d2245e

Lorenzo Colitti   commited 2024-04-17 23:05:14 +09:00
191f1b2c8c
Separate Struct.java into its own lib.
* Struct.java is removed from net-utils-device-common-bpf and
  net-utils-device-common-struct's source list
* Created a lib net-utils-device-common-struct-base for Struct.java
* Updated libs that require Struct.java to include
  net-utils-device-common-struct-base.
* Replaced net-utils-multicast-forwarding-structs with
  net-utils-device-common-struct in service-connectivity

Bug: 323503345

Test: build tethering module.
Change-Id: I3f60715c3d8043b7569db7612dee9d4fa1ccba59

Yang Sun   commited 2024-03-27 20:15:17 +08:00
3aa62e6773
Merge "Include structs lib in service-connectivity-pre-jarjar" into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-02-29 03:16:28 +00:00
db67a80430
Include structs lib in service-connectivity-pre-jarjar
To use the java struct definitions for multicast routing in connectivity
service, a new lib is defined and included in
service-connectivity-pre-jarjar.

Bug: 323503345

Test: presubmit
Change-Id: I664602fd0fa0a5da136ea28fd3c4d9068c5b46ab

Yang Sun   commited 2024-02-26 17:28:04 +08:00
1c9fb59004
Add SatelliteAccessController class to support messaging on Satellite Internet
- create SatelliteAccessController class to identify role sms and
  satellite communication enabled uid's, to keep track of role changes
  through OnRoleHoldersChangedListener and to request to create
  multi layer request to ConnectivityService.
- unit test coverage

Bug: 320514105
Test: m and atest FrameworksNetTests
Change-Id: I95086f7a4fd6fe1261f432e605d792204ff5310b

Nagendra Prasad Nagarle Basavaraju   commited 2024-02-07 16:10:20 +00:00
33c7da3661
add TRANSPORT_SATELLITE to NetworkCapabilities
This commit also updates to use V14 dnsresolver APIs which was V13.

Bug: 320514105
Test: m & atest FrameworksNetTests
Change-Id: I6e92f4d99e0eba3b5d1d5e45bf11e5e945ea43f1

Nagendra Prasad Nagarle Basavaraju   commited 2024-02-07 16:07:39 +00:00
1fa6f09019
Merge "Remove strict_updatability_linting: true" into main
Cole Faust   authored and   Gerrit Code Review   commited 2024-02-02 18:21:10 +00:00
1042c175a0
[DON'T BLOCK] Test ownership migration rules
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.

For more details please refer to the link below,
<add g3 doc link>

Bug: 304529413
Test: N/A
Change-Id: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Merged-In: I243f17b3f0ad7af9ffa15ca242456e36688733f5

Aditya Choudhary   commited 2024-01-31 12:34:50 +00:00
01b5ede2b2
Remove strict_updatability_linting: true
strict_updatability_linting has been disabled for a while now, due to
an expansion in scope of the NewApi check. We're going to re-enable
it now, but doing so requires removing it from all modules that have
baselined NewApi issues.

Bug: 320698986
Test: Presubmits
Change-Id: Id6c9202c236f33ad89615e4d5fa5a6364147841a
Merged-In: Id6c9202c236f33ad89615e4d5fa5a6364147841a

Cole Faust   commited 2024-01-25 09:38:25 -08:00
ee56c432e0
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
List baseline_filename on modules that are implititly using it
lintable modules currently pick up files named "lint-baseline.xml" to use as the
lint baseline implicitly. This is confusing because you could end up using the
baseline files in more modules than intended. Lint also has a feature where it
requests you remove unnecessary findings from the baseline file, so something
could be necessary for one module, but unnecessary for another that accidentally
picked up the baseline.

We're removing the implicit detection of the baseline file, which requires
all modules using it to list the baseline file explicitly.

Bug: 272769514
Test: Presubmits
Change-Id: If873a4ea20d73bb6268d83589c4fb3ebe54af664

Cole Faust   commited 2023-12-20 11:57:07 -08:00
a52ecf0c5c
Update Andorid.bp to use DnsResolver v13
Bug: 240259333
Test: atest ConnectivityCoverageTests
Change-Id: I92ab5e1eef7ba1715176e3628222084067d14603

Mike Yu   commited 2023-11-20 01:48:53 +00:00
d0ad17c2d1
Merge "suppress unguarded-availability warning for only AServiceManager_waitForService" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2023-11-16 08:35:30 +00:00
eb08e8cdc8
Merge "remove BpfNetMaps.cpp" into main
Maciej Å»enczykowski   authored and   Gerrit Code Review   commited 2023-11-09 03:04:22 +00:00
73943e8eaa
suppress unguarded-availability warning for only AServiceManager_waitForService
Test: build & presubmit
Change-Id: I4542f3809cb49470290b9b7e3f940a8644c301c7

Kangping Dong   commited 2023-11-09 00:09:50 +08:00
26b9f22b2d
[Thread] add ServiceManagerWrapper
Add a JNI wrapper of the NDK version of the ServiceManager which allows
us to retrieve the ot-daemon lazy service.

Bug: 262683651
Test: atest CtsThreadNetworkTestCases
Change-Id: I1d331d1ba06c2b88f156622d4ae864dae7b15dc3

Kangping Dong   commited 2023-11-08 17:46:18 +08:00
192e4b0289
remove BpfNetMaps.cpp
Test: builds, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: If192c17881736c9fe7f8346ad8c5d41d7164eb03

Maciej Å»enczykowski   commited 2023-11-08 07:12:46 +00:00
7b8f475e79
Remove TrafficController
BpfNetMaps now updates bpf map by Java library and does not use
TrafficController.

Bug: 217624062
Test: TH
Change-Id: Id727cf7b79592e913c967156e6e224de338f5f65

Motomu Utsumi   commited 2023-11-07 20:25:24 +09:00
424038fe25
Pass metered information to DNS resolver
Dns Resolver needs to know whether a network is metered when checking if
DNS requests will be blocked by Data Saver.

Bug: 288340533
Test: atest FrameworksNetTests
Change-Id: Ia5822dc522c766c7815680003c7ba275d15ccaff

Ken Chen   commited 2023-10-31 07:38:40 +00:00
5a35cf9086
[BR01.1] Support BpfNetMapsReader
A helper class to *read* java BpfMaps. This is designed to
provide direct bpf access in the caller process through
ConnectivityManager APIs.

The change also removes any statical link to
net-utils-device-common-struct from service-connectivity.
This is because net-utils-device-common-struct is already
included in framework-connectivity. Including it again in
service-connectivity would create a r8 build fail by circular
dependency.

Test: atest FrameworksNetTests:android.net.connectivity.com.android.server.BpfNetMapsTest
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.net.module.util.StructTest
Test: atest FrameworksNetTests:android.net.connectivity.android.net.BpfNetMapsReaderTest
Bug: 297836825
Change-Id: I7a6d2eb816d0dc7343167bddd672806b199f44fe

Junyu Lai   commited 2023-10-23 20:11:02 +08:00
626045a601
Factor out remoteauth dependencies to variables
This will allow using different values for the variables without having
merge conflicts in the dependencies list for each build rule.

Bug: 295788084
Test: m
Change-Id: I7b64a5a01d1f8139e7ce30ce95903d71cb09de9f

Remi NGUYEN VAN   commited 2023-08-31 19:08:17 +09:00
c41daa4106
[Thread] move Thread into com.android.tethering
Bug: 296211911
Change-Id: Ifd4f7cd06f1aeaba739d27d2328e89031ca73235

Kangping Dong   commited 2023-08-23 14:28:50 +08:00
e7fef8938a
Revert "Enable NewApi lint checks on service-connectivity"
This reverts commit a1145a1fd3.

Reason for revert: fix build failure
Bug: 295779471

Change-Id: Id481aa628e1a1173b8b2c79006843025439b5901

Woody Lin   authored and   Gerrit Code Review   commited 2023-08-14 04:47:03 +00:00
7704e695bf
Enable NewApi lint checks on service-connectivity
This should help find changes that do not do proper NewApi checks
in presubmit, and when building with RUN_ERROR_PRONE=true

Test: m
Change-Id: I87ce56d9df2eb27dafd2ec8d2c814c83098a979f

Remi NGUYEN VAN   commited 2023-08-14 02:45:42 +00:00
a1145a1fd3
RemoteAuth Boilerplate
Stub out code and test directories

BUG: 290094832
Test: atest FrameworksNetTests RemoteAuthUnitTests
Change-Id: I850242640f32bea3d46febcde5f3719619b1ea07

Casey Borders   authored and   Salil Rajadhyaksha   commited 2023-07-31 21:41:26 +00:00
13a35ea213
Use current shims in service-connectivity
Instead of NetworkStackApiStableShims, use NetworkStackApiCurrentShims
as this is a development branch.

Use java_defaults in the "merge conflicts expected" section, so that
module release branches can use the same defaults, but set it to
NetworkStackApiStableShims.

The shims are removed from FrameworksNetIntegrationTests, as they are
already available there through service-connectivity-pre-jarjar. Keeping
them as a dependency would make FrameworksNetIntegrationTests use both
Stable shims (directly) and Current shims
(through service-connectivity-pre-jarjar).

Bug: 266205506
Test: m
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:921290b49d109360aae5dc39effaa3b0e691f65a)
Merged-In: I88228152834a1c06830fb51e868fb8e3d8c47519

Change-Id: I88228152834a1c06830fb51e868fb8e3d8c47519

Remi NGUYEN VAN   authored and   Motomu Utsumi   commited 2023-03-27 15:56:23 +09:00
02eee9aa5a
Merge "add TRANSPORT_THREAD to NetworkCapabilities"
Kangping Dong   authored and   Gerrit Code Review   commited 2023-02-28 07:16:16 +00:00
7dc4459d33
add TRANSPORT_THREAD to NetworkCapabilities
This commit also updates to use V11 dnsresolver APIs which was V9.

Bug: 262683651
Test: unit tests
Change-Id: Ifbd71157012dc66ec0f377beef9fa59d1c8620b8

Kangping Dong   commited 2023-01-16 10:51:56 +08:00
707a996c9b
Move mDNS code to service-connectivity-t
Instead of using a separate service-mdns library, move the code to
service-connectivity-t.

service-connectivity-t is chosen because it has access to hidden API of
classes that were made updatable in T, such as NsdServiceInfo and
NsdManager. mdns code can be there as it is only loaded on T+.

Bug: 241738458
Test: atest
Change-Id: I7eb6c9ab8bf0e0a614ea2994c6ed80a1a780241f

Paul Hu   commited 2023-01-13 16:42:48 +08:00
03a51d5674
Merge "Add MdnsAdvertiser"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2023-01-11 05:45:32 +00:00
125ff06cba
Add MdnsAdvertiser
MdnsAdvertiser takes requests to advertise services on given Networks,
and relays them to internal maps of MdnsInterfaceAdvertisers.
SocketProvider is used to create the sockets for the requested networks.

It also ensures that added services do not have name conflicts, as
registration of one service should use the same name on all interfaces,
so any conflict means that every MdnsInterfaceAdvertiser needs to use a
different name. Names are automatically updated with a number suffix
(like "service (2)", "service (3)"), similarly to the legacy
mdnsresponder implementation.

The implementatio of MdnsInterfaceAdvertiser will be added in a
different change.

Bug: 241738458
Test: atest

Change-Id: I21aa93c681dd179b9d6ec425bc0f247a10ba5b0b

Remi NGUYEN VAN   commited 2023-01-10 22:04:05 +09:00
314db00b3f
Add CDM dependency in Tethering
This change introduces a limited library for dependencies on
framework-connectivity from Tethering,
connectivity-internal-api-util, where all classes are annotated with
@RequiresApi(S) to ensure proper API checks are done before usage.

Bug: 245972418

Change-Id: I82bafd9063341adc71d07f0858e6d68283d081f0

Igor Chernyshev   commited 2022-12-16 17:55:53 +00:00
9dac660bf0
Add MdnsInterfaceSocket and MdnsSocketProvider
MdnsInterfaceSocket: using for listening the multicast
socket on specific interface.

MdnsSocketProvider: using for creating and managing the
multiple multicast sockets.
- Listen NetworkCallback and TetheringEventCallback to know the
  network connected / disconnected changes. And use the callbacks
  to create / remove the sockets for mdns discovery

Bug: 254166302
Test: atest FrameworksNetTests
Change-Id: Icd8424792e89e71198fa31f9ec92e1ec8172128d

Paul Hu   commited 2022-12-12 08:15:38 +00:00
2f1de80315
Merge "Revert "Remove the stats protos from ConnectivityService until tests are added""
Frank Li   authored and   Gerrit Code Review   commited 2022-12-08 07:09:41 +00:00
fee29c5c09
Revert "Remove the stats protos from ConnectivityService until tests are added"
This reverts commit ec8c31d3f5.

Reason for revert: Test coverage excludes ConnectivityService metrics and classes via cl/489997332

Change-Id: Ia96f030af983cc2b42ddd82371679d1ccaadd743

Frank Li   commited 2022-11-25 06:08:10 +00:00
55f79d43b0
Add ConfigInfrastructure lib to Android.bp
As part of moving DeviceConfig.java to
packages/modules/ConfigInfrastructure, We need to add
ConfigInfrastructure lib dependency to Android.bp as DeviceConfig APIs
will not be part of the non-updatable part and will not be part of the
base module_current SDK so we have to add an explicit dependency.

Test: m
bug: 253019048
Change-Id: I29f993342e1baf4e75b30c8d99de10bc087a582b

Hassan Ali   commited 2022-11-23 11:41:43 +00:00
c4f63fa973
Merge "Remove the stats protos from ConnectivityService until tests are added"
Frank Li   authored and   Gerrit Code Review   commited 2022-11-15 09:05:37 +00:00
265016d1d0
Remove the stats protos from ConnectivityService until tests are added
Adding service-connectivity-stats-protos creates a lot of extra proto
apis. Currently we don't provide any test cases for these apis.
This affects the coverage of the connectivity coverage test by 5%.
So remove the protos in ConnectivityService until all tests for proto
apis are added.

Bug: 247458964
Test: m ConnectivityCoverageTests
Change-Id: Id35947f675557d27448b74d43ef3e9b112d859e4

Frank Li   commited 2022-11-15 14:07:41 +08:00
ec8c31d3f5
Merge "Add libconnectivity_native"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-11-07 02:07:45 +00:00
5033f855ff