Commit graph android_packages_modules_Co.../service
Message SHA1
Use helper function getIndexForValue in MulticastRoutingCoordinator.
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

Yang Sun   commited 2024-04-23 17:22:15 +08:00
4e7baadc71
Merge "Add a flag to disable the background firewall chain" into main
Suprabh Shukla   authored and   Gerrit Code Review   commited 2024-04-02 05:47:56 +00:00
aeacff5033
Add a flag to disable the background firewall chain
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

Suprabh Shukla   commited 2024-04-01 16:37:32 -07:00
724d8972e4
Merge "SatelliteAccessController enhancements to handle delete user scenario" into main
Nagendra Prasad Nagarle Basavaraju   authored and   Gerrit Code Review   commited 2024-04-01 06:19:52 +00:00
6cbb7cf3d5
SatelliteAccessController enhancements to handle delete user scenario
- 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

Nagendra Prasad Nagarle Basavaraju   commited 2024-04-01 04:19:12 +00:00
0668238d50
Merge "Use bpf map based isUidNetworkingBlocked on V+" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-03-28 12:23:49 +00:00
e7a49305ee
Merge "Separate Struct.java into its own lib." into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-03-28 06:23:57 +00:00
68d68d82ed
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
Add RequiresApi annotation for T+ method call.
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 Qureshi   commited 2024-03-27 06:27:46 +00:00
ea408d396b
Use bpf map based isUidNetworkingBlocked on V+
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

