Commit graph android_packages_modules_Co.../staticlibs
Message SHA1
Use helper function getIndexForValue in MulticastRoutingCoordinator.
The SparseArray.indexOfValue() uses == to compare values,
MulticastRoutingCoordinator uses SparseArray with String type values,
and the indexOfValue function would sometimes return -1 when looking for
a value in the SparseArray.

Added a helper function getIndexForValue in CollectionUtils to get index
by comparing values with equals, and used this function in MulticastRoutingCoordinator.

Updated
MulticastRoutingCoordinatorServiceTest#testMulticastRouting_applyConfigNone_removesMfc
test case to use copies of interface names when updating the multicast
configs, so the test would fail without this fix.

Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.CollectionUtilsTest#testGetIndexForValue
atest android.net.connectivity.com.android.server.connectivity.MulticastRoutingCoordinatorServiceTest#testMulticastRouting_applyConfigNone_removesMfc

Change-Id: I862242d6be01b8552cdd6af6c9691948a9f0bfe0

Yang Sun   commited 2024-04-23 17:22:15 +08:00
4e7baadc71
Merge "Drop circular dependency" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-04-08 12:51:28 +00:00
588a9d5b26
Merge "Improve the nduser option log readability." into main
Xiao Ma   authored and   Gerrit Code Review   commited 2024-04-08 01:25:21 +00:00
1cf1b5f785
Improve the nduser option log readability.
Before:
Nduseroptmsg(10, 40, 48, 134, 0, fe80::2a00:79e1🔤f605%wlan0)

after:
Nduseroptmsg(family:10, opts_len:40, ifindex:48, icmp_type:134, icmp_code:0, srcaddr: fe80::2a00:79e1🔤f605%wlan1, NdOptRdnss(type: 25, length: 5, reserved: 0, lifetime: 1209600,servers:[2001:4860:4860::6464,2001:4860:4860::64]))

Bug: 315069348
Test: TH
Change-Id: I3abfbecd53a8cc00eaed9cbac1d9fe187d265847

Xiao Ma   commited 2024-04-05 18:25:54 +09:00
6fc458350a
Drop circular dependency
There was a circular dependency between net-tests-utils-host-common and
ConnectivityTestPreparer. This hasn't caught because Soong didn't track
the required dependency (ConnectivityTestPreparer requires the other).
However, as Soong is fixed to track the dependency type, this is caught
as an error.

Dropping the "required" dependency because net-tests-utils-host-common
is a host test module and is the entry point.

Bug: 321626681
Test: m
Change-Id: I539bbe2689be0af52bfec35966dd8210137d6c72

Jiyong Park   commited 2024-04-05 14:34:10 +09:00
093a4cfa95
Merge "Replace connectToCell -> NetworkCallbackRule" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2024-04-03 04:15:41 +00:00
d5a8d41172
Merge "Do faster bitmask checks on NetworkCapabilities" into main
Shai Barack   authored and   Gerrit Code Review   commited 2024-04-02 18:32:40 +00:00
0634c7c4d2
Replace connectToCell -> NetworkCallbackRule
Developers often forget to unregister requests in tests, and cleanup
code also makes tests more verbose.

Add a rule that unregisters callbacks automatically when after each test
method.

Replace current usage of connectToCell with this rule, as well as
network callback usage in CaptivePortalTest (which is one example that
did not unregister its callback).

Test: atest
Change-Id: Ie3b9c5cf529004b7b3af04bc13a7e69acfbbaa18

Remi NGUYEN VAN   commited 2024-04-02 11:18:20 +09:00
e629bb7c84
Merge changes Ie882a5c7,Id94b6538,I58eda41f into main
* changes:
  Support prefix information option parsing in nduser netlink message.
  Add PrefixInformation option struct to parse nduser option.
  Create IpPrefix in PrefixInformationOption constructor

Patrick Rohr   authored and   Gerrit Code Review   commited 2024-04-01 18:41:53 +00:00
da9dfa2207
Merge "Changes to support satellite stats appear as TYPE_MOBILE" into main
Nagendra Prasad Nagarle Basavaraju   authored and   Gerrit Code Review   commited 2024-04-01 14:33:37 +00:00
ad48c49ee0
Changes to support satellite stats appear as TYPE_MOBILE
With satellite transport supported at device and satellite
network to appear under type mobile, considers cellular or
satellite, or combination of both interfaces under mobile interfaces.

Note: getUidStatsForTransport(TRANSPORT_SATELLITE) is not supported,
considering the same interface name could be used by cellular as well,
supporting this might lead to double counting problem.

Bug: 329003473
Test: atest FrameworksNetTests
Change-Id: I85465cedcc5550fa0555dc36b3be364ac90aade1

Nagendra Prasad Nagarle Basavaraju   commited 2024-04-01 10:53:02 +00:00
756ca07f80
Support prefix information option parsing in nduser netlink message.
Bug: 315069348
Test: atest NetworkStaticLibTests
Change-Id: Ie882a5c721befd4384858140a1f0706a0247d3a1

Xiao Ma   commited 2024-04-01 16:06:02 +09:00
5485bb84f1
Add PrefixInformation option struct to parse nduser option.
This is helpful for user space to get the PIO option via netlink message
and check whether the P flag is set or not, this bit flag determines if
we should start DHCPv6 PD process for IPv6 provisioning.

Bug: 315069348
Test: atest NetworkStaticLibTests
Change-Id: Id94b6538c5d88fe43c262ab23c30ccd53c766a62

Xiao Ma   commited 2024-04-01 16:05:59 +09:00
e20dc5ae89
Create IpPrefix in PrefixInformationOption constructor
The constructor is invoked during Struct#parse() at which point we might
as well try to create the IpPrefix object which will be used later. If
this fails for some reason (UnknownHostException or ClassCastException),
the prefix is bogus and should not be used.

Bug: 315069348
Test: TH
Change-Id: I58eda41f98b774fe97389beb1b84e164634a20d3

Xiao Ma   commited 2024-04-01 12:51:19 +09:00
5d3dcb0d64
Add isFeatureEnabled API for CaptivePortalLogin experiment namespace.
Bug: 329361366
Test: atest NetworkStaticLibTests
Change-Id: I3421f04bdace03221a3d6bde27da1d2ffd61e789

Xiao Ma   commited 2024-03-28 08:35:08 +00:00
12f7fd26af
Merge "Separate Struct.java into its own lib." into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-03-28 06:23:57 +00:00
68d68d82ed
Separate Struct.java into its own lib.
* Struct.java is removed from net-utils-device-common-bpf and
  net-utils-device-common-struct's source list
* Created a lib net-utils-device-common-struct-base for Struct.java
* Updated libs that require Struct.java to include
  net-utils-device-common-struct-base.
* Replaced net-utils-multicast-forwarding-structs with
  net-utils-device-common-struct in service-connectivity

Bug: 323503345

Test: build tethering module.
Change-Id: I3f60715c3d8043b7569db7612dee9d4fa1ccba59

Yang Sun   commited 2024-03-27 20:15:17 +08:00
3aa62e6773
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
Do faster bitmask checks on NetworkCapabilities
Allows compiler to turn some conditionals into constant
expressions and to simply the machine code.

Bug: 326744138

Change-Id: Ic0abed8c548986fe7ef1876bd1eb3e55ac6b8c10

Shai Barack   commited 2024-03-19 04:15:40 +00:00
70e7011a07
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