Commit graph android_packages_modules_Co.../service/Android.bp
Message SHA1
Move #nativeWaitForService into CommonConnectivityJni
AServiceManager_waitForService sytem APIs currently only callable
via dlsym(): b/376759605. When built with sdk_version current,
the NDK stubs for "sdk" variants only include NDK APIs,
excluding #systemapi APIs.

Flag: EXEMPT Mechanical refactors
Test: atest ServiceManagerWrapperIntegrationTest
Change-Id: I48f690d771c7905e79e463617ded772f753cc854

Mark Chien   authored and   Patrick Rohr   commited 2025-08-06 10:44:39 -07:00
f250ade6fa
Add ART profile to Connectivity service.
This CL adds an ART profile to the Connectivity service. The profile was
generated by profiling the Connectivity service on Droidfood population.

The ART profile is expected to reduce the size of the Connectivity
service generated code size by 3.9MB!

Background: A profile is a list of classes and methods that are
frequently used, which ART uses to compile parts of the code ahead of
time, and the rest of the code can be interpreted and Jitted on the fly
if needed, this improves app-startup, memory and disk space
significantly!

For system server modules (like Connectivity), the current behavoir is
to Speed compile (compile everything), which for sure compiles
unnecessary code. By moving the speed-profile mode we are saving around
3.9MB of disk space which also decreases the load on memory!

The new behavior is guarded by a new build feature
`RELEASE_ART_COMPILE_CONNECTIVITY_SERVICE_SPEED_PROFILE`

Bug: 241823638
Flag: build.RELEASE_ART_COMPILE_CONNECTIVITY_SERVICE_SPEED_PROFILE
Test: `m`
Test: with flag on: go/art-benchmark?p=BootImageProfileId:54912&f=CandidateName:in:54914 (code size reduction by -3.9MB)
Test: with flag off: go/art-benchmark?p=BootImageProfileId:54912&f=CandidateName:in:54913 (no code change or metric changes)
Change-Id: I5d44eaaa77c5241403d6e75b05d28d6256b6df68

Islam Elbanna   commited 2025-07-29 07:12:08 -07:00
5965628f5e
Merge "Update IDnsResolver AIDL version" into main
Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-07-25 15:31:40 -07:00
75c2e461b6
Merge "Create CommonConnectivityJni to share between modules" into main
Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-07-24 09:56:39 -07:00
0e5defc1e9
Create CommonConnectivityJni to share between modules
Flag: EXEMPT mainline
Test: TH
Change-Id: Ia85dfd3d979803baca9e971d1083f54dff46de53

Jimi Chen   commited 2025-07-23 05:47:12 +00:00
e5a4e6b0ba
Update IDnsResolver AIDL version
Flag: EXEMPT only used by integration test
Bug: 379992903
Test: presubmit
Change-Id: Id21f618f8feb08649577912e34b90f068b9386ae

Ningyuan Wang   commited 2025-07-23 13:33:38 +09:00
93541b08ae
Use beta flag for bluetoothTetheringRandomizedAddress
Bug: 287177081
Test: TH
Flag: com.android.tethering.mainline.beta.bluetooth_tethering_randomized_address
Change-Id: I1de9f4bb15c8423f09381a0c7513f0d7ebf80856

Motomu Utsumi   authored and   Hao Liu   commited 2025-07-17 21:30:07 +00:00
4b4f3018a5
Implement the private DNS bypass logic for captive portal over CCT.
Flag: EXEMPT the API caller is guarded by a legacy experiment flag
Bug: 368416967
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.CSNetdBypassRulesTests
Change-Id: I0e24bf37c412e6f5676924269ca98db1f9dfd6df

Xiao Ma   commited 2025-07-02 15:13:20 +09:00
5fd76d347d
Report satellite coarse usage
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.metrics.SatelliteCoarseUsageMetricsCollectorTest \
      --update-device
Test: atest ConnectivityCoverageTests --test-filter 'CSTest*' --update-device
Test: atest ConnectivityCoverageTests --test-filter 'ConnectivityService*' --update-device
Test: Manual:
  1. Change code to use TRANSPORT_CELLULAR
  2. m statsd_testdrive && statsd_testdrive -e 1102
  3. Turn off mobile data.
Flag: EXEMPT controlled with kill switch
Bug: 419123367
Change-Id: I264efa6802612809fdbff22901f31447f370bbe5

Junyu Lai   commited 2025-05-31 16:37:59 +08:00
bb589cf33c
Implement network avoid bad wifi from carrier config
Flag: android.net.platform.flags.avoid_bad_wifi_from_carrier_config
Bug: 410976315
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.MultinetworkPolicyTrackerTest
Change-Id: I89c579a8d5c7299303278280c463aa4c7c5bea99

Jimi Chen   commited 2025-05-08 07:25:36 +00:00
0881fc0a7d
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