Commit graph

43,523 commits

Message SHA1
Add replaceFirewallChain API
To deprecated firewallReplaceUidChain netd binder and move the
functionality to tethering (connectivity) mainline module, expose
replaceFirewallChain to support the caller outside the module.
Currently the API are still call to netd. Will replace with the
implementation inside tethering (connectivity) module.

Bug: 209935649
Test: atest CtsHostsideNetworkTests
Change-Id: If7a87548b0a3acda00a1455da4e4ff24a630ddc7

markchien   commited 2022-01-14 10:23:21 +08:00
00a0bed534
Add setFirewallChainEnabled API
To deprecated firewallEnableChildChain netd binder and move the
functionality to tethering (connectivity) mainline module, expose
setFirewallChainEnabled to support the caller outside the module.
Currently the API are still call to netd. Will replace with the
implementation inside tethering (connectivity) module.

Bug: 209935649
Test: atest CtsHostsideNetworkTests
Change-Id: I9b64c9d12260521489a87fbeae5afbee2a8ea8f6

markchien   commited 2022-01-14 10:23:15 +08:00
98a6f95d0f
Add updateFirewallRule API
To deprecated firewallSetUidRule netd binder and move the functionality to
tethering (connectivity) mainline module, expose updateFirewallRule to
support the caller outside the module. Currently the API are still call
to netd. Will replace with the implementation inside tethering
(connectivity) module.

Bug: 209935649
Test: atest CtsHostsideNetworkTests
Change-Id: I0b53c999e06c2378afec0eb491815ec398c91b0b

markchien   commited 2022-01-14 10:19:51 +08:00
e1561fa800
Merge "Add updateMeteredNetwork{Allow, Deny}List APIs"
Mark Chien   authored and   Gerrit Code Review   commited 2022-01-13 08:21:03 +00:00
136f2d2d91
Merge "Make MTS verify expected BPF programs based on OS version."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-01-13 08:14:08 +00:00
08a2e03231
Make MTS verify expected BPF programs based on OS version.
While this does not capture all nuances of optional programs,
go devices, etc. it should be a useful starting point to tell us
if something is really unexpected.

Test: test-only change
Test: passes on flame running qt-dev build (no-op)
Test: passes on flame running RQ3A build
Test: passes on raven running SP2A build
Test: passes on barbet running aosp/master
Change-Id: I43ff8c61c861c008cce459d2dcb487bb536c8da8

Lorenzo Colitti   commited 2022-01-13 15:31:27 +09:00
3b38b12071
Merge "[DU01]Remove INetworkManagementService from NetworkStatsService"
Frank Li   authored and   Gerrit Code Review   commited 2022-01-13 05:45:42 +00:00
231503a08c
Merge "Bump tethering target sdk version to 31"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-01-13 05:00:02 +00:00
0d4f956b34
Merge "Add a method to apply a set of network preferences to a user profile"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-01-13 04:08:34 +00:00
296a343528
Merge "Add excludeLocalRoutes in NativeNetworkConfig"
Chiachang Wang   authored and   Gerrit Code Review   commited 2022-01-13 00:57:49 +00:00
e52be3b59f
Test mapping imports for ethernet
Bug: 209505060

Change-Id: Icd74c2fbd9f3c5fc7e59679bb5b99950d8cdb820

Filip Zakrzewski   commited 2022-01-12 17:43:55 +00:00
8a5823db30
Merge "Revert "Revert^2 "Revert "Add CTS tests for exclude VPN routes A...""
Taras Antoshchuk   authored and   Gerrit Code Review   commited 2022-01-12 15:27:30 +00:00
e4f2b591de
Merge changes Iad0b0d52,Iee727308
* changes:
  Use recording callbacks in NsdManagerTest
  Refactor NsdManagerTest

Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-01-12 11:47:03 +00:00
6eb0654f9b
Bump tethering target sdk version to 31
Also add BLUETOOTH_CONNECT permission which is needed for access
PanService if target sdk 31+. The permission would be granted to
privilege application without prompt.

Also remove the min_sdk_version 29 from AndroidManifest because it is
useless that the Android.bp already define min_sdk_version 30.

