Commit graph android_packages_modules_Co.../common
Message SHA1
Generalize ip address handling in tether4Value bpf structures
Updated Tether4Value.java to utilize
java.net.InetAddress for relevant IP address fields.
These fields are correspondingly annotated with
Type.IpAddress for BPF map interactions.

Bug: 392509494
Test: atest TetheringTests
Flag: EXEMPT refactor
Change-Id: I6b5b1e176a47b55ad7482be15e4e2d8ee95ab1d1

Sarup Dalwani   authored and   Maciej Żenczykowski   commited 2025-09-04 00:52:31 -07:00
cdd31d8bf3
Refactor Tether4Key to use Inet4Address
Change the type of src4 and dst4 from byte[] to Inet4Address in the
Tether4Key class. This simplifies the code by removing the need for
conversions between byte arrays and Inet4Address objects.

Bug: 392509494
Test: atest TetheringTests
Flag: EXEMPT refactor
Change-Id: I3072a8520c93042a25d1f60aa41bdfa5485062f6

Sarup Dalwani   commited 2025-08-29 19:30:29 +00:00
f7adba65b3
Provide offload service information update from DiscoveryManager
With this change, the OffloadEngine can receive updates when
offload service information changes from DiscoveryManager. This
allows the OffloadEngine to maintain offload services and to
adjust its behavior accordingly.

Bug: 410734687
Test: atest ConnectivityCoverageTests
Flag: com.android.tethering.mainline.beta.nsd_selective_mdns_response_offload
Change-Id: I6c6ba4e76b4a2a94cbfef37bec9d6f87357bec5f

Paul Hu   commited 2025-08-27 02:13:32 +00:00
f1ae69a950
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
Merge changes I105ee1d6,I55817132 into main
* changes:
  Update ENABLE_MATCH_NON_THREAD_LOCAL_NETWORKS flag to target sdk 37
  Adopt mainline beta program for local network agent

Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-08-21 10:28:00 -07:00
14debeb714
Merge "Support IpAddress type in LocalNetAccessKey for BPF" into main
Sarup Dalwani   authored and   Android (Google) Code Review   commited 2025-08-21 09:53:36 -07:00
9e567923d4
Adopt mainline beta program for local network agent
Unifies the `TETHERING_LOCAL_NETWORK_AGENT` and
`WIFIP2PGO_LOCAL_NETWORK_AGENT` legacy feature flags into a
single mainline beta aconfig flag:
`tethering_and_p2p_go_local_network_agent`.

This change simplifies the logic for enabling the `NetworkAgent`
for both standard tethering (global scope) and Wi-Fi P2P Group
Owner mode (local scope). The agent is now enabled for both use
cases when the new flag is on.

The implementation in `IpServer` and associated tests have
been updated to use the new unified flag.

Flag: com.android.tethering.mainline.beta.tethering_and_p2p_go_local_agent
Bug: 420590461
Test: atest TetheringTests
Test: adb root
      adb shell device_config put com_android_tethering com.android.tethering.mainline.beta.tethering_and_p2p_go_local_agent true
      adb reboot
      atest CtsTetheringTest --test-filter '.*Agent.*'
Test: atest ConnectivityCoverageTests:android.net.ip.IpServerTest --update-device
Change-Id: I55817132c57a04b4f7b7bac61b5741f45ba16182

Junyu Lai   commited 2025-08-19 14:16:23 +08:00
dc420ccccb
Refactor IngressDiscardKey to support generic IP addresses
Updated IngressDiscardKey to use Type.IpAddress for its BPF
destination address field (dstAddr) and java.net.InetAddress
for its corresponding Java field

Bug: 392509494
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.BpfNetMapsTest
Flag: EXEMPT refactor
Change-Id: I24b3087c3c7f2ea25afe0f78729e01a7504e13cb

Sarup Dalwani   commited 2025-08-17 04:30:02 +00:00
83548e6690
Support IpAddress type in LocalNetAccessKey for BPF
Updated LocalNetAccessKey to use Type.IpAddress for its
`remoteAddress` BPF field. This enables the BPF map to
store both IPv4 and IPv6 addresses for this key.

To ensure proper functionality with IPv6 addresses, a new
unit test, `testAddLocalNetAccessAfterV_withIPv6`, has been
added to BpfNetMapsTest.java. This test specifically
verifies adding and retrieving local network access rules
using an IPv6 remote address.

