Commit graph android_packages_modules_Co.../common
Message SHA1
[Thread] make ThreadNetworkController#setConfiguration a system API
This CL turns setConfiguration into a system API, including the
ThreadConfiguration#Builder
and the #setNat64Enabled method.

Bug: 368456504

Change-Id: I0ff2ed81271dcceea295d169a46a02f05aeda5d6

Handa Wang   commited 2024-10-10 05:36:11 +00:00
651bfdaaf7
[Thread][API] add API for ephemeral key.
This CL adds the API for starting/stopping the ephemeral key mode, and
subscribing to the ephemeral key state changes.

Ephemeral key mode is started with a limit amount of time to allow
Thread credential sharing.

Bug: 348323500
Test: atest CtsThreadNetworkTestCases
Change-Id: I540c88ec4668291358fbe87a678d8f9d31a67e54

Yang Sun   commited 2024-09-29 02:35:44 +00:00
b8aa8bb47f
Merge "Add flag for collecting tethering active sessions metrics" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-08-30 03:10:53 +00:00
4de2b911a9
Add flag for collecting tethering active sessions metrics
This is needed for follow-up CLs to wrap necessary code
change under this flag.

Test: TH
Bug: 354619988
Change-Id: I7a36ff228b1ff34860c7fa4e90537ad87f543ddc

Junyu Lai   commited 2024-08-29 17:18:25 +08:00
9bd74757ea
[Thread] make Thread flags fixed_read_only
The newly added Thread flags (i.e. configuration_enabled and
channel_max_power_enabled) are not visible on gantry. This is due to the
flags are not fixed.

Bug: 346686506
Change-Id: I4c50507c90057132aa336a401a53e9c560acd8bc

Kangping Dong   commited 2024-08-28 13:55:15 +08:00
8fb3f07dfe
Merge "changes the API setChannelMaxPowers from hide API to system API" into main
Zhanglong Xia   authored and   Gerrit Code Review   commited 2024-08-26 14:03:50 +00:00
b5ddf3a056
changes the API setChannelMaxPowers from hide API to system API
This CL changes the hiden API `setChannelMaxPowers` to system API
to allow the privilege app to set the max power of each Thread channel.

Bug: b/346686506
Test: atest CtsThreadNetworkTestCases
Change-Id: I1089a4a315971c3bca8ec688a02143ddec93d039

Zhanglong Xia   commited 2024-08-26 10:07:36 +08:00
5bbfd91b04
Specify is_fixed_read_only: true for net security mainline trunk stable flag
Mainline trunk stable flag must specify is_fixed_read_only: true since
server-side flags not supported for mainline in the trunk stable infrastructure
as of now.

Change-Id: Ibb2d599ee655f871f08b36bbc3cd6e286cf0d3c8
Test: TH

Motomu Utsumi   commited 2024-08-23 08:32:24 +00:00
9efd5627c3
Specify is_fixed_read_only: true for mainline trunk stable flag
Mainline trunk stable flag must specify is_fixed_read_only: true since
server-side flags not supported for mainline in the trunk stable infrastructure
as of now.

Change-Id: Icabffe7acf437c007e413f64aa53bae4eff3099f
Test: TH

Motomu Utsumi   commited 2024-08-20 05:50:08 +00:00
66bb1c339f
Use java_aconfig_library for nearby and thread flags
Connectivity repo now can use java_aconfig_library since this target is
available on all downstream branches.

Bug: 345121279
Test: TH
Change-Id: I6d267ddac89731a8efbef2ee98a3baa1df754ff5

Motomu Utsumi   commited 2024-08-16 16:59:08 +09:00
dbb82c0581
Add boilerplate code for CertificateTransparencyService
Flag: com.android.ct.flags.certificate_transparency_service
Bug: 319829948
Test: m
Change-Id: I69dd1b7346a013e9a990c9ae8cec1beb51be074d

Sandro Montanari   commited 2024-08-12 08:50:29 +00:00
9ffc0685d7
Support NetworkStats#addEntries API
Currently, NetworkStats#addEntry creates a new instance
containing the requested result instead of mutating the
original object. This creates a heavy memory footprint
when the caller invokes it in a loop because a new NetworkStats
instance is created whenever an addEntry is called.

