Commit graph android_packages_modules_Co.../staticlibs/client-libs
Message SHA1
Inline tetherInterface and untetherInterface
This is a no-op refactoring which inline the functionalities
to IpServer, enabling subsequent changes to move
networkAddInterface part to ConnectivityService when the
tethering is enabled.

Test: atest TetheringTests:android.net.ip.IpServerTest
      atest NetdStaticLibTests:com.android.net.module.util.NetdUtilsTest
Bug: 349487600

Change-Id: I6d0e5d349691df7a15bee852d5fd1dd19f5da6f6

Junyu Lai   commited 2025-03-07 10:43:17 +08:00
eff5782b0a
Separate route modification and update linkproperties
This is a no-op, preparatory refactoring to isolate route
modification functionality, enabling subsequent changes to move
routing control to ConnectivityService.

Test: atest TetheringTests:android.net.ip.IpServerTest
      atest NetdStaticLibTests:com.android.net.module.util.NetdUtilsTest
Bug: 349487600
Change-Id: I55af07968567b173dd9f97795600390439f1b927

Junyu Lai   commited 2025-03-07 10:43:17 +08:00
d85d3c5e80
Fix missing network id arguments
Follow-up from aosp/3383831, some arguments are still missing,
adding them and update tests accordingly.

Test: atest NetdStaticLibTests
Bug: 349487600
Change-Id: I495291f1e57c3a32c015fc7dfa3c2e6e86663da8

Junyu Lai   commited 2024-12-16 11:27:32 +08:00
0969fe6e20
Refactor netd utility methods to support custom netIds
This is a no-op refactoring which:
  1. Updates netd utility methods to handle custom netIds.
  2. Rename internal methods to reflect the functionality.
  3. Import constants from TetheringManager to improve
     readability.

This refactoring is a prerequisite for future changes that will
utilize a new netId for routing instead of LOCAL_NETWORK_ID.

Test: atest NetdStaticLibTests TetheringTests CtsTetheringTest
Test: adb shell ip ru && adb shell ip ro show table local_network
Bug: 349487600
Change-Id: I1f3a68d24852b6bd85ce7be2ec58746e49b67636

Junyu Lai   commited 2024-12-11 10:47:13 +08:00
04783040d5
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
Merge "[DON'T BLOCK] Test ownership migration rules" into main am: e7aa45cdf0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2939819

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

