Commit graph android_packages_modules_Co.../common/flags.aconfig
Message SHA1
Introduce carrier-aware avoid bad Wi-Fi APIs
This commit introduces new system APIs to manage "avoid bad Wi-Fi" settings,
leveraging both global system settings and carrier configurations. This
enhancement allows for more granular control and visibility into how Wi-Fi
networks are managed, especially in multi-SIM environments.

The new `setNetworkAvoidBadWifi(Context, int subId)` method provides
the ability to programmatically control this setting based on carrier-specific
policies or user preferences. This complements `getNetworkAvoidBadWifi(Context, int subId)`,
which allows querying the setting for a specific subscription ID, ensuring the
system can accurately determine the avoid bad Wi-Fi status.

Additionally, `shouldShowAvoidBadWifiToggle(Context, int subId)` is introduced.
This method determines whether the 'Avoid Bad Wi-Fi' user interface toggle
should be displayed. It considers both global settings and carrier configurations,
allowing for dynamic UI adjustments based on carrier requirements or user preferences.

These changes provide greater flexibility for managing Wi-Fi network selection
and improve the user experience by offering more context-aware control over
cellular behavior.

Deprecated APIs:
- `setNetworkAvoidBadWifi(Context, int value)`
- `getNetworkAvoidBadWifi(Context)`
New APIs:
- `setNetworkAvoidBadWifi(Context, int subId, int value)`
- `getNetworkAvoidBadWifi(Context, int subId)`
- `shouldShowAvoidBadWifiToggle(Context, int subId)`

Flag: com.android.net.flags.carrier_aware_avoid_bad_wifi
Bug: 410976315
Test: atest ConnectivityCoverageTests:android.net.connectivity.android.net.ConnectivitySettingsManagerTest
Change-Id: I79469cfe865a585593219d226c8198206c06b589

Jimi Chen   commited 2025-06-10 12:18:35 +00:00
92e23acebb
Expose NetworkTemplate get/set transport type APIs
This is needed for counter-part modules to query data usage
with specified transport type.

Flag: com.android.net.flags.netstats_transport_type
Test: atest ConnectivityCoverageTests --test-filter \
'NetworkTemplate*' --update-device
Bug: 419123367
Bug: 420531377

Change-Id: I7778de815bec947be3e6abbd6269e1727de5c550

Junyu Lai   commited 2025-06-08 23:14:07 -07:00
19ff6a1025
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
Define the EthernetConfigStore API flag in Connectivity module
The com.android.net.flags.ethernet_config_store gates APIs exposed
by ethernet module, thus should also be included in
Connectivity/common/flags.aconfig

Bug: 397536853
Test: make
Flag: com.android.net.flags.ethernet_desktop_config

Change-Id: I158bc6298254e4075b594be90661e60b41d9930b

Chuwei He   commited 2025-05-06 23:37:08 -07:00
c666f38532
Make NsdManager.registerService() public API
This commit makes the NsdManager.registerService() API public. This
change will enable developers to implement more customizable mDNS
advertising behavior in their applications.

Bug: 373270045
Test: atest CtsNetTestCases:NsdManagerTest
Flag: com.android.net.flags.mdns_advertising_improvement
API-Coverage-Bug: 415202964
Change-Id: I32359f7265b3597defd57123ecff0deaef0011f8

Yuyang Huang   commited 2025-05-02 15:23:14 +09:00
9e74d41f3d
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
Set restrict local network aconfig flag for 26q2 dates
Local net protections is introduced in B as a developer opt-in, on dev
builds; the feature flag is meant to be used when enforcement begins in
2026

Bug: 396116600
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.PermissionMonitorTest
Change-Id: Id5e7a7cf825f10f90edd600ea2567cfe6efd2e98

Jacque Li   commited 2025-02-12 12:04:04 -05:00
0c67f3579f
Listen to permission changes in permission monitor
Bug: 369646309
Test: atest
ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.PermissionMonitorTest

Change-Id: I23c524baaee6b9b06a855fb811906e5189ef03fd

Jacque Li   commited 2025-02-07 15:08:09 -05:00
2003e6ee49
Add flag for IPv6 over BLE
Bug: 372936361
Test: TH
Change-Id: Idde296c9cbcb64721fda9d9bdd06884306cfb3a1

Patrick Rohr   commited 2024-12-12 14:37:01 -08:00
a3b97397a2
Delete unused flag
This flag is unused after the previous commit.

Test: TH
Change-Id: Ic6b5378f503b822d5bdf9a94cf328ffef5e3a5b8

Patrick Rohr   commited 2024-11-13 17:21:58 +00:00
2580051834
Add new flag for Tethering w/ SoftApConfig
Old flag gantry flow was disabled due to being out of sync
(b/362407371). This change adds a new version of the same flag to
kickstart a new gantry flow.

Flag: com.android.net.flags.tethering_with_soft_ap_config

Bug: 216524590
Test: build
Change-Id: I50701582852c2077e7807ab2685e390f112fd029

Lorenzo Colitti   commited 2024-11-13 17:19:11 +00:00
172fe79552
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
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
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
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
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
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
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
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
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
[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
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
Revert "[BR07.1] Expose setDataSaverEnabled from ConnectivityManager"
Revert submission 2745215-npmsbpf

DroidMonitor: Potential culprit for Bug 307256512 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.


Reason for revert: 307256512

Reverted changes: /q/submissionid:2745215-npmsbpf

Change-Id: I27119a7484453d1369bbdf71ad2479edec7d664f

Jordan Silva   authored and   Gerrit Code Review   commited 2023-10-23 13:23:01 +00:00
457ae0f00f
[BR07.1] Expose setDataSaverEnabled from ConnectivityManager
Currently, data saver switch is controlled in NPMS, which
calls into NetworkManagementService and netd when switching
status. In netd, BandwidthController manipulates the
bw_data_saver chain to control the overall behavior.

However, this code are all platform implementation, which
are not updatable. In order to migrate data saver switch
from iptables to bpf, this API is needed for Connectivity to
change the implementation to directly write bpf in later
patches.

Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Test: atest FrameworksServicesTests:NetworkManagementServiceTest
Bug: 297836825
Change-Id: I71fa41ca739fef8e191fba91b02758ad5f732d5c

Junyu Lai   commited 2023-10-19 17:43:44 +08:00
c279f1830e
Add expired services removal flag
The TTL check and removal of expired services is currently only
performed when a mDNS query is sent. This can result in expired
services remaining in the cache if no queries are sent. To
address this, the remaining TTL will be checked when retrieving
services from the MdnsServiceCache. Add a new flag to enable
the expired services removal feature. This feature will be
implemented in subsequent changes.

Bug: 265787401
Bug: 304649384
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I30f0eea568ee45d363cc02821de0921d6040f981

Paul Hu   commited 2023-10-18 17:48:46 +08:00
f3fe3333d3
Prepare exposing Network{Request,Caps}.forbiddenCapabilities
This is useful going forward in particular because there will
be a default forbidden capability for LOCAL_NETWORKS. This
means it will be useful to be able to remove it.

It is also generally useful and we have been wanting to open
this API to the public, so this is a good opportunity to do so.

Test: new tests for NetworkRequest
      NetworkCapabilitiesTest already has tests because it
      already was @SystemApi
Change-Id: Ibb8d33b799f2d274326fd9cd0b05a2c33a18032a

Chalard Jean   commited 2023-10-11 17:02:52 +09:00
cf7dbcae41
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