This change introduces a new API that allows callers to
add a set of entries to a NetworkStats instance. This new
API will clone the instance only once, return the newly
created (and modified) instance, and ensure that the original
instance remains immutable.

Additionally, the change adopts config libraries for flagging
the API and corresponding CTS tests, since Android U-based
branches are no longer downstream of current development branches.

Test: atest FrameworksNetTests:android.net.connectivity.android.net.netstats.NetworkStatsApiTest
Test: atest CtsNetTestCases:NetworkStatsApiTest
Bug: 335680025
Fix: 357772271
API-Coverage-Bug: 357772271
Change-Id: I58513844e681c0621a6107ec4b198cd3957f289d

Junyu Lai   commited 2024-08-09 14:19:38 +08:00
d0e049455c
Introduce TETHERING_VIRTUAL type
Bug: 340376953
Test: Presubmit
Change-Id: I0714b62ebfc63fc966d7873ebdd68ae72c015bc4

Seungjae Yoo   commited 2024-06-19 16:18:51 +09:00
07b8fe1f92
Introduce NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED
On V+, this capability is set by default.
Constrained satellite networks never become the system default network.

Test: CSSatelliteNetworkTest
Bug: 343823469
Change-Id: I020ba48e74f1f180e1807cbe1c066209bedb0454

Motomu Utsumi   commited 2024-06-06 15:49:21 +09:00
154ce6381a
Revert^2 "Add blocked reason for internet permission"
This reverts commit cb74c08979.

Reason for revert: This change is not a cause of b/342557183

Change-Id: Iee8d9b05bbe130a46b627b12da525177b4ee89b2

Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-05-27 02:12:43 +00:00
cfd5a517da
Revert "Add blocked reason for internet permission"
This reverts commit ee96ba0e60.

Reason for revert: Droidmonitor triggered revert due to b/342557183. Will be verifying through ABTD before submission.

Change-Id: I7e185c3ac11da27c7bb9d95e4221f7dfc22cf48c

Priyanka Advani   authored and   Gerrit Code Review   commited 2024-05-24 18:11:45 +00:00
cb74c08979
Add blocked reason for internet permission
Currently, even if apps don't have INTERNET permission and can not use
network, network access is considered not blocked and
ConnectivityService send onBlockedStatusChanged callback with
blocked=false.
This CL introduced BLOCKED_REASON_NETWORK_RESTRICTED and consider
network access from apps targetting W+ on V+ releases is blocked if apps
don't have INTERNET permission.
Permission is set when the user is added or package is installed and
permission is removed when the user is removed or packages is
uninstalled.
So ConnectivityService does not need to monitor permission change to
send onBlockedStatusChanged callback by permission change.

Test: CSBlockedReasonsTest
Bug: 339559837

Change-Id: I58d2a4eddc714e205f5b96219f95b637f2826c58

Motomu Utsumi   commited 2024-05-24 13:45:51 +09:00
ee96ba0e60
Add blocked reason for OEM deny firewall chains
FIREWALL_CHAIN_OEM_DENY_x chains were added by aosp/2114533 but
corresponding blocked reasons were not added.
Upcoming aosp/3027488 updates CS to generate blocked reasons based on
bpf map contents.
Without blocked reasons for oem deny chains, onBlockedStatusChanged
callback will have inconsistency from the actual network blocked status.
This CL adds BLOCKED_REASON_OEM_DENY for FIREWALL_CHAIN_OEM_DENY_x chains

Bug: 328732146
Test: TH
Change-Id: I3793aa0e231d32fea5eb202ed69e170f74d66b02

Motomu Utsumi   commited 2024-05-07 18:31:07 +09:00
9e75aad888
Make com.android.tethering the flag container instead of system
It was set to "system" incorrectly.

Bug: 312769710
Test: m all_aconfig_declarations
      printflags | grep android.ne
Change-Id: Ie65dcb8c987cc0677b80ba9f8f84fe604ebbf1d2