Treehugger Robot   authored and   Automerger Merge Worker   commited 2024-02-01 00:08:24 +00:00
612ba174b8
[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
Cleanup modifyRoutes
This is no longer used out of this file, and should not be.

Test: Build
Change-Id: I531191b4afbda39a5fbaf1f483d13068f86d17f1
Merged-In: Ief0a79883bcc2c5493807c548cb71ef655abed23

Chalard Jean   authored and   Jean Chalard   commited 2023-10-27 06:53:36 +00:00
ac5e4cf025
Add a routing coordinator class
Test: In followup changes : RoutingCoordinatorManagerTest
Change-Id: Ia6811d614e02123a072c7638291828745abae051

Chalard Jean   commited 2023-10-24 22:12:26 +09:00
2fb66f1b28
Reapply "Simplify addRoutesToLocalNetwork calls"
This reverts commit 316346be6e.

Change-Id: I86977f6e7a5451d037c7ea6fee5c4bc7082935ff

Chalard Jean   commited 2023-10-18 15:50:02 +09:00
7f2b3dabcd
Revert "Simplify addRoutesToLocalNetwork calls"
Revert submission 2777667

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

Reverted changes: /q/submissionid:2777667

Bug: 305187495

Change-Id: I516d40b20d775e9c61b2f825bc094329d016d0c3

Anton Kulakov   commited 2023-10-13 15:15:50 +00:00
316346be6e
Simplify addRoutesToLocalNetwork calls
There are only three calls to this method, and two of them
are with a list of 1 address which means it's simpler inlined.

The last call will be replaced with calls to RouteController
in a followup, meaning we addRoutesToLocalNetwork can be removed.

Test: RouterAdvertisementDaemonTest
      NetdUtilsTest
Change-Id: I3b6ee1db40f09954b336321000735a66306bf000

Chalard Jean   commited 2023-10-13 16:19:25 +09:00
cf70df3e9b
bump min_sdk_version from 29 (Q) to 30 (R)
Mainline no longer supports Q.
These files were recently moved into p/m/C as part of a refactor.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0f06ace921db6c79d63c0048bdb73d167ff606cf

Maciej Żenczykowski   commited 2023-09-19 23:22:58 +00:00
127a1441c3
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

Motomu Utsumi   commited 2023-09-11 11:53:46 +09:00
c480039309
Add an empty implementation of INetdEventListener
Adding a class that has maintains no-op implementation for all methods
in INetdEventListener to allow extending in a compatible way across
projects

Test: Builds, boots

Bug: 265742148
Change-Id: I46327d78a3685848e06f7a369e238d2952410296

Suprabh Shukla   commited 2023-02-14 08:33:59 -08:00
5b4050448d
Make netd-client and net-utils-services-common visible to Wifi module
Bug: 172457099
Test: N/A
Change-Id: I50d4502ad2e5515217d70fb5e106fba01da8d68f

Nate(Qiang) Jiang   commited 2022-06-16 23:00:03 +00:00
983b52cdcc
Merge "Add hasFlag method in NetdUtils."
Xiao Ma   authored and   Gerrit Code Review   commited 2021-12-24 06:06:46 +00:00
e34786f5a7
Add hasFlag method in NetdUtils.
Since ethernet-service related files are going to be moved into
Connectivity module. To deal with InterfaceConfiguration dependency
in EthernetTracker, use InterfaceConfigurationParcel instead, which
returns from NetdUtils API directly. Adding a new method hasFlag in
NetdUtils to replace the original InterfaceConfiguration.hasFlag,
that's invisible to the Connectivity module.

Bug: 210586283
Test: atest NetdStaticLibTests --iterations
Change-Id: I16fcbfb8f36c8632a8267ce55cdcbd78ea6edd1a

Xiao Ma   commited 2021-12-23 07:16:06 +00:00
a6492c710f
Revert "Revert "Suppress NewApi warnings for @SystemApi -> public APIs""
This reverts commit d654277abfa0abd1268acc6db1753536509e41c8.

Reason for revert: Re-landing changes not related to postsubmit failure

Change-Id: I72fd6b908deeb293f1f3a342f006515029972089

Taras Antoshchuk   commited 2021-12-19 12:04:26 +00:00
ec655bb3b5
Revert "Suppress NewApi warnings for @SystemApi -> public APIs"
Revert "Add VpnServiceBuilderShim for VpnService.Builder"

Revert submission 1551943-vpn-impl

Reason for revert: <DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=mainline_modules_x86_64-userdebug&lkgb=8007224&lkbb=8008168&fkbb=8007902 >, bug b/210979001
Reverted Changes:
I0e7aa077a:Add VpnServiceBuilderShim for VpnService.Builder
Ib12f5ab39:Suppress NewApi warnings for @SystemApi -> public ...
I59b9185cf:Unhide RouteInfo#getType and related fields
Ie5b62b2b2:Unhide IpPrefix(InetAddress, int)
I993a32d40:Add CTS tests for exclude VPN routes APIs
Ib24b2d3fb:Suppress NewApi warnings for @SystemApi -> public ...
Ic3b10464a:Add APIs that allow to exclude routes from VPN

Change-Id: I5b918dbf4293168c2a02cfe1c0f6ca8342b3195c
BUG: 210979001

Ayush Sharma   commited 2021-12-16 14:40:13 +00:00
95c8d0b833
Suppress NewApi warnings for @SystemApi -> public APIs
Android Lint doesn't handle API change from @SystemApi to public API
correctly (see b/193460475). We have to manually suppress those
warnings for now.

This CL suppresses warnings related to:
 - IpPrefix(InetAddress, int)
 - RouteInfo#getType

Bug: 186082280
Test: presubmit
Change-Id: Ib24b2d3fb21b86bd9e3555316a5a5bcb94434c00

Taras Antoshchuk   commited 2021-12-13 11:11:00 +01:00
00ef48f122
Move static utils to the static library
These classes used to live as a static utility in the
NetworkStack module, but that's not the right place for
them.

The point of this patch is to *not* require topics, as
any change in this space will very quickly spin out of
control and become unmanageable. As such, this starts
with creating equivalent classes in a single, easier to
manage change. Followup changes will migrate users of
the old classes to use these ones instead. Finally, the
old classes can be removed. This way, work can be
broken down into separate changes and be checked in
little by little, rather than one huge topic with many
changes doing everything in one go, which is unlikely
to be manageable.

There are no code changes from the originals, but a
number of reorganizations, most of them unavoidable.

• Vertical spacing (these classes fix it)
• Package names/imports are adjusted
• Added @hide on NetlinkMonitor
• Move all contents of RouteUtils to NetdUtils, because
  all methods depend on INetd, and some of the targets
  do not/cannot depend on netd-client
• Restrict the files used by the filegroup
  net-utils-framework-wifi-common-srcs, since that
  target does not necessarily provide all dependencies
  to all its users.
• Don't move NetworkMonitorUtils, since it depends on
  SdkLevel, and net-utils-framework-common-srcs is
  using **/*.java. It would have been possible to list
  explicitly all files actually necessary in this
  filegroup, but NetworkMonitorUtils is actually only
  used by the networking modules and not the framework.
  Eventually it should move but it doesn't have to
  be in this patch, which is complicated enough as
  it is.
• RouteUtils is now empty, because some new methods
  will be added to it soon and it is less expensive
  to keep it empty than to remove it now and add it
  again later.
• Merge NetdUtils, and unify the constants.
Some changes to satisfy checkstyle :
• Remove unused imports
• Reorder modifiers in InterfaceController
• Remove {} in IpNetworkMonitor
• Remove redundant public modifier in IpNetworkMonitor
• Add javadoc to a few methods
• Add whitespace around | in InterfaceParams
However, don't rename members in IpNeighborMonitor
like checkstyle would prefer because this would make
migration to this more involved.

Test: NetworkStaticLibsTests NetdStaticLibTests
Change-Id: I439121cba5d7ea95aa4d6c80ea25207c316880a0

Chalard Jean   commited 2021-10-27 20:08:05 +09:00
c4b4b9a446
Merge "Add visibility for Connectivity tests" am: bc87949c28 am: 52caed91c9
Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1730122

Change-Id: I64559e2ebf6eb3307512561efbedf2fbc3ede9f8

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-06-21 13:56:37 +00:00
8de54b322e
Add visibility for Connectivity tests
Allow all Connectivity test subpackages to use the targets,
so that the visibility does not need to be updated when test suites
are reorganized inside Connectivity.

Bug: 187935317
Test: m
Change-Id: I99d1ec954ebe313e553443a9f081d54d7a5f12c1

Remi NGUYEN VAN   commited 2021-06-09 18:00:43 +09:00
94dab0fcfa
Add visibility for packages/modules/Connectivity
BUG: 186628461
Test: TH
Merged-In: Id48980dede159e48c049f85bc34a84004a72a7e3
Change-Id: Ia02ccf880f8299b437c1364d823a3ff1eb6960ff

Baligh Uddin   authored and   Remi NGUYEN VAN   commited 2021-05-24 11:23:03 +00:00
b5f7eba152
Add visibility for packages/modules/Connectivity
Also cleanup previous locations from visibility rules.

BUG: 186628461
Test: TH
Merged-In: I579cfbae1645643a876883cc586e66a1084e3389
Change-Id: Id48980dede159e48c049f85bc34a84004a72a7e3

Baligh Uddin   commited 2021-05-24 04:39:46 +00:00
471735769f
Add lint baseline to address NewApi errors
We are enabling a new lint check where the min sdk != compile sdk.
It has produced a lot of errors and adding the baseline file(s)
allows us to continue work without introducing more problems.

Bug: 150847901

Test: m lint-check
Change-Id: I2c38dac481685470af8be115d867953325e75d94
Merged-In: I2c38dac481685470af8be115d867953325e75d94

Pedro Loureiro   commited 2021-04-14 10:43:02 +00:00
d641313cfc
[LSC] Add LOCAL_LICENSE_KINDS to frameworks/libs/net
Added SPDX-license-identifier-Apache-2.0 to:
  client-libs/Android.bp
  client-libs/tests/unit/Android.bp
  common/Android.bp
  common/native/bpf_syscall_wrappers/Android.bp
  common/native/netjniutils/Android.bp
  common/tests/unit/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I6ea23b03b1fadb54c7974c9f716f0f13795f84c5

Bob Badour   commited 2021-02-22 16:10:07 -08:00
37cd99a0ed
[automerger skipped] [LSC] Add LOCAL_LICENSE_KINDS to frameworks/libs/net am: a119946899 am: e99a4b20cd am: bc3f1f3fd3 -s ours
am skip reason: Change-Id I6942c6844c89048f785f2b6eaa4bb33a24fa6f93 with SHA-1 72e3e74277 is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/libs/net/+/1588168

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3e3e11150d029c91497129b2babd333b23d6ccfa

Bob Badour   authored and   Automerger Merge Worker   commited 2021-02-18 05:24:21 +00:00
e3b2f3cffb
[LSC] Add LOCAL_LICENSE_KINDS to frameworks/libs/net
Added SPDX-license-identifier-Apache-2.0 to:
  client-libs/Android.bp
  client-libs/tests/unit/Android.bp
  common/Android.bp
  common/native/bpf_syscall_wrappers/Android.bp
  common/native/netjniutils/Android.bp
  common/tests/unit/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work

Change-Id: I2d4abaee12c1f20c39a7e2c9e02e2fccb96fa3ee
Merged-in: I6942c6844c89048f785f2b6eaa4bb33a24fa6f93

Bob Badour   commited 2021-02-17 17:22:02 -08:00
5e043f16a9
Merge "Specify version for aidl_interface explicitly"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-02-09 02:12:36 +00:00
466c222072
Specify version for aidl_interface explicitly
Bug: 150578172
Test: m
Change-Id: I8b1e35a84e4ad4be479fd1508f06514879b174da

Jeongik Cha   commited 2021-02-06 09:56:14 +00:00
e59cf43d08
Have a collection of utilities for netd - NetdUtils
Some files which will be inside mainline module depend on
NetworkManagementService to talk to netd, but after they become
a part of mainline module, they cannot access @hide API of
NetworkManagementService.
So create a NetdUtils to help them to talk to netd.

Bug: 170598012
Test: atest CtsNetTestCasesLatestSdk NetdStaticLibTests
Change-Id: I8bee1204b9533b70844da0b3768427438fd0c890

lucaslin   authored and   Lucas Lin   commited 2021-02-01 07:24:37 +00:00
5c620643b7
Have a new library - netd-client in frameworks/libs/net
Move BaseNetdUnsolicitedEventListener from tethering module to
frameworks/libs/net and have a new library for it.
Tethering module can still use BaseNetdUnsolicitedEventListener
through netd-client and ConnectivityService and Nat464Xlat also
can use it when both of them are under frameworks/base.

Bug: 174837473
Test: Manual test and check the log.
Change-Id: I44dff1c7639e50b8f20b54c6d5733139b20e2986

lucaslin   commited 2021-01-08 13:56:12 +08:00
37a2effb07