Commit graph android_packages_modules_Co.../tests/unit/java/com/android
Message SHA1
Merge "Format MdnsUtilsTest" into main am: f0dcda3be3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3556293

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

Treehugger Robot   authored and   Automerger Merge Worker   commited 2025-03-24 21:44:10 -07:00
bdb6c117af
Merge "Format MdnsUtilsTest" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-24 21:16:34 -07:00
f0dcda3be3
Format MdnsUtilsTest
Use the ktlint.py script to correct Kotlin code formatting errors.

Test: m
Change-Id: Ic3b4ff16fcaa465836c5b6653f1ab8dcc1b718b9

Paul Hu   commited 2025-03-24 10:06:56 +00:00
a16f8b8126
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 "Address linter errors" into main am: 9c163e4207
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3554882

Change-Id: Ibe47f8956e0781dede2b07610c55a8d8a1fb4684
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 17:37:59 -07:00
c7ce92394f
Merge "Address linter errors" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-21 17:29:50 -07:00
9c163e4207
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 Ie63a3583,I1354ec53,I3806750a,I48d0b0f9,I4da56735 into main am: d022fac1c2
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3554879

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

Maciej Żenczykowski   authored and   Automerger Merge Worker   commited 2025-03-21 16:39:18 -07:00
80bc530874
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
Merge changes Ie63a3583,I1354ec53,I3806750a,I48d0b0f9,I4da56735 into main
* changes:
  Move isAtLeastB to dependencies
  Pass nullable values to parse functions
  Rename EthernetTrackerConfig to EthernetConfigParser
  Do not support configuring test interfaces in config.xml
  Prevent mixing mutable and immutable lists

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-21 16:08:07 -07:00
d022fac1c2
Address linter errors
Test: TH
Change-Id: I6d1fae596ea9757fe6e6b04e85b6cb8cae162a2b

Patrick Rohr   commited 2025-03-21 14:21:59 -07:00
70d98dcef2
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
Move NetworkCapabilities parsing to EthernetConfigParser entirely
Previously, this code path was hard to follow. EthernetConfigParser
parsed the capabilities specified in the xml, while
createDefaultNetworkCapabilities and / or createNetworkCapabilities
added additional capabilities to those specified in the xml.

This change moves the creation of the final NetworkCapabilities for
configured interfaces inside EthernetConfigParser to make it easier to
follow.

Test: TH
Change-Id: I367f53774eeee5aeca0fa7071db0403a6ce8bac5

Patrick Rohr   commited 2025-03-21 14:21:59 -07:00
00c17ed78d
Rename EthernetTrackerConfig to EthernetConfigParser
Because that's what it really is.

Test: TH
Change-Id: I3806750a87042b4ae8e816f00388d6393346d0a8

Patrick Rohr   commited 2025-03-21 10:43:48 -07:00
f0e0e2819d
Merge changes Iceacbcab,I849ab478,I145de9bf into main am: 6150ec80cc
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3554385

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

Patrick Rohr   authored and   Automerger Merge Worker   commited 2025-03-21 10:07:46 -07:00
a3cf1ded15
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 changes Iceacbcab,I849ab478,I145de9bf into main
* changes:
  Move capability parsing to EthernetTrackerConfig
  Move transport parsing to EthernetTrackerConfig
  Delete unnecessary createEthernetTrackerConfig function

Patrick Rohr   authored and   Gerrit Code Review   commited 2025-03-21 09:37:31 -07:00
6150ec80cc
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
Merge "Make sure tests know to handle both early creation true and false" into main am: a0fa137d85
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3554646

Change-Id: I1db34d3fdd3033b59a40ef9d065e29021f1e49d7
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 05:40:31 -07:00
5f0c5ce0dc
Merge "Make sure tests know to handle both early creation true and false" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-21 05:02:06 -07:00
a0fa137d85
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 changes I1707d28e,Ibb4a2916 into main am: 04271629cc
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3538341

Change-Id: Ifdc27aa7b7c64520b071c3cb3080920c861c77c4
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:53:13 -07:00
f620d4cbab
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
Make sure tests know to handle both early creation true and false
This is necessary to pass tests whatever the values of the features are.

NetworkAgentTest was updated assuming the feature was true, so
this patch revives the old code for when it's false.

TestableNetworkAgent reads the feature directly from
ConnectivityManager when it's not mocked.

Test: CtsNetTestCases
Change-Id: Ia556fbb1d1b6a38a4995b021981e2693d778bfff

Chalard Jean   commited 2025-03-21 19:29:06 +09:00
0cc8d81cc7
Merge changes I1707d28e,Ibb4a2916 into main
* changes:
  Dump top distinct tag counts per uid
  Support per uid tag throttling to NetworkStats

Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-21 03:21:36 -07:00
04271629cc
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
Support per uid tag throttling to NetworkStats
Introduced filtering of NetworkStats based on the number of
distinct tags per UID, to prevent excessive memory usage.

This feature is default enabled with a kill switch
per_uid_tag_throttling. And a DeviceConfig that allows
customization of throttling threshold.

Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.net.NetworkStatsFactoryTest
Bug: 364353020
Change-Id: Ibb4a2916306153d229ab996247eb6e78009f0fb0

Junyu Lai   commited 2025-03-21 16:52:23 +08:00
2a451ea222
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
Move capability parsing to EthernetTrackerConfig
Test: EthernetTrackerTest
Change-Id: Iceacbcabb21ec4227b485a0f97e10cb78c7551aa