Paul Duffin   commited 2024-04-25 09:46:33 +01:00
8a4c9f6485
Add flag definition for metered network firewall chains
aosp/3020885 added metered network firewall chains API but this CL
missed to add flag definition.

Test: TH
Bug: 332628891
Change-Id: I450370c6ff15da110502f8111fa491516fecbc9a

Motomu Utsumi   commited 2024-04-25 13:15:34 +09:00
e6295a2326
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
clat bpf: add byte/packet counter
Bug: 285124667
Test: TreeHugger,
  atest FrameworksNetTests:android.net.connectivity.com.android.server.connectivity.ClatCoordinatorTest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5b59f0c05d41030f99160f68058c61eadd24fbbd

Maciej Å»enczykowski   authored and   KH Shi   commited 2024-03-19 07:54:36 +00:00
8b3f9d9e3e
Export flags used in FlaggedApi annotations
Before calling a flagged API, client code must check the value of the flag
which gates it. Those flags must be exported in order to be accessible from
containers other than the container where the flag and the API are hosted.

Bug: 320984775
Bug: 322839671

Test: m all_aconfig_declarations
Test: printflags --format='{fully_qualified_name}:{is_exported}' | grep true

Change-Id: I61f18732a5c8a69acb6e645b6bf04b7a08adb513

Oriol Prieto Gasco   commited 2024-03-08 14:14:36 +00:00
646b09fc91
Merge "Remove register_nsd_offload_engine flag from module flags.aconfig" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-02-28 08:26:40 +00:00
d1dcb3b3f3
[Thread] add Thread aconfig_declaration to java_sdk_library
This commit also moves Thread flags to Connectivity/common to ease
maintenance.

Test: m framework-connectivity-t
Bug: 317290555
Merged-In: I50f3d3b8205a5a9ee8154a649318a2c175edbb71
Merged-In: I8a71f4ee49cc68a9512f432e454469200f2a5058
Change-Id: I8a71f4ee49cc68a9512f432e454469200f2a5058

Kangping Dong   commited 2024-02-26 11:18:03 +08:00
8fb80dd075
Merge "Move Nearby flags to common and add specify it in java_sdk_library" into main
Yahav Nussbaum   authored and   Gerrit Code Review   commited 2024-02-22 12:37:57 +00:00
c92872e3d5
Move Nearby flags to common and add specify it in java_sdk_library
Bug: 324993608
Test: TH
Change-Id: I1dc79353e9bae3d977db88e572e871cd459fc7fc

Yahav Nussbaum   commited 2024-02-22 06:49:15 +00:00
259be7bd4e
Remove register_nsd_offload_engine flag from module flags.aconfig
register_nsd_offload_engine is moved to platform flags.aconfig since
this flag is used from platform and not used from module

Bug: 325591785
Test: TH
Merged-In: If8a8426dbbb10253fd5046f639de13519396ddac
Change-Id: If8a8426dbbb10253fd5046f639de13519396ddac

Motomu Utsumi   commited 2024-02-19 06:58:45 +00:00
d1e01dc498
Update flags.aconfig to follow the current APIs
This CL also specifies aconfig_declaration module in java_sdk_library
register_nsd_offload_engine will be moved to the platform flags.aconfig
in the followup CL.

Test: TH
Change-Id: I430a5f0b1e1ef2e3394cf6aa8efebbd46da41765

Motomu Utsumi   commited 2024-02-19 06:58:35 +00:00
52f294cbc4
Merge "Make TetheringRequest parcelable" into main
Quang Luong   authored and   Gerrit Code Review   commited 2024-02-15 04:20:03 +00:00
211e7862b6
Make TetheringRequest parcelable
Make TetheringRequest parcelable so we can pass it via Wifi APIs and map
Soft AP state changes to the correct request.

Bug: 216524590
Test: build
Change-Id: I63a45b14e9abc288b353159dfdcbe96fde485cb7

