Commit graph android_packages_modules_Co.../staticlibs
Message SHA1
Merge "Make PrefixInformationOption struct constructor visible for testing." into main
Xiao Ma   authored and   Gerrit Code Review   commited 2024-03-26 02:49:46 +00:00
f74488eb37
NetBpfLoad: enable mainline on T+
Note:
   2 == BPFLOADER_S_VERSION
  19 == BPFLOADER_T_VERSION
  25 == BPFLOADER_OBJ_AT_VER_VERSION
  33 == BPFLOADER_IGNORED_ON_VERSION
  37 == BPFLOADER_U_VERSION [*]
  41 == BPFLOADER_V_VERSION [**]
and currently we have:
  42 == BPFLOADER_MAINLINE_VERSION
  43 == BPFLOADER_MAINLINE_T_VERSION
  44 == BPFLOADER_MAINLINE_U_VERSION
  45 == BPFLOADER_MAINLINE_V_VERSION

[*] udc-dev/udc-release are actually 38, as 37 was some earlier
    udc beta2 (2.1 ifirc), and beta3+ switched to 38

[**] 24Q{1,2}-release (ie. U QPR2+) are technically actually 41,
     but their platform bpfloader no longer even looks in /apex/com.android.tethering/etc/bpf/...
     so it doesn't really matter (although 24Q1's platform
     netbpfload still does, however that is obsoleted by
     this change)

Thus we need to (as minimum for NetBpfLoad):
  BPFLOADER_T_VERSION -> BPFLOADER_MAINLINE_T_VERSION
  BPFLOADER_IGNORED_ON_VERSION -> BPFLOADER_MAINLINE_U_VERSION
to cause these to load appropriately from mainline.

One would perhaps also expect (as minimum for NetBpfLoad):
  BPFLOADER_OBJ_AT_VERSION -> BPFLOADER_MAINLINE_U_VERSION
but (as maximum for platform bpfloader):
  BPFLOADER_OBJ_AT_VERSION -> BPFLOADER_MAINLINE_U_VERSION

