Commit graph android_packages_modules_Co.../framework/Android.bp
Message SHA1
Prepare to move VCN: Add visibilities for tests
Before moving VCN code, add the new code locations to the
"visibility" fields of Connectivity dependencies.

Bug: 379938062
Flag: EXEMPT; visibility changes
Test: presubmit
Change-Id: I51becaacb93d5e43b8b8234b80cb9b272181ad01

Yan Yan   commited 2025-07-10 20:47:00 +00:00
e82942e7c5
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
Remove -stubs-including-flagged
These were added to allow tests to build against flagged off APIs, in
legacy downstream branches that did not support the flagging
infrastructure and stripped out flagged off APIs from the stubs.

Flagged off APIs are part of the regular stubs in branches used today,
so this is not needed anymore.

Bug: 399365344
Test: atest
Change-Id: Ica7df0c5c9be39d9dca49e0114711a7c43125c3d

Remi NGUYEN VAN   authored and   Paul Duffin   commited 2025-02-28 10:47:40 +00:00
df5441508e
Revert https://r.android.com/3477936
The CL has caused a memory regression in the Zygote, See: b/396156852

Test: Compile
Bug: 396156852
Change-Id: I0ca4cd430a6537d689a1b04739656afc84c43ce1

Mohannad Farrag   commited 2025-02-18 18:32:23 +00:00
e0b119773c
Add metric to HttpEngine preload
See the other CLs in the same topic for the details.

Test: See other CL
Bug: 380349437
Change-Id: I4b936e3d834462bba5a368d6dd1a1e262c17f0c9

Mohannad Farrag   commited 2025-02-06 15:27:57 +00:00
b09cd9e50c
Merge "CaptivePortal: implement setDelegateUid API." into main
Xiao Ma   authored and   Gerrit Code Review   commited 2024-12-11 22:43:58 -08:00
69aa3c5469
CaptivePortal: implement setDelegateUid API.
This API is designed to set the UID of the app that is allowed to
perform network traffic for captive protal login, communication will
bypass network access restrictions such as VPNs and private DNS settings
when a portal page is launched by Android Custom Tabs and bind the
upcoming traffic to that portal network.

Bug: 373773542
Test: atest ConnectivityCoverageTests
Change-Id: I9992671634b8e88f5a647455811a6157fb15a44b

Patrick Rohr   authored and   Xiao Ma   commited 2024-12-11 20:27:10 +09:00
7d6dfd52b2
Conditionally include VCN in Tethering module
When the build system flag RELEASE_MOVE_VCN_TO_MAINLINE is true,
VCN framework lib will be included in the tethering boot classpath
fragment and the VCN service lib will be included in the
service-connectivity.jar

Bug: 375213246
Test: flag enabled: VCN libs are in the tethering module
      flag disabled: VCN libs are in the platform
Flag: RELEASE_MOVE_VCN_TO_MAINLINE
Change-Id: If0239eb1684b861b63794762915dab0d62379885

Yan Yan   commited 2024-12-09 12:04:12 -08:00
b4ccc6aff7
Merge "Add a new module-only API to preload HttpEngine" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-11-29 05:10:06 +00:00
c3a2764012
Merge "Expose Connectivity libraries to VCN and tests" into main
Yan Yan   authored and   Gerrit Code Review   commited 2024-11-27 00:34:33 +00:00
e0e0636fa9
Sort framework-connectivity-defaults libs alphabetically
Test: TH
Change-Id: I1ed2c8a023b79d044c82e5a0b52a96d0a535b996

Yuyang Huang   commited 2024-11-25 12:31:48 +09:00
ee0a07cfd9
Expose Connectivity libraries to VCN and tests
This patch exposes Connectivity libraries to allow migrating VCN to
its own non-updatable framework and service libraries. It also
creates a utility library for VCN.

Bug: 369703242
Test: atest FrameworksVcnTests && atest CtsVcnTestCases
Flag: EXEMPT no functional change
Change-Id: I1981f1cc824dcf426a76a0af8e4e3460fccb754e