$aapt dump xmltree TetheringNext.apk AndroidManifest.xml
N: android=http://schemas.android.com/apk/res/android
  E: manifest (line=19)
    A: android:sharedUserId(0x0101000b)="android.uid.networkstack" (Raw: "android.uid.networkstack")
    A: android:versionCode(0x0101021b)=(type 0x10)0x1f
    A: android:versionName(0x0101021c)="Tiramisu" (Raw: "Tiramisu")
    A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1f
    A: android:compileSdkVersionCodename(0x01010573)="Tiramisu" (Raw: "Tiramisu")
    A: package="com.android.networkstack.tethering" (Raw: "com.android.networkstack.tethering")
    A: platformBuildVersionCode=(type 0x10)0x1f
    A: platformBuildVersionName="Tiramisu" (Raw: "Tiramisu")
    E: uses-sdk (line=23)
      A: android:minSdkVersion(0x0101020c)=(type 0x10)0x1e
      A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1f
    ....
    E: uses-permission (line=35)
      A: android:name(0x01010003)="android.permission.BLUETOOTH_CONNECT" (Raw: "android.permission.BLUETOOTH_CONNECT")

Bug: 204265450
Test: manual testing bluetooth tethering and TH
Change-Id: I6f821020679b9379cada29f6f0816187545a24fb

markchien   authored and   Mark Chien   commited 2022-01-12 07:24:16 +00:00
bf62258f8c
Use recording callbacks in NsdManagerTest
Refactor the test to use recording callbacks based on ArrayTrackRecord,
which allow removing the test's own logic to poll for events.

Bug: 190249673
Test: atest NsdManagerTest --rerun-until-failure 20
Change-Id: Iad0b0d52271b13954c0193b3b9d4307349a39443

Remi NGUYEN VAN   commited 2022-01-12 15:26:11 +09:00
0f17237773
Add a method to apply a set of network preferences to a user profile
Add a method to apply a set of network preferences to a user profile

Bug: 194332512
CTS-Coverage-Bug: 211133973
Test: CTS
Change-Id: I97730ea14e7c96922236fd77a591e5acadd875ba

Sooraj Sasindran   commited 2022-01-11 21:07:23 -08:00
e7aee2736e
Merge "add prohr to OWNERS_core_networking"
Maciej Ĺ»enczykowski   authored and   Gerrit Code Review   commited 2022-01-11 21:41:34 +00:00
ca6732df93
add prohr to OWNERS_core_networking
Test: TreeHugger
Change-Id: I93ca246578f81351335a580e0555180265c7610b

Patrick Rohr   authored and   Maciej Ĺ»enczykowski   commited 2022-01-11 18:54:31 +00:00
7d3ceb9dae
Merge "Add test for setting excludeLocalRoutes"
Chiachang Wang   authored and   Gerrit Code Review   commited 2022-01-11 08:56:38 +00:00
da13f899e3
Refactor NsdManagerTest
Refactor the test to use Kotlin, and move some repeated code to
submethods.

Bug: 190249673
Test: atest NsdManagerTest
Change-Id: Iee7273080d5d29f1d364ac0a77e017edf9b36051

Remi NGUYEN VAN   commited 2022-01-11 12:52:22 +09:00
eaada07913
Add excludeLocalRoutes in NativeNetworkConfig
Add extra field in NativeNetworkConfig to allow CS to notify
netd whether the local traffic should be excluded from the VPN
network.

Bug: 184750836
Test: atest FrameworksNetworkTests
Change-Id: If230fe7057722c80a09433673ac3cec857f7a7a5

Chiachang Wang   commited 2022-01-11 11:33:44 +08:00
bf6b879b55
Merge "Import translations. DO NOT MERGE ANYWHERE"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-01-11 00:49:44 +00:00
296bbae13c
Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: If066bbd12a50e3af9310195ffbaff306e3e29f11

Bill Yi   commited 2022-01-10 14:59:11 +00:00
c1a1376836
Merge "[MS42.2] Adopt TelephonyDisplayInfo in unit test"
Junyu Lai   authored and   Gerrit Code Review   commited 2022-01-10 11:43:58 +00:00
6a360b5a71
Revert "Revert^2 "Revert "Add CTS tests for exclude VPN routes A..."
Revert "Revert "Revert "Revert "Add APIs that allow to exclude r..."

Revert "Revert "Revert "Revert "Add VpnServiceBuilderShim for Vp..."

Revert submission 1941195-revert-1931760-reland-vpn-impl-part-2-WGARECSJEM

