Commit graph android_packages_modules_Co.../service
Message SHA1
Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I14e5b317804177f0d9aaa5c14b889e9532d956b4

Bill Yi   commited 2025-04-07 08:02:16 +00:00
1cb46a87b7
Temporarily raise the number of system requests to 375
This is a stopgap to palliate a bad interaction between
ConnectivityService and JobScheduler.

To help developers find request leaks and protect against OOMs
in the system server, ConnectivityService is enforncing a maximum
number of network requests/callbacks per UID. It has a higher
value for system UIDs because some system components need to
file requests on behalf of apps, most prominently JobScheduler.

The count is increased on entry in ConnectivityService, on the
Binder thread ; this is when CS can throw TooManyRequestsException
to the caller, it could not do that later when the request is
actually registered on the handler thread.
Conversely it only decreases the count on the handler thread,
because until then it doesn't know whether the request was
actually registered, and it can't look at that data structure on
the Binder thread.
This leads to a slightly confusing result where a UID can register
a request immediately after it unregisters one, and it will receive
TooManyRequestsException, because the unregister hasn't been
processed yet and the count not decremented yet.
This is arguably a bug, but if your app is treading on that last
request, you almost certainly had a leak anyway, and you should
not be trying to play with the exact count of requests either.
The remaining case is when an app would unregister and register
requests again in a tight loop, but there is no valid use case for
that, right ? Right !?

Enter JobScheduler. Because the limit for system UIDs is 250
requests but there can be more than 250 UIDs (especially on
devices with multiple users), JobScheduler has its own limit of
requests (which is set to 125). It has heuristics to choose which
are the most important 125 UIDs to file requests for.

When the request count exceeds 125, or when something
happens that may change which are the most important 125
UIDs, JobScheduler will re-evaluate which are the most important
ones. Upon doing this, it will unregister all requests and file
again the important ones in a tight loop. At worst, it will
therefore remove 125 requests and add 125 requests again,
taking up at most all 250 requests allowed for system UIDs ;
if the system server has any other request outstanding (and
it does), it may hit the issue where CS doesn't know yet that
requests have been unregistered, and crashes and hilarity ensue.

To palliate the issue above, this patch increases the allowed
request count for system UIDs by 125. This immediately should
fix the issue where all 250 requests are taken up by JobScheduler.

For a long-term fix, we should instead make at least one of the
following fixes :
- Have JobScheduler be smarter, and make sure it only unregisters
  the requests that it no longer needs instead of all of them.
- Make CS only throw when the requests are really full, by using
  some combination of locking, making the caller wait or similar.
- Have a separate pool of requests for JobScheduler that is
  dimensioned so it knows it can file all the necessary requests
  and no longer has to limit itself, and simplify the JS code.

Flag: EXEMPT bugfix
Bug: 391114053
Test: ConnectivityServiceTest
Change-Id: I4c4702e2d0c5d03eb5f3d6fe0f1578a210b188e8

Chalard Jean   commited 2025-04-03 15:02:20 +09:00
ff3222ce51
Automated log_list.json generation version 51.57
Bug: N/A
Test: N/A
Flag: NONE automatic key rotation
PiperOrigin-RevId: 741845525
Change-Id: I4fe20e2288e9a99f4ade358d24302fd9b26b6660

Android Network Security   authored and   Sandro Montanari   commited 2025-03-31 13:43:32 +00:00
b0ce1a5309
Pretty print AutodestructReference
Test: manual
Flag: EXEMPT logging-only change
Change-Id: I9eebe7e02704f92fe01b7c6abfec991aed8edc0b

Chalard Jean   commited 2025-03-28 15:50:52 +09:00
f9ef31d4ea
Merge changes from topic "revert-3561690-revert-3538339-SNUWWZJNJZ-BUWEOGUTIT" into main am: 2519a78731
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3563843

Change-Id: I71adf8e70b37b93378041ca17bb3d20c8f871cd5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2025-03-27 01:14:42 -07:00
480d443869
Add TargetApi annotation to ConnectivityService and QuicConnectionCloser
Test: TH
Change-Id: I5339b986d04462710ff9e9469050741f35ca4448

Motomu Utsumi   commited 2025-03-27 12:24:34 +09:00
8775fc7cf6
Revert "Revert "Remove unnecessary ifindex arg from destroyUdpSo..."
Revert submission 3561690-revert-3538339-SNUWWZJNJZ

Reason for revert: NewAPI error will be fixed by separate CL

Reverted changes: /q/submissionid:3561690-revert-3538339-SNUWWZJNJZ

Change-Id: I2ae43c61c9ba0e0db3202a46e63756a3ea5a6512