Yan Yan   commited 2024-11-23 23:07:44 -08:00
587f996eb4
Add a new module-only API to preload HttpEngine
This is supposed to be used only from the Zygote during the
initialization phase to preload HttpEngine. Currently, the
implementation only preloads a single class which is used to initialize
the backend for HttpEngine.

Bug: 380349437
Change-Id: If3ebcb37e51104a69473491e9f230d1b043c7bd0

Mohannad Farrag   commited 2024-11-22 10:50:11 +00:00
5023143dcf
Add FrameworkConnectivityStatsLog for logging metrics
Introduced FrameworkConnectivityStatsLog within the
framework-connectivity module. This enables logging of metrics, such as
terrible error events, from components residing in the bootclasspath.

Test: manual
Change-Id: I478d957b06721b35135a45dbbcda72a2c3e9f9ce

Yuyang Huang   commited 2024-11-21 11:51:58 +00:00
1cc7769bbe
Merge "Make java_sdk_library dependencies explicit" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-10 19:12:45 +00:00
430a8ad33c
Make java_sdk_library dependencies explicit
modules should specify the submodule of java_sdk_library that the module
actually depends on

Test: CI
Bug: 358613520
Change-Id: I0367068c901df98483f6cf95160d3e7801881b0a

Jihoon Kang   commited 2024-09-10 00:01:31 +00:00
8401b6a9f0
Add NetworkStack to framework-connetivity and framework-tethering impl lib visibility
As NetworkStackApi*Shims modules defined in
packages/modules/NetworkStack depends on the impl libs of
framework-connectivity and framework-tethering

Test: m nothing
Bug: 358613520
Change-Id: I5c90d4ae6eeb51f42f1ae1c88dd726bfdcd093e8

Jihoon Kang   commited 2024-09-09 22:55:01 +00:00
e7cae17b3a
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
Add framework-connectivity-pre-jarjar-without-cronet
This is required to build cronet against ConnectivityManager hidden APIs
Since framework-connectivity contains cronet, cronet target can not
depend on framework-connectivity.
So this CL splits framework-connectivity-pre-jarjar.
Cronet target can depend on
framework-connectivity-pre-jarjar-without-cronet and use
ConnectivityManager hidden APIs.

Test: TH
Bug: 311792075
Change-Id: Ib7724e8e6bd0226b437ed6f0010658d45aaa1150

Motomu Utsumi   commited 2024-07-24 17:01:51 +09:00
4d25564865
Refactor RoutingCoordinator
- This CL puts RoutingCoordinator into staticlibs to make it usable by
both Tethering and ConnectivityService on R.
- This CL also changes the return type of
  ConnectivityInternalApi#getRoutingCoordinatorManager() to IBinder so
  it has fewer dependencies.

Bug: 350699020
Test: CI

Change-Id: Iba096e940795cd33e61c5141721394ad39e5ce6d

Handa Wang   commited 2024-07-05 05:26:54 +00:00
8f2c30664d
Refactor staticlibs
This CL introduces net-utils-framework-connectivity, net-utils-tethering
and net-utils-service-connectivity as staticlibs.

- net-utils-framework-connectivity will be used by
  framework-connectivity-pre-jarjar.
- net-utils-service-connectivity and net-utils-tethering are the
  static liraries used by service-connectivity-pre-jarjar and Tethering
  respectively.

Bug: 350699020
Test: CI

Change-Id: I4dbb2b0de905a576cfcf24d2d5d1f1a261d2bd68

Handa Wang   commited 2024-07-05 05:26:46 +00:00
9b0df36ea4
Reland cronet 121_0_6167_71: remove http_client_logging lib
Revert submission 3031237-revert_v3

Reason for revert: Fixed in aosp/3033496

Reverted changes: /q/submissionid:3031237-revert_v3

Change-Id: Ib811ad68c19825c238a60fe4a2e8e8a73b631ff1

Chidera Olibie   commited 2024-04-15 11:29:55 +00:00
32ec9e0235
Merge "Revert^2 "Revert "Revert "Revert "cronet 121_0_6167_71: remove htt..."" into main
Chidera Olibie   authored and   Gerrit Code Review   commited 2024-04-09 18:24:33 +00:00
a7c3b506d7
Revert^2 "Revert "Revert "Revert "cronet 121_0_6167_71: remove htt..."
This reverts commit 1ba19c9c67.