Reason for revert: fixed merge conflict with aosp/1938197
Reverted Changes:
Ic25e5e4ea:Revert^2 "Revert "Add CTS tests for exclude VPN ro...
Ic72cafcf5:Revert "Revert "Revert "Add APIs that allow to exc...
I53802190a:Revert "Revert "Revert "Add VpnServiceBuilderShim ...

Change-Id: I5a6ceaae21c563de8bb71338c29973f58178b456

Taras Antoshchuk   commited 2022-01-10 10:20:46 +00:00
d9ba74953b
Merge "Revert^2 "Revert "Add CTS tests for exclude VPN routes APIs"""
Matt Buckley   authored and   Gerrit Code Review   commited 2022-01-07 17:48:45 +00:00
67197b7ed6
Revert^2 "Revert "Add CTS tests for exclude VPN routes APIs""
1a6d19e4b8

Change-Id: Ic25e5e4eaf57e033a9304244387e6fba15213d2b

Matt Buckley   commited 2022-01-07 17:44:52 +00:00
01d9abecef
[DU01]Remove INetworkManagementService from NetworkStatsService
NetworkStatsService is using INetworkManagementService APIs, which
cannot be accessed after moving into the mainline module. So, replace
and remove those hidden API usages.

Bug: 209738761
Test: atest NetworkStatsServiceTest
Change-Id: Ieda3c3382fa61411587c5b390bbecb2a2524844b

lifr   commited 2022-01-08 01:33:36 +08:00
214714285a
Merge "Revert "Revert "Add CTS tests for exclude VPN routes APIs"""
Taras Antoshchuk   authored and   Gerrit Code Review   commited 2022-01-07 16:27:12 +00:00
b0818dd720
Merge "[MS39.2] Remove the looper from NetworkStatsSubscriptionMonitor"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-01-07 14:42:52 +00:00
7d9470ca0b
Merge changes from topic "ms17-multipath"
* changes:
  [MS17.3] Remove NetworkStatsManagerInternal dependency
  [MS17.2] Fix remaining daily budget assertion

Junyu Lai   authored and   Gerrit Code Review   commited 2022-01-07 14:17:03 +00:00
bc1f44adb0
[MS42.2] Adopt TelephonyDisplayInfo in unit test
Test: atest NetworkStatsSubscriptionsMonitorTest
Fix: 213021103

Change-Id: Ib6b472a095a6ae92a2574c1ea2d382e1c2699d57

Junyu Lai   commited 2022-01-07 06:45:56 +00:00
50a8f07132
[MS39.2] Remove the looper from NetworkStatsSubscriptionMonitor
OnSubscriptionsChangedListenerHandler(Looper looper) is
hidden, there is no way to pass a looper to it in the test.
This change partially revert aosp/1340040 to fix hidden
API dependency. And will use a different approach to address
this problem in later stages.

Test: atest NetworkStatsSubscriptionMonitorTest
Bug: 204830222
Bug: 213280079
Change-Id: Ie17f04cd9f174f2895bde4607bbd7a9a92181a96

Junyu Lai   commited 2022-01-07 06:45:56 +00:00
0e9c51ca5c
[MS17.3] Remove NetworkStatsManagerInternal dependency
Test: atest MultipathPolicyTrackerTest
Bug: 204830222

Change-Id: I219e963124b8fa0967ea08f2f047f7c654ab4a04

Junyu Lai   commited 2022-01-07 06:45:56 +00:00
3cb8fe8c66
[MS17.2] Fix remaining daily budget assertion
Currently, the test didn't mock data usage of the month.
Thus, when asserting remaining budget, the calculation
always assumes there is no used data, hence wrong budget
value is expected. See #getRemainingDailyBudget.

This change makes data usage of this month includes the
bytes used today. And adjust the policy limit accordingly.

Test: atest MultipathPolicyTrackerTest
Bug: 204830222
Change-Id: I3ca6505f8d502047485ba3676f16fbc474117cc1

Junyu Lai   commited 2022-01-07 06:45:56 +00:00
eaa58de991
Add updateMeteredNetwork{Allow, Deny}List APIs
To deprecated below netd binder interfaces and move the functionality to
tethering(connectivity) mainline module:
  bandwidthAddNaughtyApp
  bandwidthRemoveNaughtyApp
  bandwidthAddNiceApp
  bandwidthRemoveNiceApp
