Commit graph android_packages_modules_Co.../common/Android.bp
Message SHA1
NetBpfLoad: use libbpf based on mainline beta flag, part 2
Disable shared version of libtetheringflags
  - since the flags are readonly there is no real content to this,
    and it should be statically linked for compile/link time optimization
    (which should basically optimize the entire library out)

Use C++ magic to compile time verify the macro and flag are in sync.

The way this works:

constexpr auto useLibBpf = COM_ANDROID_TETHERING_READONLY_FLAGS_USE_LIBBPF;

^ this basically requires the macro to resolve to true/false, so that 'auto' resolves to 'const bool'

static_assert(std::is_same<decltype(useLibBpf), const bool>::value, "useLibBpf must be a boolean.");

^ which we check here

static_assert(useLibBpf == com::android::tethering::readonly:🎏:use_libbpf(), "useLibBpf flag mismatch");

^ and this then requires the macro and flag to be identical *and* compile time known

Test: TreeHugger
Flag: EXEMPT PURE_REFACTOR
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id5cd8c7d91b424765d6f469806434b3e9587f074

Maciej Żenczykowski   commited 2025-09-12 04:04:39 -07:00
1c59188cf0
NetBpfLoad: use libbpf based on mainline beta flag
This CL did not change the binary and library size

Before this CL
"""
$adb shell ls -l /apex/com.android.tethering/bin/netbpfload
-rwxr-x--- 1 root root 102744 1970-01-01 09:00 /apex/com.android.tethering/bin/netbpfload
$adb shell ls -1 /apex/com.android.tethering/lib64 | wc -l
21
"""

After this CL
"""
$adb shell ls -l /apex/com.android.tethering/bin/netbpfload
-rwxr-x--- 1 root root 102744 1970-01-01 09:00 /apex/com.android.tethering/bin/netbpfload
$adb shell ls -1 /apex/com.android.tethering/lib64 | wc -l
21
"""

Flag: com.android.tethering.readonly.flags.use_libbpf
Bug: 428792764
Test: Enable/Disable flag, boot, adb shell logcat
Change-Id: Ie8d94ab00d8b32f5062265c6b9696feb77a0f0b1

Motomu Utsumi   commited 2025-08-22 22:46:24 +09:00
5a3103ba1e
Use beta flag for bluetoothTetheringRandomizedAddress
Bug: 287177081
Test: TH
Flag: com.android.tethering.mainline.beta.bluetooth_tethering_randomized_address
Change-Id: I1de9f4bb15c8423f09381a0c7513f0d7ebf80856

Motomu Utsumi   authored and   Hao Liu   commited 2025-07-17 21:30:07 +00:00
4b4f3018a5
Add end to end mainline beta test flag in connectivity module
These are dummy no op test flags meant for testing mainline beta
flagging and workflow infras. Will remove them once the test has
completed.

Bug: b/406508072
Test: m and verify in AVD
Flag: EXEMPT build system changes
Change-Id: I3d9326bce2ca0b7b8a61405a88565a1a7674c4db

Dennis Shen   commited 2025-06-11 16:14:34 -07:00
ca4ad86d20
Extend QosFilter address matching function
Extend QosFilter address match function for IP address range based on
prefix length.

Bug: 406146808
Bug: 399960748
Flag: com.android.net.flags.qos_filter_ip_range_matching
Test: atest CtsNetTestCases
Test: atest ConnectivityCoverageTests
Change-Id: I78d995fda111d258da9a912c7afa5e472e43437f

Sewook Seo   commited 2025-05-08 22:37:32 -07:00
6305252415
Clean up flags to not only flag APIs
Going forward flags will also be used instead of legacy flags for
flagging changes that do not involve new APIs. Clean up the build rules
to move them from FlaggedApi.bp to the main Android.bp (since there are
no branch differences anymore), and fix the comment.

Test: m
Flag: EXEMPT: refactor
Change-Id: I46ec52dfaf9dbef55364e2def30d97ab9bce55ed

Remi NGUYEN VAN   commited 2025-04-02 16:23:17 +09:00
9d5920edf9
Merge "Separate Struct.java into its own lib." into main am: 68d68d82ed am: 5073b08475
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2999657

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

Yang Sun   authored and   Automerger Merge Worker   commited 2024-03-28 07:00:54 +00:00
c9cdb2ef2b
Merge "Separate Struct.java into its own lib." into main am: 68d68d82ed
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2999657

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