Reason for revert: broke native coverage b/333108088

Change-Id: I6a6a9ca3a82ceb8109beea66fcc95c8d8e4a0620

Chidera Olibie   authored and   Gerrit Code Review   commited 2024-04-09 14:53:21 +00:00
2a85b5e7da
Merge changes from topic "revert-3005178-revert-3001326-revert-2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX-ICXECJPUPA-OOMALUYYUV-HXQZEVTNSQ" into main
* changes:
  Revert "Revert "Revert "Revert "cronet 121_0_6167_71: remove htt..."
  Revert "Revert "Revert "Revert "[Cronet] Disable one of setURLSt..."

Chidera Olibie   authored and   Gerrit Code Review   commited 2024-04-03 08:53:08 +00:00
22cc321820
Revert "Revert "Revert "Revert "cronet 121_0_6167_71: remove htt..."
Revert submission 3005178-revert-3001326-revert-2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX-ICXECJPUPA-OOMALUYYUV

Reason for revert: aosp/3022283 fixed coverage issue

Reverted changes: /q/submissionid:3005178-revert-3001326-revert-2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX-ICXECJPUPA-OOMALUYYUV

Change-Id: I1fdfdec2199eaf94766b93401a8e781a8cfec571

Chidera Olibie   commited 2024-04-02 12:07:04 +00:00
1ba19c9c67
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
Revert "Revert "Revert "cronet 121_0_6167_71: remove http_client..."
Revert submission 3001326-revert-2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX-ICXECJPUPA

Reason for revert: Build breakage as b/330450460

Reverted changes: /q/submissionid:3001326-revert-2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX-ICXECJPUPA

Change-Id: I56e53cf907c9d24c90b588e97ef8a101fd5aa19c

Lisa (LeeWei) Liu   authored and   Gerrit Code Review   commited 2024-03-20 08:30:25 +00:00
e450572718
Revert "Revert "cronet 121_0_6167_71: remove http_client_logging..."
Revert submission 2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX

Reason for revert: aosp/3003361 fixed failing test. See b/329605950.

Reverted changes: /q/submissionid:2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX

Bug: b/327182569
Test: atest NetHttpCoverageTests
Change-Id: I45a2b032d3aaf636acc11af9a37c452a02533f37

Chidera Olibie   commited 2024-03-18 13:50:05 +00:00
cfc6b02ee6
Merge changes from topic "revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX" into main
* changes:
  Revert "cronet 121_0_6167_71: remove http_client_logging lib"
  Revert "[Cronet] Disable one of setURLStreamHandlerFactory test"

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-03-13 18:23:14 +00:00
d49669622b
Revert "cronet 121_0_6167_71: remove http_client_logging lib"
Revert submission 2980591-cronet_121_0_6167_71

Reason for revert: Seems to be the cause for b/328855816

Reverted changes: /q/submissionid:2980591-cronet_121_0_6167_71

Change-Id: I8baddfcbc1926acf9d58130b2032b5acd921e4fa

Patrick Rohr   commited 2024-03-11 19:07:03 +00:00
dae7f8c4dc
Merge changes from topic "cronet_121_0_6167_71" into main
* changes:
  [Cronet] Disable one of setURLStreamHandlerFactory test
  cronet 121_0_6167_71: remove http_client_logging lib

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-03-08 10:08:20 +00:00
14d2e19e47
Merge "Remove unused library visibility" into main
Chiachang Wang   authored and   Gerrit Code Review   commited 2024-03-04 02:43:27 +00:00
2154e525b3
Merge "Move VpnManagerServiceTest and VpnTest to frameworks" into main
Chiachang Wang   authored and   Gerrit Code Review   commited 2024-03-01 00:58:31 +00:00
0df28d82be
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
Move VpnManagerServiceTest and VpnTest to frameworks
These unit tests are closely tied to the source code in
frameworks/base and were incorrectly placed in the connectivity
module. Also update the libraries visibility that are used by
the tests.