Quang Anh Luong   commited 2024-02-15 10:15:05 +09:00
1252f7f428
Merge "Include FlaggedApi.bp" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-02-14 05:48:26 +00:00
e9e28ce2b4
Define the IpSecTransformState API flag in Connectivity module
The flag com.android.net.flags.ipsec_transform_state gates APIs
exposed by the Tethering module, and thus should also be included
in Connectivity/common/flags.aconfig

Bug: 324278950
Test: make
Change-Id: Ia1fe733a4971ac56cae65870a5339362594322e6

Yan Yan   commited 2024-02-12 21:08:37 +00:00
4862fd52d5
Set the container field of aconfig flags
Test: m
Bug: 312769710
Change-Id: I1eed7982b40d28947aa3f9575c568eac325dc832

Oriol Prieto Gasco   commited 2024-02-03 02:39:14 +00:00
6eec17aa97
[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
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
Use flags.aconfig in platform for android networking
flags.aconfig for android networking is under
packages/modules/Connectivity.
But, currently, mainline code should not read trunk stable flag.
To avoid confusion, this CL moves flags.aconfig to platform.

Bug: 315302281
Test: TH
Change-Id: I3a667cfa14d51e481bb4e99301c10319d2600e00
Merged-In: I44c111577643bacb35b532cb156a61d30cfea31a

Motomu Utsumi   commited 2023-12-08 11:42:35 +09:00
31abe92c36
Add a flag for getIpSecTransformState and IpSecTransformState
Bug: 308011229
Test: make
Change-Id: Ib148b62b375f4f7b6a5d5ca82c74808bffa2e531

Yan Yan   commited 2023-12-07 18:47:24 +00:00
318b1abbaf
Remove unused aconfig
Remove nsd_expired_services_removal aconfig, since it is no
longer used.

Bug: 312669635
Test: m
Change-Id: I9b21b6102ed9a8160be3d853d44d9b051997d09e

Paul Hu   commited 2023-11-23 02:37:03 +00:00
af9e181b28
Add feature flag for REGISTER_NSD_OFFLOAD_ENGINE permission
Bug: 304478692
Test: TH
Change-Id: Ib7234b2e3b5c725bde0db9b93ac96d745a65f57d

Yuyang Huang   commited 2023-11-16 11:26:49 +09:00
104cf3cff7
New firewall chain for default background restrictions
A new firewall chain is needed to configure background network
restrictions for apps.
This change only adds the API stubs and traffic controller constants to
make the chain work. Policy changes using this chain will follow in
the framework code.

Test: atest CtsNetTestCases:ConnectivityManagerTest
Test: atest ConnectivityServiceTest

NO_IFTTT=The Lint rule along with the relevant code in Common.h is
being deleted in aosp/2819759

Bug: 304347838
Change-Id: I33e2db6671431f7c576fc931d9f96e684fc1e78a

Suprabh Shukla   commited 2023-11-08 10:17:30 +00:00
2d893b68a9
Merge "Add methods for updating ingressDiscardRule bpf map to BpfNetMaps" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2023-11-06 10:41:53 +00:00
d872c3c960
[BR03.1] Expose isUidNetworkingBlocked
Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideNetworkCallbackTests
Bug: 297836825
Change-Id: I70b2351b9cd1c3c6fa34258397e0bf22cb8150b2

Junyu Lai   commited 2023-11-06 13:26:19 +08:00
bb59480733
Add methods for updating ingressDiscardRule bpf map to BpfNetMaps
Bug 295800201
Test: NetworkStaticLibsTests

Change-Id: I42bc0adc22c3018480029d624053f758d815e526

Motomu Utsumi   commited 2023-10-31 17:07:46 +09:00
77b49996d2
Add java class for Ingress discard bpf map key value
Bug: 295800201
Test: TH
Change-Id: Ic9ac423aee2a8fb9709b0acf012ec57cdfa019f9

Motomu Utsumi   commited 2023-10-26 15:48:22 +09:00
d4fe2c3a50
Merge "Revert "Revert "[BR07.1] Expose setDataSaverEnabled from Connect..."" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2023-10-25 01:59:12 +00:00
0cfaea8d98
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

Junyu Lai   commited 2023-10-24 07:30:23 +00:00
df210365fe