Yang Sun   authored and   Automerger Merge Worker   commited 2024-03-28 06:44:01 +00:00
5073b08475
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 "Include FlaggedApi.bp" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-02-14 05:48:26 +00:00
e9e28ce2b4
[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
(cherry picked from https://android-review.googlesource.com/q/commit:a8ac702eb268d687d089ba218926ae6b17cda33c)

Change-Id: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Merged-In: I243f17b3f0ad7af9ffa15ca242456e36688733f5

Aditya Choudhary   commited 2024-01-31 14:10:00 +00:00
71086be55e
[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
(cherry picked from https://android-review.googlesource.com/q/commit:a8ac702eb268d687d089ba218926ae6b17cda33c)

Change-Id: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Merged-In: I243f17b3f0ad7af9ffa15ca242456e36688733f5

Aditya Choudhary   commited 2024-01-31 12:42:56 +00:00
985604c94f
[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
Include FlaggedApi.bp
Merged-In to avoid merging this change to ump branch

Test: TH
Bug: 321624552
Merged-In: I4ef7eff6567b848c8cfa52c51c734642ce929589
Change-Id: Ie9728714614e4fd43fd845b50c8bdd4856cf47e3

Motomu Utsumi   commited 2024-01-30 23:58:25 +00:00
98a7630a1f
Include FlaggedApi.bp in main
Test: TH
Bug: 321624552
Ignore-AOSP-First: Merged in aosp/2927450
Change-Id: Iecb6f4d0a6e5e036299783b49108df3a88c5493e

Motomu Utsumi   commited 2024-01-25 13:03:16 +00:00
6d45ec3539
Add aconfig flags for Connectivity FlaggedAPI annotations
Bug: 321624552
Test: TH
Change-Id: Idbec5e8af0f3764b5bf432e3dd5e6ba7f35aa81f

Motomu Utsumi   commited 2024-01-23 17:20:03 +09:00
3a586fc095
Remove TrunkStable.bp
Aconfig Flag for android network is defined in the platform and
TrunkStable.bp is not used.

Test: TH
Bug: 315302281
Change-Id: I46d988f25a366e51da52af01ad34e2ce1511c942

Motomu Utsumi   commited 2023-12-11 15:12:01 +09:00
b17d60144a
[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

Junyu Lai   commited 2023-10-23 20:11:02 +08:00
626045a601
Add aconfig_declarations for flags in android_core_networking
Add aconfig_declarations so that platform code can use this flag.
Following CLs(aosp/2606670) use this flag to sync the mainline behavior
change and platform behavior change.
Having merged-in to avoid being merged to udc-mainline-prod where
aconfig soong targets are not supported

Bug: 267870186
Test: TH
Merged-In: I4870fbe882ce0ec995dcaeb8a2624071fee6dce7
Change-Id: I2260dc3d60689da9328fe4f98c3f3048d96bbf6d

Motomu Utsumi   commited 2023-10-06 20:10:20 +09:00
e63d38ff37
Add aconfig flag file
This CL does not have Merged-In since all the branches should have the
aconfig file so that adding flags to the file does not have conflicts.
Following CL adds aconfig_declarations to Android.bp only on branches
where aconfig soong targets are supported

Bug: 267870186
Test: TH
Change-Id: I621228a2c9594bf7bfe1cf335619c417e9339743

Motomu Utsumi   commited 2023-10-06 10:51:23 +09:00
dca83676dd
Connectivity: bump min sdk 29(Q) to 30(R)
Mainline push to Q was stopped in February 2023.

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

Maciej Żenczykowski   commited 2023-06-15 00:22:48 +00:00
3fa9dceabc
Move struct {Clat*, Tether4*, TetherStats*} to connectivity module
Needed because these struct classes should not be exposed.
Only used for the connectivity module and its tests.

Bug: 234160319
Test: atest ConnectivityCoverageTests

The moved files are identical.

diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/ClatEgress4Key.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/ClatEgress4Key.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/ClatEgress4Value.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/ClatEgress4Value.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/ClatIngress6Key.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/ClatIngress6Key.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/ClatIngress6Value.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/ClatIngress6Value.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/Tether4Key.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/Tether4Key.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/Tether4Value.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/Tether4Value.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/TetherStatsKey.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/TetherStatsKey.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/TetherStatsValue.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/TetherStatsValue.java
diff packages/modules/Connectivity/common/src/com/android/net/module/util/bpf/ClatEgress4Key.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/ClatEgress4Key.java
(no diff)

Change-Id: I4ce8045150bdbf04c63c5262c58a0ebcc30d395c

Hungming Chen   authored and   Nucca Chen   commited 2022-06-29 11:34:19 +00:00
01f2550ac4