Motomu Utsumi   commited 2024-03-26 19:16:57 +09:00
9b272fa53a
Merge "Use connectivityHandler in CarrierPrivilegeAuthenticator" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-03-21 07:22:41 +00:00
98eb360c0d
Merge "Move isChainEnabled and getUidRule to BpfNetMapsUtils" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-03-21 06:33:17 +00:00
452796c323
Merge "NetBpfLoad: rework mainline bpf execution codepath" into main
Maciej Å»enczykowski   authored and   Gerrit Code Review   commited 2024-03-20 00:27:58 +00:00
83af4a36a8
NetBpfLoad: rework mainline bpf execution codepath
(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 Å»enczykowski   commited 2024-03-19 21:45:21 +00:00
732a14164f
Merge "clat bpf: add byte/packet counter" into main
Maciej Å»enczykowski   authored and   Gerrit Code Review   commited 2024-03-19 16:23:43 +00:00
d77b3c4af2
Merge changes from topic "overlay-vendor-model-name" into main
* changes:
  [Thread] support customize meshcop txt via resourceoverlay
  [Thread] add resourceoverlay config for vendor and model name

Kangping Dong   authored and   Gerrit Code Review   commited 2024-03-19 12:21:23 +00:00
ab1945c790
clat bpf: add byte/packet counter
Bug: 285124667
Test: TreeHugger,
  atest FrameworksNetTests:android.net.connectivity.com.android.server.connectivity.ClatCoordinatorTest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5b59f0c05d41030f99160f68058c61eadd24fbbd

Maciej Å»enczykowski   authored and   KH Shi   commited 2024-03-19 07:54:36 +00:00
8b3f9d9e3e
Move isChainEnabled and getUidRule to BpfNetMapsUtils
This CL also adds @RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
to NetworkStackBpfNetMaps

Bug: 328732146
Test: TH
Change-Id: Ifa4cffd046164405b8b49d2e2ee9f27240bec6fa

Motomu Utsumi   commited 2024-03-19 04:21:29 +00:00
2f79f58c06
Merge "Rename BpfNetMapsReader to NetworkStackBpfNetMaps" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-03-19 04:13:17 +00:00
7bfcd30e89
Rename BpfNetMapsReader to NetworkStackBpfNetMaps
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

Motomu Utsumi   commited 2024-03-19 04:12:29 +00:00
fc504042f6
Use connectivityHandler in CarrierPrivilegeAuthenticator
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

Motomu Utsumi   commited 2024-03-18 22:16:53 +09:00
4fcaa4e803
[Thread] add resourceoverlay config for vendor and model name
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

Kangping Dong   commited 2024-03-18 20:13:37 +08:00
bbb7828d31
Drop packets to VPN address ingressing via non-VPN interface
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

Motomu Utsumi   commited 2024-03-15 15:23:50 +09:00
b4772b1e5d
Merge "Make the subscriptionIds and allowedUids public" into main
Ying Xu   authored and   Gerrit Code Review   commited 2024-03-14 14:33:38 +00:00
a37386a6b6
Merge "Ignore no permission calls for CaptivePortal.appRequest" into main
Chiachang Wang   authored and   Gerrit Code Review   commited 2024-03-14 06:48:06 +00:00
4cd5b9e2d2
Ignore no permission calls for CaptivePortal.appRequest
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

Chiachang Wang   commited 2024-03-14 04:32:11 +00:00
73be9a0933
Merge "Add CompatChange for local network matching" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-03-13 02:34:57 +00:00
d2c103ea14
Fix wrong request_count in connectivityStateSample and add tests
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

Motomu Utsumi   commited 2024-03-12 19:07:08 +09:00
e08de4d322
Merge "Merge Android 14 QPR2 to AOSP main" into main
Xin Li   authored and   Gerrit Code Review   commited 2024-03-07 06:41:03 +00:00
612de50da2
Revert "Log bpf rc file if it differs from the template files."
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 Å»enczykowski   commited 2024-03-05 19:49:20 -08:00
cf3d20011c
Revert "Fix BpfLoaderRcUtils to support IOS_8859_1"
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 Å»enczykowski   commited 2024-03-05 19:48:42 -08:00
49fa57ae58
Make the subscriptionIds and allowedUids public
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

Ying Xu   commited 2024-03-04 14:51:20 -08:00
611b80456a
Add CompatChange for local network matching
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

Motomu Utsumi   commited 2024-03-04 17:50:27 +09:00
ad480e0c58
Revert "24Q2: use mainline netbpfload from apex" am: e36d77c385
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2986117

Change-Id: I97c08b3743925b114b85bef510cd90afbb92ca96
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Maciej Å»enczykowski   authored and   Automerger Merge Worker   commited 2024-03-04 07:38:21 +00:00
fd3940589e
24Q2: use mainline netbpfload from apex am: 13b5e1ff29
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2954707

Change-Id: Iddf496b3c2f9bddc8baa43facfffbe5c96bfc8a9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Maciej Å»enczykowski   authored and   Automerger Merge Worker   commited 2024-03-04 07:38:07 +00:00
0fda3dd38a
Revert "24Q2: use mainline netbpfload from apex"
This reverts commit 13b5e1ff29.

Reason for revert: wasn't sent for review

Change-Id: Ibbf514e0ce506e2720f3d98f12beab7c4d14e133

Maciej Å»enczykowski   authored and   Gerrit Code Review   commited 2024-03-04 06:59:25 +00:00
e36d77c385
24Q2: use mainline netbpfload from apex
(also monitor https://pitot.corp.google.com/clusters?release=public-all&comparison=target&device_view=ALL_DEVICES&duration=56&clusters.search=BpfLoaderRcUtils )

See also:
  https://android-review.git.corp.google.com/c/platform/packages/modules/Connectivity/+/2956635
  netbpfload: enable on U QPR2 (aka 24Q1)  [target May mainline]

Test: TreeHugger, atest FrameworksNetTests:android.net.connectivity.com.android.server.BpfLoaderRcUtilsTest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie9e0f90321265f33a23deb03b403fb73b6a1db05

Maciej Å»enczykowski   commited 2024-03-04 06:32:18 +00:00
13b5e1ff29
Merge "Include structs lib in service-connectivity-pre-jarjar" into main am: db67a80430
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2966917

Change-Id: I5021d8019cdf6685c86fa9ce9ee9279474065629
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Yang Sun   authored and   Automerger Merge Worker   commited 2024-02-29 03:34:05 +00:00
e5a99273a8
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
Merge "[Thread] make Thread state customisable via resource overlay" into main am: 5ce2519a3e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2916726

Change-Id: I245ca692066f3d206f402851c5688997267bb888
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Kangping Dong   authored and   Automerger Merge Worker   commited 2024-02-28 16:40:29 +00:00
19a5a97420
[Thread] make Thread state customisable via resource overlay
Make the default Thread and Border Router enabled state customizable for
vendor via resource overlay.

Bug: 322734489
Change-Id: I278d6afa82aac8d1bb06ee79f22bae6fb0199386

Kangping Dong   commited 2024-02-28 16:54:02 +08:00
c8359f4eb1
Merge "SatelliteAccessController enhancements to handle Multiple User" into main am: 63ff28ed54
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2954926

Change-Id: Ic696199bfc6996d3a92a42deb76380e3421087cc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Nagendra Prasad Nagarle Basavaraju   authored and   Automerger Merge Worker   commited 2024-02-26 17:22:44 +00:00
bc55087fc2
Merge "SatelliteAccessController enhancements to handle Multiple User" into main
Nagendra Prasad Nagarle Basavaraju   authored and   Gerrit Code Review   commited 2024-02-26 16:44:08 +00:00
63ff28ed54
SatelliteAccessController enhancements to handle Multiple User
- 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

Nagendra Prasad Nagarle Basavaraju   commited 2024-02-26 11:24:01 +00:00
f63e6d8e67
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
Merge "Correct the method used for permission check" into main am: c91b22be98
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2950126

Change-Id: I06a492a0299277a3d16e37b122bd28f3f5b85bc0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Chiachang Wang   authored and   Automerger Merge Worker   commited 2024-02-26 06:31:35 +00:00
9553538169
Correct the method used for permission check
The hasNetworkStackPermission() method does not enfore the
permission check. It should be replaced with
enforceNetworkStackPermission().

Bug: 325984919
Test: atest FrameworksNetTests
Change-Id: I9ad0b47190dbc9afd2ee6f5dfc21a4935036733a

Chiachang Wang   commited 2024-02-26 03:08:22 +00:00
ac162f2272
Merge "Store the SubscriptionId together with the Carrier UID" into main am: 9a5aaaccf6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2956897

Change-Id: Id58458b8523d74d70ee2a9a2ed93195949c8a253
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Ying Xu   authored and   Automerger Merge Worker   commited 2024-02-20 22:21:32 +00:00
7d5d380a36
Store the SubscriptionId together with the Carrier UID
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

Ying Xu   commited 2024-02-20 08:58:31 -08:00
0d06b9460a
Merge "Enable CloseFrozenAppSockets feature on V+" into main am: 8960842e6a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2960502

Change-Id: I73b8ebec6843cbb67c03813dbef2a27301b3ab90
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Motomu Utsumi   authored and   Automerger Merge Worker   commited 2024-02-13 08:46:32 +00:00
ee1d1b86d6