However, since the goal is actually for those to load via mainline on T+,
(with the 'old' version of the .o's loading on S via platform bpfloader)
thus one actually needs (as minimum for NetBpfLoad):
  BPFLOADER_OBJ_AT_VERSION -> BPFLOADER_MAINLINE_T_VERSION
and (as maximum for platform bpfloader):
  BPFLOADER_OBJ_AT_VERSION -> BPFLOADER_T_VERSION

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

Maciej Żenczykowski   commited 2024-03-19 21:33:55 +00:00
11141da623
NetBpfLoad: chose bpfloader version at runtime based on Android OS
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Iee55d9c6f828f05d4096dff2e874abc6c41eadeb

Maciej Żenczykowski   commited 2024-03-18 15:02:53 -07:00
65f7022461
Make PrefixInformationOption struct constructor visible for testing.
PrefixInformationOption#build always gives the correct option length and
type, visible constructor is easiler to verify the incorrect parameters
in the test, for example, we will verify the code that parses the PIO
option in RA as a ND user option in netlink message.

Bug: 315069348
Test: TH
Change-Id: I6b88e6718cb873b15936c1f518d357c36c41ffde

Xiao Ma   commited 2024-03-18 15:12:35 +09:00
f0959a78a2
Eliminate spurious COMPILE_FOR_BPFLOADER_VERSION macro
and make platform bpf.o's target V's platform bpfloader.

Note that all mainline shipped bpf.o's already manually
specify BPFLOADER_MIN_VER.

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

Maciej Żenczykowski   commited 2024-03-15 18:14:16 +00:00
0de80f1a9f
Merge "Quit NetworkMonitor threads in integration tests" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-03-15 09:17:11 +00:00
2fae00cb39
Quit NetworkMonitor threads in integration tests
Similarly to NetworkMonitorTest, terminate NetworkMonitor threads and
ExecutorServices after each test case in integration tests.

This should fix flakes where the HTTP probe from testValidation could
finish after mock probe responses are cleared in tearDown.

The utils used in NetworkMonitorTest are factored out to ConcurrentUtils
to achieve that.

Fixes: 292481238
Test: atest --rerun-until-failure 50
Change-Id: I5cdeee8d4f06ea40e338dd2cb1fdcc2fe0907a7d

Remi NGUYEN VAN   commited 2024-03-14 13:18:44 +09:00
b3fcdacfae
add #define BPFLOADER_MAINLINE_VERSION 42u
See: //packages/modules/Connectivity/netbpfload/loader.cpp
  // This is Network BpfLoader v0.42
  #define BPFLOADER_VERSION_MAJOR 0u
  #define BPFLOADER_VERSION_MINOR 42u

Test: N/A
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ieeed6d402de06d3f01e151c2c9ee44270c53323c

Maciej Żenczykowski   commited 2024-03-12 06:31:36 +00:00
84aa9ea83a
bpf_helpers: add #defines for next 2 LTS KVERs
Test: N/A
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Iac303578071ff5dd3848f63c7497180d7694874b

Maciej Żenczykowski   commited 2024-03-10 22:11:54 +00:00
978b3f2d9b
Add IPv6 FragmentHeader struct support am: f8c7d15850
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2988169

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

KH Shi   authored and   Automerger Merge Worker   commited 2024-03-06 05:50:39 +00:00
2759673568
Add IPv6 FragmentHeader struct support
Bug: 285124667
Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.structs.FragmentHeaderTest
Change-Id: I90c8a52daa35589977333494355ac239ea057204

KH Shi   commited 2024-03-06 05:05:13 +00:00
f8c7d15850
Merge "Remove unused library visibility" into main am: 2154e525b3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2984492

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

Chiachang Wang   authored and   Automerger Merge Worker   commited 2024-03-04 02:59:53 +00:00
8a7c9f6c5f
Merge "Remove unused library visibility" into main
Chiachang Wang   authored and   Gerrit Code Review   commited 2024-03-04 02:43:27 +00:00
2154e525b3
Remove unused library visibility
This commit removes the unused library visibility.

The "frameworks/base/packages/Connectivity" folder is the
temporary folder for modulizing the connectivity codes. There is
no such need now.

Test: m
Change-Id: Ia2890fe64c1bc369fcb90be645263bc56c98a7b2

Chiachang Wang   commited 2024-03-01 00:57:52 +00:00
52d329642a
Merge "Include structs lib in service-connectivity-pre-jarjar" into main am: db67a80430
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2966917

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

Yang Sun   authored and   Automerger Merge Worker   commited 2024-02-29 03:34:05 +00:00
e5a99273a8
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
Merge "Use custom defined DNS/HTTP port" into main am: 48f8d1892f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2952227

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

Jimi Chen   authored and   Automerger Merge Worker   commited 2024-02-21 09:33:08 +00:00
47f6c4a531
Merge "Use custom defined DNS/HTTP port" into main
Jimi Chen   authored and   Gerrit Code Review   commited 2024-02-21 09:03:47 +00:00
48f8d1892f
Use custom defined DNS/HTTP port
Refactor the test case to support listen custom DNS/HTTP port.
Avoid binding system restricted port (<1024).

Bug: 322113686
Test: atest NetworkStackIntegrationTests:android.net.NetworkStatsIntegrationTest
Change-Id: I5d3b966cdadc9321ca2ee0d04a5b8f71ee79bd8a

Jimi Chen   commited 2024-02-20 08:08:17 +00:00
45ac04442f
Merge "Revert "Add method to read trunk stable flag"" into main am: 6de59fa208
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2954910

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

Motomu Utsumi   authored and   Automerger Merge Worker   commited 2024-02-08 11:07:55 +00:00
98e6af27c3
Merge "Revert "Add method to read trunk stable flag"" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-02-08 10:37:09 +00:00
6de59fa208
Merge changes Icfcc7ade,I1481cb8f,Ic2e8ca0d into main am: f582074f69
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2945947

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

Xiao Ma   authored and   Automerger Merge Worker   commited 2024-02-08 09:01:47 +00:00
ad5cd1b104
Merge changes Icfcc7ade,I1481cb8f,Ic2e8ca0d into main
* changes:
  Make RtNetlinkRouteMessage constructor visible for testing.
  Make StructRtMsg constructor visible for testing.
  Make NduseroptMessage constructor visible for testing.

Xiao Ma   authored and   Gerrit Code Review   commited 2024-02-08 08:20:49 +00:00
f582074f69
Merge "Prepare for @RequiresApi class retention" into main am: b19fd5414b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2946926

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

Cole Faust   authored and   Automerger Merge Worker   commited 2024-02-08 06:35:19 +00:00
670d0b172f
Revert "Add method to read trunk stable flag"
This reverts commit b0f489021b.

Reason for revert: Currently reading trunk stable flag from mainline module is not supported. So reverting the CL to avoid confusion.

Change-Id: I0db04f28f378399aa299b325312a6af7f45d4f67

Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-02-08 03:06:34 +00:00
4919dcce94
Prepare for @RequiresApi class retention
The android framework has android.annotation.RequiresApi, which is a
copy of androidx.annotation.RequiresApi. However it was added with
source retention instead of class retention like androidx's version
has. This causes it to be missed if you compiled a library and then
used that library to compile something else, that library's public
methods won't have @RequiresApi on them when using that library's
compiled jar file.

To make @RequiresApi have class retention, we need to baseline the
NewApi issues that it would cause. These baselines also require
us to disable strict_updatability_linting in some places.

Bug: 323366771
Test: m lint-check
Change-Id: I0c984e3ba39e357ce102be442568f2d77a4f9034

Cole Faust   commited 2024-02-02 12:04:05 -08:00
53da9ac34c
Merge "Rename check*Permission* to has*Permission" into main am: ef58a8a33a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2942985

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

Junyu Lai   authored and   Automerger Merge Worker   commited 2024-02-02 07:43:59 +00:00
4829747946
Merge "Rename check*Permission* to has*Permission" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2024-02-02 07:07:31 +00:00
ef58a8a33a
Make RtNetlinkRouteMessage constructor visible for testing.
Refactor IpClientTest by parsing the netlink message directly instead
of netd callbacks, so we have to initialize a RtNetlinkRouteMessage
instance to trigger IPv4/v6 route updates in the unit test.

Bug: 318764217
Test: atest NetworkStackTests
Change-Id: Icfcc7ade636c89a63d897f4e9246410f6387b3c9

Xiao Ma   commited 2024-02-02 13:25:58 +09:00
f505ef0479
Make StructRtMsg constructor visible for testing.
Refactor IpClientTest by parsing the netlink message directly instead
of netd callbacks, so we have to initialize a StructRtMsg instance to
fill in the RtNetlinkRouteMessage constructor.

Bug: 318764217
Test: atest NetworkStackTests
Change-Id: I1481cb8fab29ae94d48fa342ecf2b303a9701a31

Xiao Ma   commited 2024-02-02 13:25:58 +09:00
2040d8bcc8
Make NduseroptMessage constructor visible for testing.
Refactor IpClientTest by parsing the netlink message directly instead of
netd callbacks, so we have to initialize an NduseroptMessage instance to
trigger IPv6 RDNSS option update in the unit test.

Bug: 318764217
Test: atest NetworkStackTests
Change-Id: Ic2e8ca0d5e71b73c0dbdc3311e72486af371c899

Xiao Ma   commited 2024-02-02 13:25:40 +09:00
4dfc6da55f
Rename check*Permission* to has*Permission
The check*Permission methods are a bit error-prone because people
can forget to check the return value and expect that they behave
like the enforce* methods. This was pointed out before in some bugs.

This change adds @CheckResult annotation to enforce linter warning
and rename methods accordingly.

Test: TH
Fix: 279691948
Change-Id: Ibb0df6540fe0ed40289bb190b790130daaa2f763

Junyu Lai   commited 2024-02-01 15:24:35 +08:00
71b5153898
Add netlinkSocketForProto() without buffersize. am: 1d8b7cc422
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2942526

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

Yang Sun   authored and   Automerger Merge Worker   commited 2024-02-01 05:49:51 +00:00
56669bf636
Add netlinkSocketForProto() without buffersize.
Test: atest NetworkStaticLibTests
atest FrameworksNetTests

Change-Id: I34a0a29eb7e78490701872229585e61f7a0c1dd3

Yang Sun   commited 2024-02-01 09:50:52 +08:00
1d8b7cc422
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
Merge "[DON'T BLOCK] Test ownership migration rules" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-01-31 23:38:03 +00:00
e7aa45cdf0
Merge "Add CtsConnectivityMultiDevicesTestCases for hotspot" into main am: 9c3c120c6c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2891012

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

Junyu Lai   authored and   Automerger Merge Worker   commited 2024-01-31 14:39:13 +00:00
49952fd0b9
Merge "Add CtsConnectivityMultiDevicesTestCases for hotspot" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2024-01-31 14:29:18 +00:00
9c3c120c6c
[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
Merge "Pass buffer size to NetlinkUtils.netlinkSocketForProto" into main am: 2cb28ea360
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2919875

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

Maciej Żenczykowski   authored and   Automerger Merge Worker   commited 2024-01-31 02:43:59 +00:00
4f7630ff9b
Merge "Pass buffer size to NetlinkUtils.netlinkSocketForProto" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-01-31 01:42:49 +00:00
2cb28ea360
Merge Android 24Q1 Release (ab/11220357)
Bug: 319669529
Merged-In: Iaaca422cb105c00ded1d84b40afd745abcd651b7
Change-Id: I4328f5086dfde8c49e4352895663cc7abccab7fa

Xin Li   commited 2024-01-30 10:38:09 -08:00
0d0b075a3a
Pass buffer size to NetlinkUtils.netlinkSocketForProto
Pass buffer size to netlinkSocketForProto to allow callers to specify
buffer size. The buffer size is not set if 0 is passed in.

Following callers of netlinkSocketForProto passes SOCKET_RECV_BUFFERSIZE
to keep same behavior as before:
 * OffloadHardwareInterface.createConntrackSocket()
 * NetlinkUtils.sendOneShotKernelMessage()
 * IpSecXfrmController.Dependencies.newNetlinkSocket()
 * InetDiagMessage.getConnectionOwnerUid()
Following callers pass 0 to not update the buffer size:
 * TunInterfaceController - it uses the socket only for writing
 * NetlinkUtils.createNetLinkInetDiagSocket() same behavior as before
Added a SOCKET_DUMP_RECV_BUFFERSIZE of 128k to be used by socket
requesting dump information from kernel:
 * NetlinkUtils.getAndProcessNetlinkDumpMessages() - sends dump request
   and expecting multiple reply messages.

Bug: 320420453

Test: atest NetworkStaticLibTests
atest FrameworksNetTests

Change-Id: I3dcb76963cf2646eb311602b50ab4e44b8ad3e8f

Yang Sun   commited 2024-01-30 21:54:48 +08:00
7934241c8f
Merge "Add SOCK_CLOEXEC to NetlinkUtils.netlinkSocketForProto" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-01-29 10:49:48 +00:00
7412936a8c
Add SOCK_CLOEXEC to NetlinkUtils.netlinkSocketForProto
Bug: 320420453

Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.netlink.NetlinkUtilsTest

Change-Id: I166a0d5185a18274ed82f739f289969c1f989b20

Yang Sun   commited 2024-01-29 09:37:26 +08:00
a080b1900a
Merge "Support adding an IPv4 address via RTM_NEWADDR netlink message." into main
Xiao Ma   authored and   Gerrit Code Review   commited 2024-01-29 01:24:12 +00:00
522197af33
Support adding an IPv4 address via RTM_NEWADDR netlink message.
Usually we can call InterfaceController.setIPv4Address API to add an
IPv4 address on the interface, in fact it ends up calling the native
Netd API which doesn't support setting deprecation/expiration time. In
user space we already have the netlink infra to send RTM_NEWADDR for
IPv6 address, extend the function to support IPv4 as well, then we can
deprecate the Netd API in IpClient.

Bug: 129660498
Test: atest NetworkStaticLibTests
Change-Id: I9fc7ba8d7035e0ed1df8c1f2baef9ec7e1806be3

Xiao Ma   commited 2024-01-26 05:40:34 +00:00
a3d165e814
clearInlineMocks from DevSdkIgnoreRunner after running test
Memory leak was observed and inline mock is one of the reasons.
This CL updates DevSdkIgnoreRunner to clear mock state if there is no
thread leak.

Test: TH
Bug: 321603955
Change-Id: I50fd03f14c6703bd38b5729f577d7ea516cd5b44

Motomu Utsumi   commited 2024-01-25 21:55:10 +09:00
05bf4f398f
Merge "BpfMap - add R/W constructor alias" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-01-24 04:53:54 +00:00
8552cd82b9