Motomu Utsumi   commited 2025-03-27 08:49:10 +09:00
4d4563d62a
Revert "Revert "Add hidden API to register/unregister QUIC conne..."
Revert submission 3561690-revert-3538339-SNUWWZJNJZ

Reason for revert: NewAPI error will be fixed by separate CL

Reverted changes: /q/submissionid:3561690-revert-3538339-SNUWWZJNJZ

Change-Id: Ia7367e9332f4d376bd0be4c03c095ee00de9177a

Motomu Utsumi   commited 2025-03-27 08:49:00 +09:00
e8e28f6236
Merge changes from topic "revert-3538339-SNUWWZJNJZ" into main am: 86961c4b73
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3561690

Change-Id: I8ad3379f937a13c11fe0574c4397a4e5823d777c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Chaitanya Cheemala (xWF)   authored and   Automerger Merge Worker   commited 2025-03-26 04:08:27 -07:00
3d3b87b4f9
Merge changes I0eb70c12,I6cd727bd into main am: ebdcd9e199
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3538339

Change-Id: Iceb5c099835684c4014d1e05613d4200869b802e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2025-03-26 03:11:15 -07:00
fdb5ac536f
Revert "Add hidden API to register/unregister QUIC connection cl..."
Revert submission 3538339

Reason for revert: Likely culprit for b/406432012 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Reverted changes: /q/submissionid:3538339

Change-Id: I61b02f2b1b667e9a41b677f8062e8e96aac09f6e

Chaitanya Cheemala (xWF)   commited 2025-03-26 03:07:07 -07:00
947b53b0d3
Revert "Remove unnecessary ifindex arg from destroyUdpSocket"
Revert submission 3538339

Reason for revert: Likely culprit for b/406432012 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Reverted changes: /q/submissionid:3538339

Change-Id: I70395af68b0f28e5c333333cb03a42f7633b0d5d

Chaitanya Cheemala (xWF)   authored and   Gerrit Code Review   commited 2025-03-26 03:07:07 -07:00
68b852a69c
Remove unnecessary ifindex arg from destroyUdpSocket
Bug: 311792075
Test: m
Change-Id: I0eb70c1248aff347e6f988789f340e117fceea33

Motomu Utsumi   commited 2025-03-26 16:48:43 +09:00
58498d1eee
Add hidden API to register/unregister QUIC connection close payload
QUIC stack running on the app process will call this API and register
QUIC UDP socket and UDP payload that can close QUIC connection.

When the app loses network access (e.g. due to freezer or firewall
chain), ConnectivityService 1)destroys the registered UDP socket by
sending a SOCK_DESTROY netlink message and 2)sends the registered UDP
payload to the server. This prevents unnecessary modem wakeups caused
by packets from the server after the apps lose network access.

Additionally, to close QUIC connection for apps that crash or are
killed, ConnectivityService sends the registered UDP payload when it
receives a socket destroy diag message for the registered socket.

Bug: 311792075
Test: CSDestroySocketTest CtsNetTestCases
Change-Id: I6cd727bd8bb0fe1d17360edfa395f73d24da6920

Motomu Utsumi   commited 2025-03-26 16:48:28 +09:00
627b8c6d34
Merge "Removing interfaces from the InterfaceTracker when network is destroyed." into main am: 45a95e4b99
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3543880

Change-Id: I68bdb033e2a5c31145b0f6a70a0e82c9156fd7f8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Sarup Dalwani   authored and   Automerger Merge Worker   commited 2025-03-25 08:04:51 -07:00
f2500c577f
Merge "Removing interfaces from the InterfaceTracker when network is destroyed." into main
Sarup Dalwani   authored and   Gerrit Code Review   commited 2025-03-25 07:40:41 -07:00
45a95e4b99
Removing interfaces from the InterfaceTracker when network is destroyed.
Bug: 400681214
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.InterfaceTrackerTest
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivityservice.CSInterfaceTrackerTest
Change-Id: Ifb3388800dec6ed208ca28dba080c5b736f09d35

Sarup Dalwani   commited 2025-03-25 01:34:05 +00:00
28c0533bf0
Merge "Fix SSID in notification for RTL languages" into main am: e1564ce3c8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3235925

Change-Id: I51b35282216929c99e674fd79dff5e83b641f6e2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2025-03-23 19:06:39 -07:00
878d5c1577
Merge "Fix SSID in notification for RTL languages" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2025-03-23 18:35:59 -07:00
e1564ce3c8
Merge changes I1d25e5c4,I367f5377 into main am: ee58f011ed
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3554881

