The SparseArray.indexOfValue() uses == to compare values,
MulticastRoutingCoordinator uses SparseArray with String type values,
and the indexOfValue function would sometimes return -1 when looking for
a value in the SparseArray.
Added a helper function getIndexForValue in CollectionUtils to get index
by comparing values with equals, and used this function in MulticastRoutingCoordinator.
Updated
MulticastRoutingCoordinatorServiceTest#testMulticastRouting_applyConfigNone_removesMfc
test case to use copies of interface names when updating the multicast
configs, so the test would fail without this fix.
Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.CollectionUtilsTest#testGetIndexForValue
atest android.net.connectivity.com.android.server.connectivity.MulticastRoutingCoordinatorServiceTest#testMulticastRouting_applyConfigNone_removesMfc
Change-Id: I862242d6be01b8552cdd6af6c9691948a9f0bfe0
The BACKGROUND firewall chain has been recently added. We want to
be able to turn it off in case of contingencies with a device-config
flag flip.
The flag is assumed to be boot-stable and its value is read at boot.
When the flag is off, we ignore any operation on this firewall chain.
Additionally, this chain is always considered disabled on versions
upto UPSIDE_DOWN_CAKE.
Note: All firewall chains are in disabled state at boot by default.
Test: atest FrameworksNetTests
Test: Manually, using adb shell device_config commands.
Bug: 331484830
Change-Id: I9ccc483e02e27a584da6714931466a9f2ec95ca9
- Handle onRoleHoldersChanged is not triggered even if the user has a
default app setup and gets deleted scenario.
- Adding ACTION_USER_REMOVED intent filter, to monitor for User
removal. This to used to update satellite fallback uid list
and to keep allowed uid range updated at multi layer request
of track default and satellite transport with Internet
restricted capability
Bug: 326373613
Test: atest FrameworksNetTests
Change-Id: I1f30cd129309486bccbc61802ed600c142077411
* 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
StatsLog.write() methods are being annotated with @RequiresApi annotations as
appropriate. The usage here is already guarded but the guarding happens
upstream so NewApi lint still complains. Adding RequiresApi annotation
upstream close to where the sdk version check occurs fixes the
complaint.
Bug: 328120273
Test: m lint-check
Change-Id: I311dad060bd941b99b811895048462887ed9b926
Muhammad Qureshicommited 2024-03-27 06:27:46 +00:00
NetworkPolicyManager#isUidNetworkingBlocked does not know about some
firewall chains status(e.g. FIREWALL_CHAIN_OEM_DENY_1)
So BpfNetMaps#isUidNetworkingBlocked is more correct but there could be
some behavior difference.
To avoid breaking devices and have longer verification time, this CL
updates to use BpfNetMaps#isUidNetworkingBlocked only on V+ devices.
Bug: 328732146
Test: TH
Change-Id: I60f84a5fff90386103692841dead465652249446
(for now for better testing we don't make V special)
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id2835bd393c0ec9e1710644681bc5aab0d7d2aae
Maciej Żenczykowskicommited 2024-03-19 21:45:21 +00:00
This CL also adds @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
to NetworkStackBpfNetMaps
Bug: 328732146
Test: TH
Change-Id: Ifa4cffd046164405b8b49d2e2ee9f27240bec6fa
BpfNetMapsReader is loaded to bootclasspath. So this class should not
contain unnecessary codes.
To make this clear, this CL renames to NetowrkStackBpfNetMaps and add
comments
Bug: 328732146
Test: TH
Change-Id: I557627c9fae087eb6119c2ae31d46526fa9e5d7e
When request_restricted_wifi is enabled CarrierPrivilegeAuthenticator
calls CarrierPrivilegesLost callback passed from ConnectivityService.
But CarrierPrivilegeAuthenticator was using its own handler thread to
receive broadcast and callbacks so CarrierPrivilegesLost callback needed
to post a message to the CS handler.
This CL updates CarrierPrivilegeAuthenticator to use CS handler if
request_restricted_wifi is enabled, and remove the message post in
ConnectivityService.
Test: TH
Change-Id: Ib41304a30e3dd366b0f6f1d7df81145f0e05ece1
Per Thread spec requirement, a Thread BR should optionally publish
the vendor and model name in the "_meshcop._udp" service.
This is useful for distinguish a Google or non-Google Thread BR.
Bug: 311324956
Change-Id: Iace5622197914794dd9c9a54f65f63207942b089
When there are addresses that are used by a single VPN interface,
ConnectivityService sets ingress discard rules to drop packets to this
address from the non-Vpn interfaces
Test: FrameworksNetTests
Bug: 295800201
Change-Id: I089d01a38eff3f37a851627fa9e4acefb8d9ad5e
This enforceNetworkStackPermission() should be adopted to check
the required permission but this may be break OEM captive portal
apps. Simply ignore the request if the caller does not have
permission.
This commit also fixes the format issues that is auto-fixed by
ktlint.
Fix: 329385091
Test: ates FrameworksNetTests
Change-Id: Ia973a1078eda3134fc8ff261d3954cd050767880
This CL updates CSTest to use mocked appOpsManager to bypass
checkPackage enforcement so that test can file network request as
SYSTEM_UID
Bug: 314627716
Test: atest ConnectivitySampleMetricsTest
Change-Id: I0a5f3b1bf2c343644e6f5e2a4ec1b0460e2645c4
This reverts commit 41557553f6.
(this is no longer needed, as it rolled out with January module,
while the May module this is targetting already includes an rc,
thus eliminating the need for this warning)
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I90c8abad2f70d65d142f55c18ad2f34018da6615
Maciej Żenczykowskicommited 2024-03-05 19:49:20 -08:00
This reverts commit 71a65dc21b.
(this is no longer needed, as it rolled out with January module,
while the May module this is targetting already includes an rc,
thus eliminating the need for this warning)
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9ea0755fb8e2ae7ec4560f6e0c27ad4e41f5abee
Maciej Żenczykowskicommited 2024-03-05 19:48:42 -08:00
This CL allows everyone to see the subscriptionIds and the network owner
to see the allowedUids from the NetworkCapabilities.
Bug: 324357121
Test: atest ConnectivityManagerTest
atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.ConnectivityServiceTest
Change-Id: I91e360827d2a9a64625f1d6ae0f808aa327c7d22
Apps that target an SDK before V will not see networks with
NET_CAPABILITY_LOCAL_NETWORK unless they explicitly set this capability
in their network requests.
Bug: 319212206
Test: CSLocalAgentTests
Change-Id: I414b03dfea9a8aac83304c6be501f03d637739b4
Make the default Thread and Border Router enabled state customizable for
vendor via resource overlay.
Bug: 322734489
Change-Id: I278d6afa82aac8d1bb06ee79f22bae6fb0199386
- onRoleHoldersChanged & onRoleSmsChanged handling for multiple Users
- Different satelliteNetworkFallbackUids cache for each user.
- Merging uid of each user cache and sending for Multi Layer request
- check SATELLITE_COMMUNICATION permission based package manager
context at different UserHandle
Bug: 324347502
Test: atest FrameworksNetTests
Change-Id: If98524ec7846909d70db3e962e2a11c912768551
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
The hasNetworkStackPermission() method does not enfore the
permission check. It should be replaced with
enforceNetworkStackPermission().
Bug: 325984919
Test: atest FrameworksNetTests
Change-Id: I9ad0b47190dbc9afd2ee6f5dfc21a4935036733a
Always store the corresponding SubscriptionId together with the Carrier
uid so that when the carrier loses the Privilege, both the uid and
SubscriptionID will be used in the onCarrierPrivilegesLost callback
Bug: 324357121
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.CarrierPrivilegeAuthenticatorTest
atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.ConnectivityServiceTest
Change-Id: I28e51c583261a67d4441c6f825ade6781b862ee4