When "Block connections without VPN" is specified, incoming traffic
from non-VPN interfaces should be blocked regardless of the
determination made by ConnectivityService#getVpnIsolationInterface.
Outgoing traffic to non-VPN interfaces is already blocked in this case.
(Loopback is excluded as usual.)
Test: `adb shell dumpsys connectivity trafficcontroller` will now show
the tunnel interface for uids affected by lockdown when
getVpnIsolationInterface returns null (wildcard), to block non-VPN
ingress to such uids. This will return to 0 (wildcard) when lockdown
is toggled back off.
Also includes squashed change:
Author: Tommy Webb <tommy@calyxinstitute.org>
Date: Mon May 1 16:52:28 2023 -0400
fixup! Always drop non-VPN ingress in lockdown mode
For lockdown purposes, force an update of VPN filtering whenever the
interface names for a VPN have changed, to ensure that the BPF owner
map uses the most up-to-date interface for ingress filtering.
Issue: calyxos#1651
Change-Id: Ia0c75a723134023906134597b395653c7a570686
Co-authored-by: Tommy Webb <tommy@calyxinstitute.org>
Issue: calyxos#1255
Bug: 206482423
Change-Id: Id7954816566cb06bf2e9869ea98b20678835df9d
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCaS5huQAKCRDorT+BmrEO
eIsnAJ9kJ9OjiHpwigt9XwjTrGcbD1hQ0QCfSw2VHyS9TLyzt7DZsQ3AYU+WVVA=
=/SH/
-----END PGP SIGNATURE-----
gpgsig -----BEGIN SSH SIGNATURE-----
U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgPpdpjxPACTIhnlvYz0GM4BR7FJ
+rYv3jMbfxNKD3JvcAAAADZ2l0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5
AAAAQHUBff/oLA1TO7KbbZDsBJZmFVcXgFmG+2K3aaKq9F0tiaT1kiNeHdjXpaLI07p344
TExz9CBvFVft81pJyRBwY=
-----END SSH SIGNATURE-----
Merge tag 'android-16.0.0_r4' into staging/lineage-23.2_merge-android-16.0.0_r4
Android 16.0.0 release 4
# -----BEGIN PGP SIGNATURE-----
#
# iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCaS5huQAKCRDorT+BmrEO
# eIsnAJ9kJ9OjiHpwigt9XwjTrGcbD1hQ0QCfSw2VHyS9TLyzt7DZsQ3AYU+WVVA=
# =/SH/
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue Dec 2 05:49:13 2025 EET
# gpg: using DSA key 4340D13570EF945E83810964E8AD3F819AB10E78
# gpg: Good signature from "The Android Open Source Project <initial-contribution@android.com>" [ultimate]
# By Yan Yan (203) and others
# Via Automerger Merge Worker (1173) and others
* tag 'android-16.0.0_r4': (1057 commits)
Use string for CREATE_APP_SPECIFIC_NETWORK permission
bpf: move MSS calculation under CE check to avoid overhead
BpfNetworkStats: use `atomic` for ifindex cache when possible
NetBpfLoad: remove pointless 0 write.
bpf: remove obsolete isAtLeastR/Sv2/25Q3
NetBpfLoad: use global `api_level_full` directly in NetBpfLoad
Log validated underlying network count that's available for VCN underlying network selection
BpfUtils: fix sdk level detection logic for 25Q3+
Add RTMGRP_IPV6_IFINFO
bpf: remove BPFLOADER_MAINLINE_U_QPR3_VERSION
bpf: move BPFLOADER_MAINLINE_S_VERSION into bpf_map_def.h
Reduce log level for BluetoothSocket errors
Bump the min sdk of Tethering
BpfNetworkStats: apparently RiscV isn't actually a 64-bit architecture.
KernelUtils.h: isAtLeastKernelVersion(x,y,z) - default 'z' to 0
bpf_existence_test - update for tcp acc ecn
bpf: tcpAccECN: eliminate header file and move more fully into netd
BpfMap: shorten error strings to enable SSO (on 64-bit)
BpfNetworkStats: enforce that IfaceValue access is lock-free
NetBpfLoad: use libbpf based on mainline beta flag, part 2
...
Conflicts:
bpf/headers/include/bpf/KernelUtils.h
bpf/progs/netd.h
Change-Id: I76a7aadc1405c6621e17f3d1b6b87640d84f5794
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCaRO/HAAKCRDorT+BmrEO
eOs9AJ9Yzz2HpDR3pyRIXhvl4k7bNABGvgCeMg5sU16s0CkFIDbZmOsSo4fswZQ=
=1o5/
-----END PGP SIGNATURE-----
gpgsig -----BEGIN SSH SIGNATURE-----
U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgPpdpjxPACTIhnlvYz0GM4BR7FJ
+rYv3jMbfxNKD3JvcAAAADZ2l0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5
AAAAQIRFF5B6T8EGhzDN+1dhvomEkctFjdVr5DZnhgnEIvcCEuzO36RzY3DBG9AIL+EejJ
Z1zz7uAapzWUsyFpbYAQM=
-----END SSH SIGNATURE-----
Merge tag 'android-16.0.0_r3' into staging/lineage-23.0_merge-android-16.0.0_r3
Android 16.0.0 Release 3 (BP3A.250905.014)
# -----BEGIN PGP SIGNATURE-----
#
# iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCaRO/HAAKCRDorT+BmrEO
# eOs9AJ9Yzz2HpDR3pyRIXhvl4k7bNABGvgCeMg5sU16s0CkFIDbZmOsSo4fswZQ=
# =1o5/
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed Nov 12 00:56:28 2025 EET
# gpg: using DSA key 4340D13570EF945E83810964E8AD3F819AB10E78
# gpg: Good signature from "The Android Open Source Project <initial-contribution@android.com>" [ultimate]
# By Patrick Rohr (91) and others
# Via Android (Google) Code Review (233) and others
* tag 'android-16.0.0_r3': (377 commits)
Fix netbpfload version info.
NetBpfLoad: add self-check for bpfGetNext{Prog,Map}Id()
Add NetworkTemplate get/set transport type methods
Pass EthernetPort to EthernetNetworkFactory#updateInterfaceLinkState
Pass EthernetPort to updateInterfaceState
Remove spurious VisibleForTesting and change visibility to public
Pass EthernetPort to EthernetNetworkFactory#removeInterface
Pass EthernetPort to removeInterface
Pass EthernetPort to stopTrackingInterface
Add getEthernetPorts and use it in getAllInterfaces
Rename getClientModeInterfaces to getClientModeInterfacesSorted
Rename getAvailableInterfaces to getInterfacesSorted
Pass EthernetPort into NetworkInterfaceState
Pass EthernetPort into EthernetNetworkFactory#addInterface
Use multicast socket for group membership
Test refactoring of DefaultNetworkRematchMetrics
Fix SatisfiedTime initialization
DHCPv6 addr reg: parse IA Address option.
Pass EthernetPort to addInterface
Change tethering interface to EthernetPort
...
Conflicts:
bpf/progs/netd.c
service/src/com/android/server/ConnectivityService.java
staticlibs/testutils/host/python/apf_test_base.py
tests/cts/multidevices/apfv4_test.py
tests/cts/multidevices/apfv6_test.py
tests/cts/multidevices/run_tests.py
tests/unit/java/com/android/server/connectivityservice/CSNetworkAgentTest.kt
Change-Id: Ifedf92aee90cbcc55ef8f9652de8b5faff1c30d9
This allows using the permission in 25Q4 before it becomes a
public API in 26Q2.
Flag: android.net.platform.flags.create_app_specific_network_permission
Test: TH
Bug: 435313135
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:60f7743f773b05a98e651c953631e93957291bf5
Merged-In: I8d336a588eddf9a027079e208b2b96bb6c163e86
Change-Id: I8d336a588eddf9a027079e208b2b96bb6c163e86
Motomu Utsumiauthored and Android Build Coastguard Workercommited 2025-09-30 03:56:13 -07:00
This exception is also logged when the other side disconnects gracefully
(because there is no way to distinguish this case using the Bluetooth
APIs). This change reduces the log level to a warning because it is
almost always a red herring.
Test: TH
Flag: NONE yes
Change-Id: I94f20be91ff8481fdd1a50fbbc27200c57885426
This commit replace the existing usage of NetworkSpecifier#redact() to
the new NetworkSpecifier#redact(RedactionType) API.
This doesn't change the existing behavior because redact() is still
called for NetworkSpecifiers which doesn't oevrride
getApplicableRedactions() method.
Bug: 374037595
Flag: NONE can't use simply flag guarding because the code needs to
maintain compatibility across different mainline and platform versions
Change-Id: I30d7257b8e5880218b315ade60d2d77fed1f89fb
This commit has almost no behavior changes, because:
1. usage of networkCapabilitiesRestrictedForCallerPermissions is
either wrapped by
createWithLocationInfoSanitizedIfNecessaryWhenParceled or
getNetworkCapabilitiesInternal.
2. All usages of getNetworkCapabilitiesInternal is either wrapped by
createWithLocationInfoSanitizedIfNecessaryWhenParceled or the
redacted info in the return value is not used by its caller
3. The only exception for getNetworkCapabilitiesInternal is that it is
used in simulateDataStall() which checks the underlying network but
underlying network in the NetworkCapabilities can be redacted by
networkCapabilitiesRestrictedForCallerPermissions. Removing redaction
from getNetworkCapabilitiesInternal() will loose the current permission
requirement but this is wanted as the existing implementation has
stricter permission requirements than the API signature declares and
this CL fixes it
Bug: 374037595
Flag: NONE no behavior change but only bug fix
Change-Id: I80491d26ed7d11cb3fe1850ef7be9ae7600d5dd5
This commit adds permission check for new NetworkSpecifier subclasses
which override the new redact(long) method. It throws SecurityException
if the caller doesn't hold the permissions to use the sensitive info in
the NetworkSpecifier class.
Bug: 374037595
Flag: NONE can't use simply flag guarding because the code needs to
maintain compatibility across different mainline and platform versions
Change-Id: Ife8efab3e99adf41d7522fedbde3b4ec80045c77
Implements logic to allow CCT to bypass VPN on Android U (API 34) and
older. On these Android versions, netd's VPN bypass APIs
(networkSetProtectAllow/Deny) operate globally.
Test: TH
Flag: NONE legacy flag protected
Change-Id: I3650c3823d65504046d74cd60485d9cc890937d8
This commit addresses an issue where the VPN bypass feature was not
functioning correctly. The VPN filter has been updated to properly
handle bypass rules, ensuring that designated traffic can now bypass the
VPN as intended.
Test: TH, manual
Flag: EXEMPT guarded by default-off legacy flag
Change-Id: Ie6073db4e23a3132042da21c25b696fa3abc4c91
Lorenzo Colittiauthored and Yuyang Huangcommited 2025-09-11 11:50:05 +09:00
This change simplifies the code by calling `SdkUtil.isAtLeast25Q4()`
instead of having redundant check in
ConnectivityService.Dependencies#isAtLeast25Q4.
Test: Existing tests pass.
Bug: 443099706
Flag: EXEMPT PURE_REFACTOR
Change-Id: I2c581e24982f8f0df0cb023e2e3e4f37015d2f4a
This is used for redacting sensitive Thread info in
ThreadNetworkSpecifier (to be added in ag/34224158)
Bug: 374037595
Flag: EXEMPT new code is not used
Change-Id: I606d59fc5259c79bddaa51ca0c270684dd3b674a
In most places the `@hide` doctag is treated as a block tag on its own
line. However, there are a few places where it is treated as an inline
doctag, e,g. `{@hide}`, and some places where it looks like a block
tag but is inline in the text, e.g. `Some text. @hide`. Dealing with
all the types increases the complexity of Metalava and makes it
slightly slower.
This change replaces the non-block tag forms with a block tag.
Flag: EXEMPT change the form of @hide does not change the API or behavior
Bug: 429965593
Test: m checkapi
Change-Id: I4ffe44a329dbcb7f0a7bd61af16c3bd99cacdac4
ConnectivityService would be centralized location for deciding local
network so for this effort passing isLocalRoute parameter to
routecontroller in netd for route addition, removal and modification.
Bug: 394308861
Test: Manually tested.
Test: atest ConnectivityCoverageTests
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivityservice.CSLocalRouteTest
Test: atest netd_integration_test
Flag: EXEMPT Using device config kill-switch
Change-Id: I9f11882665375bba10fa369c2e25f374b5e63661
This is not safe to do in system server because it affects all
system server callers of NetworkStatsManager, including ones
that frequently call into NetworkStatsService, such as
NetworkPolicyManagerService.
Also, setPollOnOpen is unnecessary because data usage is only collected when processing the `onLost` callback, which is triggered after ConnectivityService forces a poll.
Fix: 427909947
Flag: EXEMPT BUGFIX
Test: covered by existing tests
Change-Id: I2fb25f4529d46dfc14b00b0aa69c5145317ca9dd
Lorenzo Colitticommited 2025-08-26 03:05:26 -07:00
When "Block connections without VPN" is specified, incoming traffic
from non-VPN interfaces should be blocked regardless of the
determination made by ConnectivityService#getVpnIsolationInterface.
Outgoing traffic to non-VPN interfaces is already blocked in this case.
(Loopback is excluded as usual.)
Test: `adb shell dumpsys connectivity trafficcontroller` will now show
the tunnel interface for uids affected by lockdown when
getVpnIsolationInterface returns null (wildcard), to block non-VPN
ingress to such uids. This will return to 0 (wildcard) when lockdown
is toggled back off.
Also includes squashed change:
Author: Tommy Webb <tommy@calyxinstitute.org>
Date: Mon May 1 16:52:28 2023 -0400
fixup! Always drop non-VPN ingress in lockdown mode
For lockdown purposes, force an update of VPN filtering whenever the
interface names for a VPN have changed, to ensure that the BPF owner
map uses the most up-to-date interface for ingress filtering.
Issue: calyxos#1651
Change-Id: Ia0c75a723134023906134597b395653c7a570686
Co-authored-by: Tommy Webb <tommy@calyxinstitute.org>
Issue: calyxos#1255
Bug: 206482423
Change-Id: Id7954816566cb06bf2e9869ea98b20678835df9d
Oliver Scottauthored and Thomas Turnercommited 2025-08-25 10:45:17 +01:00
Using policies provided by NetworkPolicyManagerService (fw/b), allow
or disallow an app to access a network based on network transport
type, e.g. Wi-Fi or Cellular.
Needs corresponding fw/b and netd changes.
All networks are treated as being restricted, and only UIDs whose
policy allows them on a transport are able to route outgoing traffic
over a network of that type. In addition, to prevent incoming traffic
to UIDs that are not allowed on the active network, and to handle UIDs
that have a policy which prevents them from accessing VPNs, UIDs that
are not allowed to access their active network are added to a denylist
that prevents them from accessing networks in general. Networks which
are truly restricted, however, such as for IMS, are left unchanged.
Also includes squashed changes:
Author: Tommy Webb <tommy@calyxinstitute.org>
Date: Thu Apr 27 15:51:18 2023 -0400
fixup! Set allowed UIDs for networks based on policies
Revert to prior network permission behavior here, and make necessary
changes in netd instead. This improves clarity and allows UIDs to
take advantage of default network rules which would otherwise
require system-level permission, prior to this change.
Related: Icd64aa530e8d202abb97d8325160a5d4c0b4c490
Change-Id: If5493deb96f88fe3ff5fc8a6a0c6d6d9bc77eff4
Author: Tommy Webb <tommy@calyxinstitute.org>
Date: Wed Mar 22 09:05:18 2023 -0400
Expose new isUidCurrentlyDisallowedByPolicy
Allows determining if a UID is blocked based on its transports.
Change-Id: I2729b61c349ec2812a74d7d1c04b90a58b0f5b88
Author: Tommy Webb <tommy@calyxinstitute.org>
Date: Wed Sep 20 15:19:45 2023 -0400
Use framework listener for allowed transports
When allowed transports change, instead of exposing an API from
Connectivity that the framework calls, add a new method to the
framework's NetworkPolicyCallback that we override.
This change benefits the prebuilt mainline module, preventing
the need to fight with the platform to add new module APIs.
Requires fw/b change of the same Change-Id.
Change-Id: Ie476f23684b00397197184e965201d6823b28de2
Author: Tommy Webb <tommy@calyxinstitute.org>
Date: Wed Sep 20 16:10:36 2023 -0400
Notify the framework about denylist changes
When the denylist changes, instead of exposing an API from
Connectivity that the framework calls, add a new method to the
framework's NetworkPolicyManager that we call to inform it of
this directly.
This change benefits the prebuilt mainline module, preventing
the need to fight with the platform to add new module APIs.
Requires fw/b change of the same Change-Id.
Change-Id: I3c3593f110753a3ce02af3739f600190f22e9663
Author: Tommy Webb <tommy@calyxinstitute.org>
Date: Fri Dec 6 08:10:27 2024 -0500
fixup! Firewall: Transport-based toggle support (3/3)
Use a dedicated callback for allowed transports, in preparation for the
removal of NetworkPolicyCallback.
Change-Id: I9e00948bdc06e3a1beb14b5b9b9ab3eb15b9a528
Change-Id: I79342edbec92090cca20853ba50ea7fd48ec81c2
Tommy Webbauthored and Thomas Turnercommited 2025-08-25 10:44:30 +01:00
The ENABLE_MATCH_NON_THREAD_LOCAL_NETWORKS compatibility flag is
now enabled for apps targeting SDK 37 or higher.
Previously, this flag was configured to enable for
Baklava (SDK 36) or higher. This is no-op because
there is no tethering network agent presents.
While the tethering network agents planned to be enabled in
25Q4, this adjustment allows developers sufficient time
to adapt to the behavior change where NetworkRequests
will match non-Thread local networks.
Flag: com.android.tethering.mainline.beta.tethering_and_p2p_go_local_agent
Test: atest ConnectivityCoverageTests --update-device \
--test-filter '.*Connectivity.*'
Bug: 420590461
Change-Id: I105ee1d677c6beb12b4dccd109c01ef5ff2717d3
If an app registers a network agent and doesn't have NETWORK_FACTORY or
PERMISSION_MAINLINE_NETWORK_STACK, but does have
CREATE_APP_SPECIFIC_NETWORK, ConnectivityService will:
- Allow it to create a network
- Force the capabilities to contain only the app's UID
- Force the network to be restricted
- Ignore attempts to change the UID or make the network non-restricted
Test: TH
Flag: android.net.platform.flags.create_app_specific_network_permission
Bug: 435313135
Change-Id: I5a9517515e64f799c88aca4a51636b1a08e15817
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
The mobile data preferred feature stores the list of UIDs in
Settings.Secure, which is per-user. But the code only sets, reads
and observes the setting for the current user instead of for all
users. This does not work on HSUM or automotive.
Fix this as follows:
- Register the ContentObserver on UserHandle.ALL
- Any time the observer fires, read the setting on all current
users, and operate on the merged result.
- Ensure that the code gets called on ACTION_USER_ADDED and
ACTION_USER_REMOVED.
Because the code now aggregates the setting for all UIDs, it
should just work on single-user devices. It should also work if
there are OEM devices that store all UIDs (for all users) in
Settings.Secure for user 0.
Because the bug is fixed, re-enable the test on automotive.
Also fix style nits.
Fix: 404186833
Flag: EXEMPT bug fix
Test: covered by existing CTS tests
Change-Id: I69ad789f1c7c7f3bab04ab8789dfb93ee0de553d
Lorenzo Colitticommited 2025-08-08 15:36:55 +09:00
ConnectivityService uses SettingsObservers to detect when
settings change. These are all set on user zero. This is fine
for most settings, which are in Settings.Global, but some
settings are per-user, such as MOBILE_DATA_PREFERRED_UIDS, which
is in Settings.Secure.
This CL adds the ability to register SettingsObservers on all
users. These observers will fire any time the setting changes
for any current user, and any time a user is added or removed.
This CL does not add or change any SettingsObservers and should
cause no behaviour changes.
Bug: 404186833
Flag: EXEMPT refactor
Test: covered by existing tests
Change-Id: I5954b196eea776414098f1ce4441eb02065438ef
Lorenzo Colitticommited 2025-08-08 15:36:54 +09:00
(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 Żenczykowskicommited 2025-08-07 15:52:35 -07:00
AServiceManager_waitForService sytem APIs currently only callable
via dlsym(): b/376759605. When built with sdk_version current,
the NDK stubs for "sdk" variants only include NDK APIs,
excluding #systemapi APIs.
Flag: EXEMPT Mechanical refactors
Test: atest ServiceManagerWrapperIntegrationTest
Change-Id: I48f690d771c7905e79e463617ded772f753cc854
Mark Chienauthored and Patrick Rohrcommited 2025-08-06 10:44:39 -07:00
RoutingCoordinatorService's {add,remove,update}Route methods
all end up calling netd's *RouteParcel methods.
Make callers explicitly generate and pass in the parcel to the
manager class instead of having them pass in a RouteInfo and
having the service class convert the RouteInfo to a parcel.
Also remove the {add,remove,update}Route methods from
RoutingCoordinatorManager since they are unused.
This is a no-op refactor that simplifies upcoming changes.
RoutingCoordinator is not a stable interface and is not used
across the platform/mainline boundary, so there are no version
skew considerations.
Bug: 394308861
Test: atest ConnectivityCoverageTests
Flag: EXEMPT no-op refactor
Change-Id: Iedf4c9bc28c3fc8c289db421857acddc8c694990
Lorenzo Colitticommited 2025-08-06 15:57:36 +09:00
Currently, NET_CAPABILITY_NOT_VCN_MANAGED is implicited added for
NetworkRequest built by normal apps.
However, the tethering network agent doesn't have this capability,
which makes the agent being exposed to VcnManager and cannot be
seen by normal apps.
Add NET_CAPABILITY_NOT_VCN_MANAGED to tethering NetworkAgent. Include
NET_CAPABILITY_NOT_VCN_MANAGED in local network capabilities for
metrics and API utilities to ensure correct evaluation of local
network connectivity. Update unit tests to reflect the new capability.
Flag: EXEMPT bug fix
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.CSSatisfiedByLocalNetworkMetricsTest \
ConnectivityCoverageTests:android.net.connectivity.com.android.metrics.SatisfiedByLocalNetworkMetricsTest \
--update-device
Test: manual generate request by CTS and statsd_testdrive -e 10247
Bug: 428098173
Change-Id: Ifa9ce0827abd22d887a0e8a2ab6f4d7391b2b8ed
as we always pass in all of them in a well defined order
Test: TreeHugger, manually
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I93c4a9883983645cbe7d11101aa749dc2faf9d6d
Maciej Żenczykowskicommited 2025-08-05 12:15:03 -07:00
Because FakeSettingsProvider and other test infrastructure did
not support settings observers, the tests called internal
ConnectivityService methods to cause the settings to be re-read.
Now that FakeSettingsProvider supports callbacks, use
ContentResolverWithFakeSettingsProvider in the CS tests and just
use the callbacks.
Bug: 397521796
Flag: TEST_ONLY
Test: test-only change
Change-Id: I26d8e98706fec99aa423721bf1474af2f9b60099
Lorenzo Colitticommited 2025-08-05 18:02:02 +09:00
The MultinetworkPolicyTracker now conditionally sets the
`notifyForDescendants` parameter when registering a ContentObserver
for settings URIs.
If `mAvoidBadWifiSource` is `FROM_CARRIER_CONFIG`, `notifyForDescendants`
remains `true`. Otherwise, it is set to `false`. This refinement
aligns observer behavior with the source of the avoid bad Wi-Fi policy.
Flag: EXEMPT mainline
Bug: 435533360
Test: TH
Change-Id: If963d541f168944dd227998f4f4a62c4f203876b
This CL adds an ART profile to the Connectivity service. The profile was
generated by profiling the Connectivity service on Droidfood population.
The ART profile is expected to reduce the size of the Connectivity
service generated code size by 3.9MB!
Background: A profile is a list of classes and methods that are
frequently used, which ART uses to compile parts of the code ahead of
time, and the rest of the code can be interpreted and Jitted on the fly
if needed, this improves app-startup, memory and disk space
significantly!
For system server modules (like Connectivity), the current behavoir is
to Speed compile (compile everything), which for sure compiles
unnecessary code. By moving the speed-profile mode we are saving around
3.9MB of disk space which also decreases the load on memory!
The new behavior is guarded by a new build feature
`RELEASE_ART_COMPILE_CONNECTIVITY_SERVICE_SPEED_PROFILE`
Bug: 241823638
Flag: build.RELEASE_ART_COMPILE_CONNECTIVITY_SERVICE_SPEED_PROFILE
Test: `m`
Test: with flag on: go/art-benchmark?p=BootImageProfileId:54912&f=CandidateName:in:54914 (code size reduction by -3.9MB)
Test: with flag off: go/art-benchmark?p=BootImageProfileId:54912&f=CandidateName:in:54913 (no code change or metric changes)
Change-Id: I5d44eaaa77c5241403d6e75b05d28d6256b6df68