Test: atest FrameworksNetTests
Change-Id: I196c33a8bd5b5cdb9d42aea381e900681ff6d25e

Chiachang Wang   commited 2024-02-29 07:48:02 +00:00
a5d9875823
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
cronet 121_0_6167_71: remove http_client_logging lib
Cronet telemetry has been implemented in a more centralised version
in chromium and is not a different target anymore.
See b/311369704 for more details.

Test: atest NetHttpTests
Bug: b/322154153
Change-Id: I6d9a13b1ffc25b51ca0d2cbadd86b40b399f89ac

Chidera Olibie   commited 2024-02-28 10:20:08 +00:00
09f0d47b06
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
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 "Remove strict_updatability_linting: true" into main
Cole Faust   authored and   Gerrit Code Review   commited 2024-02-02 18:21:10 +00:00
1042c175a0
[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
Remove strict_updatability_linting: true
strict_updatability_linting has been disabled for a while now, due to
an expansion in scope of the NewApi check. We're going to re-enable
it now, but doing so requires removing it from all modules that have
baselined NewApi issues.

Bug: 320698986
Test: Presubmits
Change-Id: Id6c9202c236f33ad89615e4d5fa5a6364147841a
Merged-In: Id6c9202c236f33ad89615e4d5fa5a6364147841a

Cole Faust   commited 2024-01-25 09:38:25 -08:00
ee56c432e0
Baseline NewApi issues
NewApi is a lint check that you don't call framework methods that were
introduced in versions later than your min_sdk_version. We want to
make this an error, so we're baselineing all existing issues.

This cl was generated automatically, by taking all the NewApi issues
from the reference baselines, and all the non-NewApi issues from the
existing checked in baselines.

Bug: 268261262
Test: Presubmits
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4ecdedda379e4e9040eb87b01dc3d8efb89be810)
Merged-In: I0393f24f101876abc458ca139eefdb279dcb2b03
Change-Id: I0393f24f101876abc458ca139eefdb279dcb2b03

Cole Faust   authored and   Android Build Cherrypicker Worker   commited 2024-01-25 02:41:58 +00:00
be30b3e96e
Support multicast routing
Added support to apply multicast routing config between network
interfaces in MulticastRoutingCoordinatorService.

Bug: 281217735

Test: atest FrameworksNetTests:android.net.connectivity.com.android.server.connectivity.MulticastRoutingCoordinatorServiceTest

Change-Id: If608b79d4e62a20d2e01755a83a901f6e274d9a2

Yang Sun   commited 2024-01-20 21:32:11 +08:00
baa50fa478
implement Thread Border Router e2e integration test
This implements a basic border routing test case (ping) and demonstrates a
valid test environment for Thread Border Router test cases.

Later we can add more packet verifications and more test cases.

Bug: 295843010
Test: atest android.net.ThreadBorderRouterTest

Change-Id: Ifb9b6d45539143a227c2bc0ed69b5c3167ef9acd

Handa Wang   commited 2023-12-26 15:24:54 +08:00
806f5a1bec
List baseline_filename on modules that are implititly using it
lintable modules currently pick up files named "lint-baseline.xml" to use as the
lint baseline implicitly. This is confusing because you could end up using the
baseline files in more modules than intended. Lint also has a feature where it
requests you remove unnecessary findings from the baseline file, so something
could be necessary for one module, but unnecessary for another that accidentally
picked up the baseline.

We're removing the implicit detection of the baseline file, which requires
all modules using it to list the baseline file explicitly.

Bug: 272769514
Test: Presubmits
Change-Id: If873a4ea20d73bb6268d83589c4fb3ebe54af664

Cole Faust   commited 2023-12-20 11:57:07 -08:00
a52ecf0c5c
Merge "Remove workaround to remove FlaggedAPI in ump" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2023-12-06 01:17:43 +00:00
dc7a325a55
Remove workaround to remove FlaggedAPI in ump
Test: TH
Change-Id: Icd3c87a7da9b45e5341a1a2ead68f0a9809591bb

Motomu Utsumi   commited 2023-12-04 08:59:43 +00:00
88410c6fd6