Change-Id: I871477ea7e232b93e00ac9adf8f813ec01f4660f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2025-03-21 16:40:14 -07:00
64c00aa254
Merge changes I1d25e5c4,I367f5377 into main
* changes:
  Use "*" to indicate default capabilities in config
  Move NetworkCapabilities parsing to EthernetConfigParser entirely

Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-21 16:14:26 -07:00
ee58f011ed
Use "*" to indicate default capabilities in config
Instead of using an empty string, make the use of default capabilities
explicit by requiring "*" to be specified.

This behavior is more consistent and allows OEMs to explicitly configure
an interface without any capabilities (apart from those which are
hard-coded). (Technically, they could do so by specifying one of the
hardcoded capabilities in the config).

Test: TH
Change-Id: I1d25e5c4b302b0dbde5e1bb91fc1ed5a7b08be9d

Patrick Rohr   commited 2025-03-21 14:21:59 -07:00
bcb2869df1
Merge "Only apply the early network agent creation on B" into main am: 4e2efc94f5
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3555988

Change-Id: Iba38ec6cafb3687343a7024cb41c2f22024fbd94
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2025-03-21 10:05:31 -07:00
986dcd0769
Merge "Only apply the early network agent creation on B" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-21 09:27:23 -07:00
4e2efc94f5
Merge "Disable non-thread local network matching" into main am: e0051cdeb9
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3550880

Change-Id: I5716a377ab8fc96c129d5605f984fcbc08ae5014
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2025-03-21 08:28:55 -07:00
bf03e7f8c8
Merge "Disable non-thread local network matching" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-21 08:08:56 -07:00
e0051cdeb9
Disable non-thread local network matching
Currently, apps targeting V can see thread local network.

This change introduces a mechanism to make existing
apps unable to see non-thread local networks to ensure minimal
impact on existing devices and applications while adopting this
behavior. Apps targeting B+ Sdk and run on V+ devices can see
non-thread local networks.

Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.CSLocalAgentTests \
      --update-device
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server --update-device
      (on next/trunk_staging release config)
Bug: 349487600
Change-Id: I6aa43cebc20a9017c2d8a8a90ebb1d53040a27bb

Junyu Lai   commited 2025-03-21 19:34:49 +08:00
0b806fd931
Merge "[Thread] add vendor & model name support for net diag" into main am: 52875db997
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3549145

Change-Id: I13458bbdbc28ee44bca537ba73ec58376deaede2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2025-03-21 03:54:47 -07:00
8c738ecae4
Merge "[Thread] add vendor & model name support for net diag" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-21 03:53:47 -07:00
52875db997
Only apply the early network agent creation on B
...and if the feature is not killed.

For devices on V and below, this feature should be subject
to a rollout. That rollout should be done in mainline beta
if possible at all, meaning the flags can be defined later.

If beta isn't possible after all, a legacy rollout can happen
starting in M2025-06 too.

Test: manual
Change-Id: I941762bf759ce25b4bd1f908e971ceaf4f49f671

Chalard Jean   commited 2025-03-21 19:29:07 +09:00
3d0e3121d9
Merge changes Ic9fee5bb,I30fa35ce,If52cc211,I87e9d710 into main am: 3575c37e47
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3555984

Change-Id: Id465ae8e4cbc01d81908dca16222a22db9e250ce
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Jean Chalard   authored and   Automerger Merge Worker   commited 2025-03-21 02:52:52 -07:00
d91c8b90f4
Merge changes Ic9fee5bb,I30fa35ce,If52cc211,I87e9d710 into main
* changes:
  Reapply "Immediately create networks unless chickened out"
  Reapply "Always disconnect agents immediately."
  Reapply "Make iterating over mNetworkAgentInfos safer."
  Let DSCP policy test accept early network agent creation

Jean Chalard   authored and   Gerrit Code Review   commited 2025-03-21 02:31:53 -07:00
3575c37e47
[Thread] add vendor & model name support for net diag
1. allow OEMs to default the vendor and model name to system properties.
2. use the vendor & model name for net diag TLVs

Change-Id: I30e988ba3e9cb9f9c5dc3a096f162d5dbcdfbc11

Kangping Dong   commited 2025-03-21 17:20:15 +08:00
6303c84ef5
[Thread] add config_thread_country_code_enabled to overlayable.xml am: 089103dff9
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3556283

Change-Id: Ia69acdb13168ad8fd9eeefbdda8392472cad919b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Zhanglong Xia   authored and   Automerger Merge Worker   commited 2025-03-21 02:08:03 -07:00
08d3a14b04
[Thread] add config_thread_country_code_enabled to overlayable.xml
This commit adds `config_thread_country_code_enabled` to the
overlayable.xml to allow the device to overlay this configuration.