Expose updateMeteredNetwork{Allow, Deny}List APIs to support the caller
outside the module. Currently the two APIs are still call to INetd
binders. Once functionality is moved to mainline module, will switch to
use them.

Bug: 209935649
Test: m
Change-Id: I8df720935748c2587f91a7b760cfd5a93a0fa852

markchien   commited 2022-01-07 10:16:13 +08:00
738ad911c7
Add test for setting excludeLocalRoutes
Bug: 184750836
Test: atest FrameworksNetTests
Change-Id: I4e79467ce7afcf07f4b8d7f964a605703a6d2c5e

Chiachang Wang   commited 2022-01-07 09:39:43 +08:00
b4a319bf24
Include "generate_transaction_name" in the aidl build rules for
Connectivity as otherwise method names are not visible in the collected
binder latency data.

Test: N/A
Bug: 208515821
Change-Id: I0e6c6dcd4663f0abe473d39f7de4c718ac3fb66f

Siim Sammul   commited 2022-01-06 15:21:13 +00:00
cd4c8228bd
Merge "[MS32.2] Remove TetheringManager#ACTION_TETHER_STATE_CHANGED usage"
Junyu Lai   authored and   Gerrit Code Review   commited 2022-01-06 13:57:12 +00:00
392161e651
Merge "[MS34.2] Replace TelephonyManager#getSubscriberId(subId) with public API"
Junyu Lai   authored and   Gerrit Code Review   commited 2022-01-06 13:56:39 +00:00
38e0582797
Update to ConnectivityService to use utils
Update to ConnectivityService to use permission utils to validate the
existence of a system feature.

Bug: 210485380
Test: atest FrameworksNetTests:
com.android.server.ConnectivityServiceTest

Change-Id: Ia537cc5b37ef8d80f49f1a83ba572b3b8a9f6874

James Mattis   commited 2022-01-05 09:15:24 -08:00
4ab1ffca29
Revert "Revert "Add CTS tests for exclude VPN routes APIs""
This reverts commit f4882153ed.

Reason for revert: failing build target configuration is fixed

Change-Id: Ic8ed8fce72a1c816ee6766f296efaddeafcd2f70

Taras Antoshchuk   commited 2022-01-05 14:00:25 +01:00
1a6d19e4b8
Merge "[MS33.2] Remove NetdService dependency"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-01-05 10:39:13 +00:00
ee7ca130dc
[MS32.2] Remove TetheringManager#ACTION_TETHER_STATE_CHANGED usage
Replace intent receiver with callback listener.

Test: atest com.android.server.net.NetworkStatsServiceTest
Bug: 204830222
Change-Id: I07ef87b08b5d177719a82f79a2866d72b003fb5a

Junyu Lai   commited 2022-01-05 05:31:05 +00:00
a9b4fa7248
[MS34.2] Replace TelephonyManager#getSubscriberId(subId) with public API
Test: atest com.android.server.net.NetworkStatsSubscriptionsMonitorTest
Bug: 204830222
Change-Id: I53cdf9a83a38ea6921bff02be48bc14a4012ba36

Junyu Lai   commited 2022-01-05 05:31:05 +00:00
851fb24667
[MS33.2] Remove NetdService dependency
This change pass INetd to NetworkStatsFactory to replace
NetdService#getNetdInstance.

Test: atest FrameworksNetTests
Bug: 204830222
Change-Id: I0756188adb394fa5343c8d2ae354567df63acf21

Junyu Lai   commited 2022-01-05 05:30:39 +00:00
37880f857a
Caps callback should be called when underlying networks are changed
Add a test to check if onCapabilitiesChanged will be called when
the underlying networks are changed.

Bug: 191918368
Test: atest CtsHostsideNetworkTests:HostsideVpnTests
Change-Id: I8dfb16e01199d41b1b65f69e129ec40e37f9ab0f

lucaslin   commited 2022-01-04 15:27:11 +08:00
36faae95ba
Merge "[MS25.2] Remove AppOpsManager.OP_GET_USAGE_STATS dependency"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-01-03 22:41:30 +00:00
90cf8dbd92
Merge "Add tethering IPv4 UDP forwarding test"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-01-03 13:47:12 +00:00
76bc75f0a2
Merge "wifi data usage: replaced Wi-Fi SSID with a Wi-Fi network key"
Les Lee   authored and   Gerrit Code Review   commited 2022-01-03 12:36:49 +00:00
719ce67677