Commit Graph

1131 Commits

Author SHA1 Message Date
Ken Chen
243301748e Write Data Saver setting to BPF map
The information is needed by modules who want to know whether a
specific UID is blocked by Data Saver feature.

1. Add a one-element map data_saver_enabled_map.
2. Update current data saver setting to the map.

Bug: 288340533
Test: atest FrameworksNetTests:android.net.connectivity.com.android.serv
er.BpfNetMapsTest
Test: atest bpf_existence_test

Change-Id: I981da4b569247c33cba2d365cb6f2691f673474e
2023-10-31 01:36:03 +00:00
Maciej Żenczykowski
543d0d32e4 Revert "Add forwarding methods to RoutingCoordinator"
This reverts commit 55ccfe19e2.

Reason for revert: this must be introducing some sort of race
it appears to cause
  atest EthernetTetheringTest 'NetdBinderTest#TetherForwardAddRemove'
to no longer reliably pass.

Change-Id: I5281ab3f42c5ce268d97a12db24a6768db3f4354
2023-10-28 02:10:52 +00:00
Chalard Jean
55ccfe19e2 Add forwarding methods to RoutingCoordinator
Test: RoutingCoordinatorServiceTest
      TetheringTest
Change-Id: Ic3b36ddc236e8615e7d931b6e526556bbd2dac17
2023-10-26 20:18:48 +09:00
Jean Chalard
4e47533688 Merge "Add a routing coordinator class" into main 2023-10-25 09:13:16 +00:00
Junyu Lai
0cfaea8d98 Merge "Revert "Revert "[BR07.1] Expose setDataSaverEnabled from Connect..."" into main 2023-10-25 01:59:12 +00:00
Chalard Jean
2fb66f1b28 Add a routing coordinator class
Test: In followup changes : RoutingCoordinatorManagerTest
Change-Id: Ia6811d614e02123a072c7638291828745abae051
2023-10-24 22:12:26 +09:00
Junyu Lai
df210365fe Revert "Revert "[BR07.1] Expose setDataSaverEnabled from Connect..."
Revert submission 2799494-revert-2745215-npmsbpf-OBOPDXREUI

Reason for revert: Need to 1. Merge API first. 2. Wait for prebuilt. 3. Merge the caller.

Reverted changes: /q/submissionid:2799494-revert-2745215-npmsbpf-OBOPDXREUI

Change-Id: Icd5f3d40595a0d2a221b016cec70568bf3597c16
2023-10-24 07:30:23 +00:00
Jordan Silva
457ae0f00f Revert "[BR07.1] Expose setDataSaverEnabled from ConnectivityManager"
Revert submission 2745215-npmsbpf

DroidMonitor: Potential culprit for Bug 307256512 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.


Reason for revert: 307256512

Reverted changes: /q/submissionid:2745215-npmsbpf