Bug: 392509494
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.BpfNetMapsTest
Flag: EXEMPT refactor
Change-Id: I005f4f2b778ca2d3a4e6578c1440162532f8d004

Sarup Dalwani   commited 2025-08-17 03:39:28 +00:00
ab9a3af782
Merge "Use mainline beta flag for NetworkAgent event queueing" into main
Junyu Lai   authored and   Android (Google) Code Review   commited 2025-08-14 01:19:15 -07:00
0c6b14587b
Use mainline beta flag for NetworkAgent event queueing
Add `queue_network_agent_events_in_system_server` as a mainline beta
flag. This flag replaces the previous check for
`mQueueNetworkAgentEventsInSystemServer`, allowing the feature to be
controlled and enabled on all Android versions via mainline beta program.

Flag: com.android.tethering.mainline.beta.queue_network_agent_events_in_system_server
Test: atest ConnectivityCoverageTests --update-device \
      --test-filter '.*NetworkAgent.*'
Test: atest ConnectivityCoverageTests --update-device \
      --test-filter '.*Connectivity.*'
Fix: 428098184
Change-Id: I96b0443bd4c55c28d482349738bbdc4798f0c7f9

Junyu Lai   commited 2025-08-14 14:53:06 +08:00
c9890408bf
replace CookieTagMapKey with S64
(mostly autogenerated, with minor tweaks to make it build)

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

Maciej Żenczykowski   commited 2025-08-07 15:52:35 -07:00
9ef3916ba4
replace TetherStatsKey with S32
(mostly autogenerated, with minor tweaks to make it build)

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

Maciej Żenczykowski   commited 2025-08-07 15:48:28 -07:00
b5f97280d6
Add beta flag for lnp developer opt in
Bug: 369821572
Test: m
Flag: com.android.tethering.mainline.beta.lnp_developer_opt_in
Change-Id: I99884977a82f9a5a4c530edd6d3474dfeb2a3a52

Hao Liu   commited 2025-07-17 21:37:37 +00:00
ece0d94d7f
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
Merge "Add end to end mainline beta test flag in connectivity module" into main
Dennis Shen   authored and   Android (Google) Code Review   commited 2025-06-12 06:39:28 -07:00
3ef53cc9ff
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
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
LocalNetAccessKey - improve toString
while at it, improve dump to clarify default is true meaning global,
even though you could assume 0/false is the default, and that true means local...

  $ adb shell dumpsys connectivity trafficcontroller </dev/null | grep LocalNetAccess
Before on bluejay (47 is wlan0, 51 is v4-wlan0):
  sLocalNetAccessMap:
    LocalNetAccessKey{lpmBitlen=132, ifIndex=47, remoteAddress=/::ffff:224.0.0.0, protocol=0, remotePort=0}: false
    LocalNetAccessKey{lpmBitlen=160, ifIndex=47, remoteAddress=/::ffff:255.255.255.255, protocol=0, remotePort=0}: false
    LocalNetAccessKey{lpmBitlen=96, ifIndex=47, remoteAddress=/2a00:79e1:2e00:3f01::, protocol=0, remotePort=0}: false
    LocalNetAccessKey{lpmBitlen=96, ifIndex=47, remoteAddress=/fe80::, protocol=0, remotePort=0}: false
    LocalNetAccessKey{lpmBitlen=40, ifIndex=47, remoteAddress=/ff00::, protocol=0, remotePort=0}: false
    LocalNetAccessKey{lpmBitlen=132, ifIndex=51, remoteAddress=/::ffff:224.0.0.0, protocol=0, remotePort=0}: false
    LocalNetAccessKey{lpmBitlen=160, ifIndex=51, remoteAddress=/::ffff:255.255.255.255, protocol=0, remotePort=0}: false
    LocalNetAccessKey{lpmBitlen=40, ifIndex=51, remoteAddress=/ff00::, protocol=0, remotePort=0}: false