Patrick Rohr   commited 2025-03-20 15:06:16 -07:00
e0fd64321d
Move transport parsing to EthernetTrackerConfig
Test: EthernetTrackerTest
Change-Id: I849ab478a101955c71e7881eb6609f5630a0062a

Patrick Rohr   commited 2025-03-20 15:06:16 -07:00
c28cd83cee
Delete unnecessary createEthernetTrackerConfig function
Test: TH
Change-Id: I145de9bfc4b3c57a18a652eebfe6c668920e7851

Patrick Rohr   commited 2025-03-20 11:44:34 -07:00
3a4c4c593a
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 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
Revert "Always disconnect agents immediately."
Revert submission 3548747

Reason for revert: Droidmonitor created revert due to b/404956859. Will be verified through ABTD for standard investigation.

Reverted changes: /q/submissionid:3548747

Change-Id: I44affb742ca066406e93fc75056b4d3d1298eadb

Satish Yalla   commited 2025-03-19 20:18:37 -07:00
19dcc447c4
Release ClientNetworkRequest before marking request unfulfillable
Otherwise, the tear down code that unregisters the NetworkAgent runs
after calling declareNetworkRequestUnfulfillable() which surpresses the
onLost() callback.

Test: CSL2capProviderTest
Change-Id: I447881bd4bd76ba492abf6cc3177143db626749e

Patrick Rohr   commited 2025-03-19 17:12:07 -07:00
512b789a8d
Merge changes I65763a52,Ib1d77da3,I5d8b3850 into main am: 451f2dd39d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3548747

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

Jean Chalard   authored and   Automerger Merge Worker   commited 2025-03-19 15:52:16 -07:00
7d06c4697e
Merge changes I65763a52,Ib1d77da3,I5d8b3850 into main
* changes:
  Immediately create networks unless chickened out
  Always disconnect agents immediately.
  Make iterating over mNetworkAgentInfos safer.

Jean Chalard   authored and   Gerrit Code Review   commited 2025-03-19 15:09:28 -07:00
451f2dd39d
Always disconnect agents immediately.
This relands aosp/2623893 now that the underlying timing
issues have been fixed. It also addresses the two outstanding
comments that had not been fixed. It conditions it on the
"queue in system server" feature.

Currently, various codepaths in ConnectivityService disconnect
networks using NetworkAgentInfo#disconnect. This posts a message
to the NetworkAgent to disconnect and also posts a message to
ConnectivityService to call disconnectAndDestroyNetwork, which
performs all cleanup in ConnectivityService. These two messages
race and the order is non-deterministic.

Instead, always disconnect using disconnectAndDestroyNetwork,
and have disconnectAndDestroyNetwork post the message to the
agent to disconnect.

This fixes a bug where if wifi uses unregisterAfterReplacement
twice in quick succession, when the third agent connects it
doesn't work because the interface is still being used by the
second network.

Bug: 286649301
Test: covered by existing tests
Change-Id: Ib1d77da39232c02060a7a7c016ffd3a969e2356d

Lorenzo Colitti   authored and   Chalard Jean   commited 2025-03-19 21:03:23 +09:00
0e9f5e626b
Merge "Fix kotlin lint errors" into main am: 8b7891106c am: b3245ea97d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3550879

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

Junyu Lai   authored and   Automerger Merge Worker   commited 2025-03-18 23:09:15 -07:00
7945fbd90a
Fix kotlin lint errors
This change is a no-op which only fix lint errors.
This is necessary to make the subsequent changes easier to review.

Test: TH
Bug: 349487600
Change-Id: Ief867009db6aaabd9d0759048cdd7c3318991b02

Junyu Lai   commited 2025-03-19 10:52:36 +08:00
c3717cf502
Merge "Connectivity: remove usages of deprecated Mockito matchers" into main
Adrian Roos   authored and   Android (Google) Code Review   commited 2025-03-18 15:23:04 -07:00
811cc3e1e1
Merge changes I71abf9d0,I57f25f5e,If6b15419 into main am: 6f2b294fd0 am: 4a560d10d4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3548745

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

Jean Chalard   authored and   Automerger Merge Worker   commited 2025-03-18 04:17:07 -07:00
57e43de86f
Fix SSID in notification for RTL languages
Use the BidiFormatter for the SSID in the notification, as it may need
to be printed differently from the enclosing sentence in RTL languages.

Bug: 316498718
Test: atest
Change-Id: Ibac72235a19e1dc4304bd1e63fc75d019e1a2c19

Remi NGUYEN VAN   commited 2025-03-18 18:00:07 +09:00
51ca5c6a14
Reapply "Add a queue system server-side for NetworkAgent"
Now that faulty Telephony tests have been disabled temporarily
to allow for this bugfix, this can be reverted.
This reverts commit a5ec9b4112.

Test: FrameworksTelephonyTests CtsNetTestCases
Change-Id: I71abf9d02bdd34a4de80157a3f42bdfee6f6617e

Chalard Jean   commited 2025-03-18 14:42:54 +09:00
3c040009c5
Connectivity: remove usages of deprecated Mockito matchers
Upstream Mockito has deleted the deprecated matchers. Migrates usage to replacements
to unblock upgrade.

Test: m checkbuild
Flag: TEST_ONLY
Bug: 310268946
Change-Id: Ib23cb8e29175edb631cd6517754758424764edb4

Adrian Roos   commited 2025-03-17 16:29:46 -07:00
d630928fab
Merge "Add CachedService Class" into main am: ac1af41d42 am: 0c86981698
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3526614

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

Treehugger Robot   authored and   Automerger Merge Worker   commited 2025-03-17 11:31:19 -07:00
e032dda4d4