Change-Id: I27119a7484453d1369bbdf71ad2479edec7d664f
2023-10-23 13:23:01 +00:00
Junyu Lai
626045a601 [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
2023-10-23 20:11:02 +08:00
Ken Chen
cf25a54909 Correct LINT path on UidOwnerMatchType
UidOwnerMatchType Java definition moved from BpfNetMaps.java to
BpfNetMapsConstants.java in change I6d7ea044e43180.

Bug: 297836825
Test: presubmit
Change-Id: I4fc28406750cac9143ea47e9304b455ab616d462
2023-10-21 01:47:05 +00:00
Junyu Lai
c279f1830e [BR07.1] Expose setDataSaverEnabled from ConnectivityManager
Currently, data saver switch is controlled in NPMS, which
calls into NetworkManagementService and netd when switching
status. In netd, BandwidthController manipulates the
bw_data_saver chain to control the overall behavior.

However, this code are all platform implementation, which
are not updatable. In order to migrate data saver switch
from iptables to bpf, this API is needed for Connectivity to
change the implementation to directly write bpf in later
patches.

Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Test: atest FrameworksServicesTests:NetworkManagementServiceTest
Bug: 297836825
Change-Id: I71fa41ca739fef8e191fba91b02758ad5f732d5c
2023-10-19 17:43:44 +08:00
Chalard Jean
f9d0e3e94f Reapply "Add LocalNetworkConfig"
This reverts commit 6eea22b18c.

Change-Id: I0a2cef4ee992577674c92ecd384dc6f4361afa02
2023-10-18 15:50:02 +09:00
Anton Kulakov
6eea22b18c Revert "Add LocalNetworkConfig"
Revert submission 2777667

Reason for revert: DroidMonitor-triggered revert due to breakage, bug b/305187495

Reverted changes: /q/submissionid:2777667

Bug: 305187495

Change-Id: Iae4ef936a4c111ae5668e539ce4cdbbb14c811f4
2023-10-13 15:18:55 +00:00
Treehugger Robot
d2d3b5dd88 Merge "Add additional overriding methods to signature files" into main 2023-10-13 15:05:40 +00:00
Chalard Jean
fa21cafc1c Add LocalNetworkConfig
This doesn't do anything at this patchset, but the whole
pipe from the agent to ConnectivityService is built.

LocalNetworkInfo will be the name of the public information
sent in callbacks to clients.

Test: CSLocalAgentTests
Change-Id: I70e133031ef3b0aaf6c3e59ccc2ad895c66d339c
2023-10-13 14:40:45 +09:00
Paul Duffin
b3c3f2e9d0 Add additional overriding methods to signature files
This change adds overriding methods that are essential to compile the
stubs generated from the signature files.

More information and the background for this change is available at
go/add-overriding-one-pager.

Test: m checkapi
Bug: 299366704
Change-Id: Idba307148fd9afa87bfb7e0c89e00d9bd97ec204
2023-10-12 19:21:07 +01:00
Chalard Jean
d6f4efb1a8 Add hidden constants for communicating about local network agents
Test: FrameworksNetTests
Change-Id: Ic490fee6ee70d74acff0a290199b2946817173d0
2023-10-12 13:30:49 +09:00
Jean Chalard
02193c0cce Merge changes Ibb8d33b7,Ie168fe1f,I9f699b63 into main
* changes:
  Prepare exposing Network{Request,Caps}.forbiddenCapabilities
  Add a keep connected for test reason
  Improvements to CSTest : legacy type, wait for LOST, permissions
2023-10-12 02:14:52 +00:00
Chalard Jean
cf7dbcae41 Prepare exposing Network{Request,Caps}.forbiddenCapabilities
This is useful going forward in particular because there will
be a default forbidden capability for LOCAL_NETWORKS. This
means it will be useful to be able to remove it.

It is also generally useful and we have been wanting to open
this API to the public, so this is a good opportunity to do so.

Test: new tests for NetworkRequest
      NetworkCapabilitiesTest already has tests because it
      already was @SystemApi
Change-Id: Ibb8d33b799f2d274326fd9cd0b05a2c33a18032a
2023-10-11 17:02:52 +09:00
Chalard Jean
c517fb1247 Add a keep connected for test reason
This has been sorely needed for a while. Instead of filing requests
for each of your networks in a CSTest, which is fiddly at best and
sometimes almost impossible (because you can't single out the network),
you can now add this flag and be done with it.

Test: CSKeepConnectedTest
Change-Id: Ie168fe1f3a17de035fdf05e3d6580d3262a3448e
2023-10-11 17:02:52 +09:00
Chalard Jean
026ca940d9 Improvements to CSTest : legacy type, wait for LOST, permissions
• Make sure all Agents have a legacy type. This is necessary to
  avoid crashes in LegacyNetworkTracker
• Wait for LOST when disconnecting a network
• Make sure the test package sees its own permissions (importantly
  it can't see background networks otherwise, because it lacks
  CHANGE_NETWORKING_STATE)

Test: in the followup
Change-Id: I9f699b6372a8fe0d5bcd5310d8f35f72e48a6c61
2023-10-11 17:02:51 +09:00
Paul Duffin
7bd2d108ea Prepare for keeping concrete overrides of abstract methods
Currently, metalava will discard concrete overrides of abstract methods
from the API signature files which causes problems when attempting to
generate stubs from those files and also discards information that may
be important in API reviews. This change is the first step in the
process of changing that behavior.

This change hard codes the current behavior for discarding the concrete
overrides (`add-additional-overrides=no`) into those signature files
that will (or are likely) to be affected by the change in behavior.
That allows the default behavior to be changed for all the other files
without affecting these.

Follow up changes will remove the hard coding from the signature files
and will update the contents which will include the concrete overrides
of the abstract methods.

More information and the background for this change is available at
go/add-overriding-one-pager.

Test: m checkapi
Bug: 299366704
Change-Id: I52c5bbe2e3bbd36019fe44fcb0b2d19876a5a869
2023-10-10 17:11:25 +01:00
Andriy Naborskyy
f891a01eb5 Merge "wear proxy behind portal" into main am: 6aec2583cd
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2762234

Change-Id: Ib5c5489b6abdf3427ccfa2112908b6d42ffd9961
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-27 17:54:22 +00:00
Andriy Naborskyy
6aec2583cd Merge "wear proxy behind portal" into main 2023-09-27 17:39:30 +00:00
Motomu Utsumi
54aacd4bed Merge "cronet: Remove unused cronet_disabled api directory" into main am: 3f4bf87af6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2745214

Change-Id: I10e69b8c4bb209f83ad63f7fe4c64898c9a69e69
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-27 08:11:04 +00:00
Motomu Utsumi
3f4bf87af6 Merge "cronet: Remove unused cronet_disabled api directory" into main 2023-09-27 07:42:45 +00:00
Andriy Naborskyy
d032dd42ea wear proxy behind portal
Do not avoid captive portal on wear proxy network; keep network agent
after detecting portal.

Bug: 291112432
Test: atest FrameworksNetTests:android.net.connectivity.com.android.server.ConnectivityServiceTest
Change-Id: I8f6669da62ebd76b6a46d2aec9b3ea563a08cb5e
2023-09-27 07:28:05 +00:00
Treehugger Robot
ac88cd6df9 Merge "Add test for downstream tethering" into main am: dba0dbc7ec
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2606668

Change-Id: I251696b855e7f971ac740eb70fa86a4158f15c58
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-13 02:09:58 +00:00
Treehugger Robot
dba0dbc7ec Merge "Add test for downstream tethering" into main 2023-09-13 01:01:32 +00:00
Yuyang Huang
fca402abed Add test for downstream tethering
Add end-to-end testing for testing NsdManager advertising and
discovering works fine with downstream tethering interfaces.

Bug: 281639507
Test: atest NsdManagerTest
Change-Id: I5a66423f216cfe0c82db5128502c885980ab264b
2023-09-12 17:53:37 +09:00
Motomu Utsumi
b2597e6ad5 Merge changes If3217916,I86023b1f into main am: c6dc826c22
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2745020

Change-Id: I3c59e96e5686f75f2beb1fc62811744ea05951e6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-12 08:51:57 +00:00
Motomu Utsumi
c6dc826c22 Merge changes If3217916,I86023b1f into main
* changes:
  Add java_defaults for @FlaggedApi handling
  Prepare api directory for udc mainline branch
2023-09-12 08:25:42 +00:00
Jean Chalard
da62c511c0 Merge changes I0afdda02,I1c47f616 into main am: 5f730c6ab5
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2460069

Change-Id: I7f6aedf1424751e067e4396016bc525393381487
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-11 19:00:06 +00:00
Jean Chalard
5f730c6ab5 Merge changes I0afdda02,I1c47f616 into main
* changes:
  Implement ConnectivityStateMetrics sample
  Add base classes for common ConnectivityService tests.
2023-09-11 11:32:06 +00:00
Motomu Utsumi
e7b496fcb6 Merge "Merge remote-tracking branch 'remotes/aosp/tmp_libs_net_move' into libs_net_move_merge" into main am: 55850dccbf
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2745599

Change-Id: Icc1d7a4e4b2c0ed9f55fd2472a100723ade6a847
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-11 10:53:38 +00:00
Chalard Jean
f95e2de35a Implement ConnectivityStateMetrics sample
Test: ConnectivitySampleMetricsTest
Change-Id: I0afdda023208c3f8620cb5b89add66448af596d7
2023-09-11 17:12:46 +09:00
Motomu Utsumi
c480039309 Merge remote-tracking branch 'remotes/aosp/tmp_libs_net_move' into libs_net_move_merge
frameworks/libs/net/common ->
packages/modules/Connectivity/staticlibs

frameworks/libs/net/client-libs ->
packages/modules/Connectivity/staticlbs/client-libs

Test: TH
Bug: 296014682
Change-Id: I5dc78f0c4653e20312ab3d488b1e69262dbb9840
2023-09-11 11:53:46 +09:00
Motomu Utsumi
310f11acfe Add java_defaults for @FlaggedApi handling
This CL is a preparation to ignore @FlaggedApi API in udc mainline
branch

Bug: 299411828
Test: TH
Change-Id: If3217916b2c37ebaa7b48d8387c69cb078af9550
2023-09-08 14:47:03 +09:00
Motomu Utsumi
5dcd14569e Prepare api directory for udc mainline branch
udc-extended-api directory will be used only in udc mainline branch to
hide @FlaggedApi annotated api which is not supported in that branch

Copied api directories from udc mainline branch.

Bug: 299411828
Test: TH
Change-Id: I86023b1fb3e5f9b4b787a564303e6d2e60f74467
2023-09-08 11:42:21 +09:00
Motomu Utsumi
eaf2db01bb cronet: Remove unused cronet_disabled api directory
Test: TH
Change-Id: I183ae6cb802c84e36763215d80e90d4444e38e67
2023-09-07 16:36:48 +09:00
Mark White
7cba34582c Merge "Created empty framework-location non-updatable module" into main am: e695330a89
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2727717

Change-Id: Ib8717d99a76d86c3f2795ac56f5f6fbfcd8d45ea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-31 17:08:15 +00:00
Mark White
e695330a89 Merge "Created empty framework-location non-updatable module" into main 2023-08-31 16:00:53 +00:00
Mark White
e4d44639cb Created empty framework-location non-updatable module
Bug: 289776578
Test: CtsLocationCoarseTestCases CtsLocationFineTestCases CtsLocationGnssTestCases CtsLocationNoneTestCases CtsLocationPrivilegedTestCases

Change-Id: Ia57b9f10c8f506877003adf1d9b6e7201654921b
2023-08-30 20:44:07 +00:00
Junyu Lai
597b05f5a0 Merge "Split BpfNetMaps constants and utilities into standalone classes" into main am: 50a7ecccf1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2720877

Change-Id: Iffedb0a57c83be761ed01d89ca819f8ec0db1656
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-29 11:16:17 +00:00
Junyu Lai
50a7ecccf1 Merge "Split BpfNetMaps constants and utilities into standalone classes" into main 2023-08-29 10:44:51 +00:00
Junyu Lai
29b7b6385a Split BpfNetMaps constants and utilities into standalone classes
This is a no-op refactoring that splits constants and utility
methods into standalone classes which will be shared with
a bpf reader class in subsequent CLs.

NO_IFTTT=No-op refactoring

Test: atest FrameworksNetTests:android.net.connectivity.com.android.server.BpfNetMapsTest
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.net.module.util.StructTest

Bug: 297836825
Change-Id: I6d7ea044e43180ae001573009a166be74ebe6a5d
2023-08-29 08:20:10 +00:00
Xin Li
4a6c653160 Merge Android U (ab/10368041)
Bug: 291102124
Merged-In: Iff29b090c0b41d0103997a80788f09c2602df074
Change-Id: I5b03523defc88ffbc3aeab9ac8a29b4ca5a11f57
2023-08-25 13:52:17 -07:00
Igor Zaslavsky
ec344f4c18 Add RemoteAuthService
Add RemoteAuthService APIs and Stubs (hide) for Settings of D2DA

This CL introduces new SystemApi allow user to discover remote devices
compatible to be registered as remote authenticators via RemoteAuthManager

Design doc: go/remote-auth-manager-fishfood-design

Test: built successfully.
Bug: 290092977
API-Coverage-Bug: 294934095
Change-Id: Iaaae1126065fdc3db469eeb8d85ac654b8199a12
2023-08-24 17:50:11 +00:00
Stefano Duo
2a90733b08 Also bundle Cronet telemetry jar
Bug: 284972285
Test: m & atest NetHttpTests
Change-Id: Id24fa826f617187722b329821dae9d9548bf218b
2023-08-21 16:51:08 +01:00
Yuyang Huang
33fa4d268c Add callbacks for service offload
Components that can provide offload like IpClient (packet
filter offloading) can use the API to register a callback to be notified
when offload is necessary.

Bug: 269240366
Test: atest CtsNetTestCases
Change-Id: I8080702f5b530001b88e79e504f4722ac01bc576
2023-08-04 19:22:15 +09:00