After this commit:
  sLocalNetAccessMap (default is true meaning global):
    LocalNetAccessKey{lpmBitlen=132 ifIndex=47 remoteAddress=224.0.0.0/4}: false
    LocalNetAccessKey{lpmBitlen=160 ifIndex=47 remoteAddress=255.255.255.255}: false
    LocalNetAccessKey{lpmBitlen=96 ifIndex=47 remoteAddress=2a00:79e1:2e00:3f01::/64}: false
    LocalNetAccessKey{lpmBitlen=96 ifIndex=47 remoteAddress=fe80::/64}: false
    LocalNetAccessKey{lpmBitlen=40 ifIndex=47 remoteAddress=ff00::/8}: false
    LocalNetAccessKey{lpmBitlen=132 ifIndex=51 remoteAddress=224.0.0.0/4}: false
    LocalNetAccessKey{lpmBitlen=160 ifIndex=51 remoteAddress=255.255.255.255}: false
    LocalNetAccessKey{lpmBitlen=40 ifIndex=51 remoteAddress=ff00::/8}: false

On cuttlefish (15 is buried_eth0, 17 is wlan0):
  sLocalNetAccessMap (default is true meaning global):
    LocalNetAccessKey{lpmBitlen=144 ifIndex=15 remoteAddress=192.168.0.0/16}: false
    LocalNetAccessKey{lpmBitlen=132 ifIndex=15 remoteAddress=224.0.0.0/4}: false
    LocalNetAccessKey{lpmBitlen=160 ifIndex=15 remoteAddress=255.255.255.255}: false
    LocalNetAccessKey{lpmBitlen=40 ifIndex=15 remoteAddress=ff00::/8}: false
    LocalNetAccessKey{lpmBitlen=192 ifIndex=17 remoteAddress=192.168.99.1 protocol=6 remotePort=53}: true
    LocalNetAccessKey{lpmBitlen=192 ifIndex=17 remoteAddress=192.168.99.1 protocol=17 remotePort=53}: true
    LocalNetAccessKey{lpmBitlen=144 ifIndex=17 remoteAddress=192.168.0.0/16}: false
    LocalNetAccessKey{lpmBitlen=132 ifIndex=17 remoteAddress=224.0.0.0/4}: false
    LocalNetAccessKey{lpmBitlen=160 ifIndex=17 remoteAddress=255.255.255.255}: false
    LocalNetAccessKey{lpmBitlen=96 ifIndex=17 remoteAddress=fe80::/64}: false
    LocalNetAccessKey{lpmBitlen=40 ifIndex=17 remoteAddress=ff00::/8}: false

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

Maciej Żenczykowski   commited 2025-03-19 20:34:48 -07:00
969d82bc82
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
Adding access methods for local_net_access_map and
local_net_blocked_uid_map

Test: Manually tested this using dumpsys commands
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.BpfNetMapsTest
Bug: 392855578

Change-Id: I61522f3282aa502f20641d3c2692a66638edf706

Sarup Dalwani   authored and   Jacque Li   commited 2025-02-07 15:10:49 -05:00
448eb43f28
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
Merge "Export com.android.net.flags for wifi apex" into main
Quang Luong   authored and   Gerrit Code Review   commited 2024-12-18 18:56:14 -08:00
f3f4143fcf
Export com.android.net.flags for wifi apex
Bug: 216524590
Test: build
Change-Id: I74b71008b1d263adf07218a617f6c8bccb46cb67

Quang Anh Luong   commited 2024-12-19 09:54:16 +09:00
6d2bbcefd2
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
Add daily CertificateTransparencyJob
Following a conversation with the Experiments team (b/374692404), it
appears we will not be able to use device config flags to trigger the
download of CT log lists.

This CL is the first of a series that will allow us to move away from
flags and instead rely on a daily job execution. For scheduling we rely
on the Android AlarmManager.

I previously attempted to schedule the daily job using the Android
JobScheduler. However, those attempts were unsuccessful beacause the
Tethering apex is not on the system_server classpath, so the system
would crash when attempting to load the class to execute the job.

Flag: com.android.net.ct.flags.certificate_transparency_job
Bug: 374692404
Test: NetworkSecurityUnitTests
Change-Id: I6ce44dcea464cab20d2df73b065e35c0f76dcbab

Sandro Montanari   commited 2024-11-21 14:54:50 +00:00
70c4de8edc
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
[Thread] add private API for disabling border router
Bug: 374036806
Change-Id: Ib8ca8bbd2b3018c39c9250e1b3ce70b193273c1b

Kangping Dong   commited 2024-10-31 14:30:25 +08:00
56449db1be
[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