Bug: b/402276117
Test: Set the `config_thread_country_code_enabled` to `false` in
      the real Android device, then run the command
      `adb shell dumpsys thread_network` to check the state of
      CountryCode module.

Change-Id: I37cea57a38f5487c3a07508854adb6cfd25d50b2

Zhanglong Xia   commited 2025-03-21 07:14:12 +00:00
089103dff9
Reapply "Immediately create networks unless chickened out"
Now that the faulty test is fixed,
This reverts commit 0141d82c2d.

Test: ConnectivityCoverageTests CtsNetTestCases FrameworksTelephonyTests
Change-Id: Ic9fee5bb7efb8ca4c05d7c9e600236186d094080

Chalard Jean   commited 2025-03-21 14:57:25 +09:00
324365a901
Reapply "Always disconnect agents immediately."
Now that the faulty test is fixed,
This reverts commit 19dcc447c4.

Test: ConnectivityCoverageTests CtsNetTestCases FrameworksTelephonyTests
Change-Id: I30fa35cef1729e6ecd4140c52fabfa2da1a9bb4b

Chalard Jean   commited 2025-03-21 14:57:25 +09:00
9fdc988dc8
Reapply "Make iterating over mNetworkAgentInfos safer."
Now that the faulty test is fixed,
This reverts commit 09bc78fda7.

Test: ConnectivityCoverageTests CtsNetTestCases FrameworksTelephonyTests
Change-Id: If52cc211b7859c0add07c16f171a6ce342ccca97

Chalard Jean   commited 2025-03-21 14:57:25 +09:00
2f52a0e86d
Merge "Release ClientNetworkRequest before marking request unfulfillable" into main am: 360536d926
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3550249

Change-Id: Id2a6373e18a42fc0eb14ce7d68af16dabc8a635b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2025-03-20 10:10:04 -07:00
379fc18f0d
Merge "Release ClientNetworkRequest before marking request unfulfillable" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-20 09:14:05 -07:00
360536d926
Merge "[Thread] add missing Thread overlay decl config_thread_border_router_default_enabled" into main am: 4b2271398c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3550885

Change-Id: Ib172e55acaf87fa783754b51c4f1885a71120818
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2025-03-20 02:33:04 -07:00
c33cbd79ce
Merge "[Thread] add missing Thread overlay decl config_thread_border_router_default_enabled" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-20 01:54:10 -07:00
4b2271398c
Merge changes from topic "revert-3548747-TOVIIQGWFJ" into main am: 5a3a51eb7a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3553385

Change-Id: I7aea4dae9ae69ec6b84cb57ae1552fd705cfd7d9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

ESWAR MAGATAPALLI (xWF)   authored and   Automerger Merge Worker   commited 2025-03-20 01:13:24 -07:00
74477dd0d8
Merge changes from topic "revert-3548747-TOVIIQGWFJ" into main
* changes:
  Revert "Make iterating over mNetworkAgentInfos safer."
  Revert "Always disconnect agents immediately."
  Revert "Immediately create networks unless chickened out"

ESWAR MAGATAPALLI (xWF)   authored and   Gerrit Code Review   commited 2025-03-20 00:52:25 -07:00
5a3a51eb7a
[Thread] add missing Thread overlay decl config_thread_border_router_default_enabled
Bug: 401654864

Change-Id: I45886e094eddf078b36b23757fca17f650fb9420

Kangping Dong   commited 2025-03-20 15:15:00 +08:00
ff28366d9d
Merge "LocalNet: remove buggy getIpv4MappedAddressBitLen()" into main am: 202c848576
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3550771

Change-Id: I61f85a4b28043809a4458e8e8ac84bf3165d5ba8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Maciej Żenczykowski   authored and   Automerger Merge Worker   commited 2025-03-19 22:54:06 -07:00
f309cdd743
Merge "LocalNet: add DNS over TLS exception" into main am: a3926c8b4a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3553187

Change-Id: I6b04ca2315ac0e51bd1e204c5dea7c2bd41c67b1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Maciej Żenczykowski   authored and   Automerger Merge Worker   commited 2025-03-19 22:53:24 -07:00
31aa9f098a
Merge "LocalNetAccessKey - improve toString" into main am: 10ad709f3a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3550250

Change-Id: Ie8b59c39175be29f685f2500c2e4155392a780f2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Maciej Żenczykowski   authored and   Automerger Merge Worker   commited 2025-03-19 22:52:03 -07:00
ec2d305a80
Merge "LocalNet: remove buggy getIpv4MappedAddressBitLen()" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-19 22:28:59 -07:00
202c848576
Merge "LocalNet: add DNS over TLS exception" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-19 22:27:17 -07:00
a3926c8b4a