Commit Graph

2210 Commits

Author SHA1 Message Date
Lorenzo Colitti
6de87582c1 Merge changes from topic "block_port"
* changes:
  Add connectivity_native_test to Presubmit
  Vendor AIDL interface for port blocking via eBPF
2022-04-01 21:46:37 +00:00
Wayne Ma
075dd6f8ff Merge "Adding Tethering proto" 2022-03-31 16:24:16 +00:00
Hungming Chen
dad664748a Add test for tetherOffloadClient{Add, Remove, Clear}
also remove the redundant constructor definition in
test key/value class builder.

Test: atest TetheringCoverageTests
Change-Id: Icf93d4f196846c82c3a1c2b2b8697f4a5156ea92
2022-03-30 16:28:11 +08:00
Hungming Chen
fa3942c7e7 Add test for tetherOffloadRule4Clear
Test that clear IPv4 offload rules once tethering stopped

Test: atest TetheringCoverageTests
Change-Id: I107b15bef2a15f7c85236f2801c43288fe7d0f4d
2022-03-30 16:28:11 +08:00
Tyler Wear
b37f551287 Vendor AIDL interface for port blocking via eBPF
New Connectivity Service exposed to vendor for
restricting certain ports for use only in vendor.

Bug: 179733303

Change-Id: Iad9aff6924498ede5a08cfa5482082f094c0a90b
2022-03-25 09:14:48 -07:00
Wayne Ma
71d66396d2 Adding Tethering proto
Bug: 153942334
Test: m, flash and boot
Change-Id: I853d3a4dd914dd0c65a6c9e1749d8898da68540e
2022-03-24 17:40:31 +08:00
Patrick Rohr
6dde8ac532 Merge changes from topic "ethernet_mainline"
* changes:
  Fix the NPE thrown when starting Ethernet service in OS lower than T.
  Remove the stub ethernet service from Connectivity module.
  Update hidden API files for EthernetManager API move.
  Provide a stub ethernet service to build in sc-mainline-prod.
  Build ethernet framework source into framework-connectivity-tiramisu
2022-03-16 16:03:30 +00:00
Frank Li
cd9fe9b220 Merge "[DU04-4]Appropriate changes to the NetworkPolicyManager API" 2022-03-16 12:28:24 +00:00
Tom Hsu
1c12d0790e Merge "Add a carrier config to block tethering." 2022-03-16 07:26:39 +00:00
Meng Wang
a84bb2d8ba Add a carrier config to block tethering.
When KEY_CARRIER_SUPPORTS_TETHERING_BOOL=false, it will behave as if
entitlement check failed and a system notifcation shows up if user
tries to turn on tethering from Settings UI.

Bug: 161206517
Test: manual
Change-Id: I78da390ecb0c8f4f68285ef16da80653f136c11e
2022-03-16 12:40:24 +08:00
Frank
9ff8eb1829 [DU04-4]Appropriate changes to the NetworkPolicyManager API
Divide the NetworkPolicyManager API
notifyStatsProviderWarningOrLimitReached into the following two APIs:
1. notifyStatsProviderWarningReached()
2. notifyStatsProviderLimitReached()

Bug: 216474563
Test: atest NetworkStatsServiceTest NetworkPolicyManagerTest
            NetworkPolicyManagerServiceTest OffloadControllerTest
Change-Id: I473b8b677d492a7076e63f445b3a3be24d25e14d
2022-03-16 12:23:34 +08:00
Xiao Ma
885acf0abc Update hidden API files for EthernetManager API move.
Test: m
Bug: 210586283
Merged-In: I995c81f9bcfdd57c37f679878b6973d3de739803
Change-Id: I5f8c35a225cad94c87b00f7523497d145d335a13
2022-03-16 02:09:25 +00:00
Nucca Chen
3938102448 Merge changes I5af6ce96,Ibc1f6813
* changes:
  Refactor make{Tether4Key, Tether4Value ConntrackEvent} helper
  BpfCoordinatorTest: refactor upstream and downstream setup functions
2022-03-11 18:05:14 +00:00
Mark Chien
98502b78bc Merge "Use U32 from shared library" 2022-03-10 16:27:33 +00:00
markchien
22c1a3aa1f Use U32 from shared library
There is U32 added in frameworks/libs/net. Use shared one to avoid
duplicated code.

Bug: 215095957
Test: m
Change-Id: I861bc2f65ea947a908de2ec83e9b137d3342c8ce
2022-03-09 15:05:16 +08:00
Gurpreet Singh
3acad24476 Merge "Using common apex_defaults for com.android.tethering module." am: 6802eadef5
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2007756

Change-Id: I03636e6b8b4dc200fcb039b99190759bc7d5e776
2022-03-07 17:56:53 +00:00
Gurpreet Singh
6802eadef5 Merge "Using common apex_defaults for com.android.tethering module." 2022-03-07 17:32:37 +00:00
Mark Chien
c4b5faefaf Merge "Make isTetheringSupported respect all tethering downstreams" am: 8dcc3000fd
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1938694

Change-Id: Ic5f106a611a729fd63af2710bb9354be447641fd
2022-03-07 06:17:57 +00:00
Mark Chien
8dcc3000fd Merge "Make isTetheringSupported respect all tethering downstreams" 2022-03-07 05:56:20 +00:00
markchien
259d5c08a8 Make isTetheringSupported respect all tethering downstreams
Currently if wifi, usb and bluetooth tethering is not supported,
isTetheringSupported would return false. Then ethernet, ncm tethering
and wifi p2p would also not be supported anymore. Make
isTetheringSupported respect all tethering downstreams after T.

Also remove redundant code:
1. tethering always has upstream configuration, checking whether has
upstream configuration for isTetheringSupported is useless.
2. Remove TetheringDependencies#isTetheringSupported because it don't
have any caller.

Test: atest TetheringTests
Change-Id: I3db5ce410c064d37c9e9e704fce2a2b68705834e
2022-03-07 10:55:51 +08:00
Maciej Żenczykowski
ef0b4884d0 Merge changes from topic "dedup-interfaceparams" am: a63535bfd1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2007154

Change-Id: I7bd8c3a2ef89d0f358d6002d87dd08d6cd818691
2022-03-05 08:50:34 +00:00
Maciej Żenczykowski
a63535bfd1 Merge changes from topic "dedup-interfaceparams"
* changes:
  Remove unused InterfaceParams jarjar rule
  Deduplicate InterfaceParams
2022-03-05 08:23:55 +00:00
Patrick Rohr
9f371f024b Deduplicate InterfaceParams
CS should use InterfaceParams from frameworks/libs/net.

Test: builds
Bug: 222448728
Change-Id: I1f45d3171b265461a8724b4be7b212c030b63fe9
2022-03-04 16:53:51 +01:00
Gurpreet Singh
a12858d494 Using common apex_defaults for com.android.tethering module.
In /packages/modules/common/sdk/ModuleDefaults.bp file, some
apex_defaults are added to provide common parameters corresponding to
Q, R, S, and T releases.
(Refer to CL link for above mentioned change -
https://android-review.googlesource.com/c/platform/packages/modules/common/+/2005890?forceReload=true)

This CL is using the apex_default corresponding to R release for the
com.google.android.tethering module.

Bug: 172589606
Test: USE_RBE=true m
Since there are no runtime changes, successful code build is enough for
testing.

Change-Id: I4b3b3d6add96da1ee4421227996b54f7b96bc2c2
2022-03-04 15:34:29 +00:00
Mark Chien
9024fe85bd Merge "Pass whole TetheringConfiguration to IpServer" am: 9edd999725
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1999083

Change-Id: I79e2d5d822703902d35d8963bf32edc1ad2f3e26
2022-03-03 12:20:54 +00:00
Mark Chien
9edd999725 Merge "Pass whole TetheringConfiguration to IpServer" 2022-03-03 11:54:59 +00:00
markchien
b961d3d70f Pass whole TetheringConfiguration to IpServer
This is a no-op CL that passing whole TetheringConfiguration to IpServer
to reduce the number of IpServer constructor parameters.

Bug: 170056953
Test: atest TetheringTests
Change-Id: I4ec17f7ecaefd7f275139ad9c7f7551635b192c9
2022-03-03 11:54:24 +00:00
Mark Chien
38bfe95387 Merge "Remove tether_enable_select_all_prefix_ranges flag" am: a3728e97ca
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2005315

Change-Id: I34f748e1fdbc1c8ec82dfce4053e12989a99cad2
2022-03-03 10:08:41 +00:00
Mark Chien
a3728e97ca Merge "Remove tether_enable_select_all_prefix_ranges flag" 2022-03-03 09:40:27 +00:00
markchien
23a5f18adb Remove tether_enable_select_all_prefix_ranges flag
The tether_enable_select_all_prefix_ranges is added from M2020-12
for quick roll back the feature. Since feature is landed over a year
without any problem, remove the flag now.

Bug: 171269957
Test: atest TetheringTests
Change-Id: I3ef414a47dd0a1f80ea2d378601ccd7c14067318
2022-03-02 21:58:50 +08:00
Paul Hu
e435b5b513 Merge "Rename framework-connectivity-tiramisu to framework-connectivity-t" am: c871c08d8d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1976727

Change-Id: I1d69a7e13408a2d3bf61250b6568ea522b27880c
2022-03-02 07:27:24 +00:00
paulhu
537f72061a Rename framework-connectivity-tiramisu to framework-connectivity-t
Bug: 215434166
Test: build, flash, device boot to home.
Merged-In: I9ebedf8813cbfa30d979bc35a3b2306715be682b
Change-Id: I9ebedf8813cbfa30d979bc35a3b2306715be682b
2022-03-01 09:44:21 +08:00
junyulai
47bdefd82b Add JNI stats libraries to apex Android.bp am: 6187e7c79a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1994130

Change-Id: Ib5f5984dad0c1316a6845e03fc5bf9bb1e6d023a
2022-02-28 06:26:47 +00:00
junyulai
be96c01931 [MS54.8] Add hiddenapi-unsupported-t.txt to apex Android.bp am: 4eccfdec89
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1999073

Change-Id: If7ec922ee50497ef2e8c4230fda574f93f61c6d4
2022-02-28 06:26:40 +00:00
Junyu Lai
2eea4e4bd0 [MS54.3] Move NetworkStats to updatable sources am: eb6f4bef96
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1987447

Change-Id: I5c527290654b76405776efd54e57a1b469c62add
2022-02-28 06:26:36 +00:00
Lorenzo Colitti
cebdfba1bb Merge changes from topic "ms52-movenetstats"
* changes:
  Update API files to unhide MATCH_PROXY.
  Update tests for NetworkStats code move.
  Add setPollForce to module API
  Add JNI stats libraries to apex Android.bp
  Add JNI stats libraries to connectivity
  [MS62.2] Add NetworkStatsService into service initializer
  [MS54.8] Add hiddenapi-unsupported-t.txt to apex Android.bp
  [MS54.3] Move NetworkStats to updatable sources
2022-02-28 05:32:23 +00:00
junyulai
6187e7c79a Add JNI stats libraries to apex Android.bp
This is separated from ag/16766427 to avoid merge
conflict at downstream branches. For some downstream branches,
the library does not exist and this part is commented out.

Bug: 197717846
Test: atest FrameworksNetTests
Merged-In: Idb6da7ce678fbb3f4839604726cbdbdf223144c1
Merged-In: Iae44344701a3267110e5cbf271120201134d59e5
Change-Id: I9d7f6cea1cdb3c8117e677d8c204e3985295ada0
2022-02-28 04:16:58 +00:00
junyulai
4eccfdec89 [MS54.8] Add hiddenapi-unsupported-t.txt to apex Android.bp
This is separated from ag/16657723 to avoid merge
conflict at downstream branches. For some downstream branches,
the library does not exist and this part is commented out.

Test: TH
Bug: 197717846
Merged-In: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
Merged-In: I33e0d699086c87ce8e940036c9a52908bbbcf6c5
Change-Id: I031e5687fa47594b50ca1b40570e01cdec356827
2022-02-28 04:15:51 +00:00
Junyu Lai
eb6f4bef96 [MS54.3] Move NetworkStats to updatable sources
This CL builds NetworkStats related codes with the
connectivity module instead of platform.

Test: TH
Bug: 197717846
Change-Id: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
Merged-In: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
2022-02-28 03:24:19 +00:00
Mark Chien
3e834ca21f Merge "Notify linkproperties change in all scenarios" am: cc0dc24205
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1958901

Change-Id: I4f3a6f539f6d38552304c1300ce9b21a115234da
2022-02-25 11:38:37 +00:00
Mark Chien
cc0dc24205 Merge "Notify linkproperties change in all scenarios" 2022-02-25 11:13:12 +00:00
Pavan Kumar M
68e96aba07 Notify linkproperties change in all scenarios
In scenarios where linkproperties event is received on default internet
callback, linkproperties are cached and network state is updated with
new link properties but Tethering class is notified about the change.
Later when event is received on mobile request or listen all cb, since
the network state is already updated with these linkproperties, change
in link properties will not be notified. This results in tethering
failures where the ip addresses of the tethering interface will not be
updated.

This change handles this issue by triggering the link properties change
in all scenarios.

Update the correponding test case as well.

Tests: Builds, Boots, TetheringTests
Bug: 216281561
Change-Id: I7452ed07d2665843c86141764b71aab0c00417fe
2022-02-25 12:29:10 +05:30
Hungming Chen
4aa94e6f9c Refactor make{Tether4Key, Tether4Value ConntrackEvent} helper
Used for reducing the increasing amount of helper in the
follow-up commits.

Tether4Key, Tether4Value ConntrackEvent need many arguments to build
a testing instance. Any new argument combination may require a new
helper. It is hard to compare the difference while reading the code.

Test: atest BpfCoordinatorTest
Change-Id: I5af6ce9609b97d124227750cd1c5337796982c58
2022-02-22 21:32:52 +08:00
Hungming Chen
154b1e467d BpfCoordinatorTest: refactor upstream and downstream setup functions
This is preparation for tetherOffloadRule4Clear test.

- Upstream interface can be set {null, cellular (rawip), wifi (ether)}
- Allow that add up to two downstream interfaces which has one client
  on each of them.
- Change mBpfDownstream4Map and mBpfUpstream4Map from mocked instance
  to TestBpfMap for further rule check.
- Remove startPolling() from initBpfCoordinatorForRule4() because
  upstream information is updated by updateUpstreamNetworkState now.

Test: atest TetheringCoverageTests

Change-Id: Ibc1f68131410b7cec379ab4e310b90ad85f25d31
2022-02-22 21:32:38 +08:00
markchien
3b9d3c49f6 Fix EthernetTetheringTest testTestNetworkUpstream flaky am: 95cb089853
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1878054

Change-Id: I67bb6d102cb52e36043b3c8e55dc1db05ed878d3
2022-02-22 07:34:12 +00:00
markchien
95cb089853 Fix EthernetTetheringTest testTestNetworkUpstream flaky
The test assume the first tethering upstream would be test network. But
if there are mutiple networks available, this is a wrong assumption
because of race condtion. If tethering choose upstream while wifi or
celluar is available but test network may not available for tethering yet
(it depend on the NetworkCallback from ConnenectivityService), the first
upstream may not be the test network.

Bug: 215224286

Test: atest EthernetTetheringTest
Change-Id: Idfa972008643f1fb5119179383b06e2c8f65c667
2022-02-22 12:42:15 +08:00
Maciej Żenczykowski
7fa056c024 Merge "BpfBitmap Test" am: b194d551bf
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1908038

Change-Id: Ia59d0d801434c865a9aac0969530e5207c0cead2
2022-02-18 02:24:48 +00:00
Maciej Żenczykowski
b194d551bf Merge "BpfBitmap Test" 2022-02-18 01:55:43 +00:00
Nucca Chen
77186dd8d4 Merge "Add test for IPv4 UDP forwarding rules in BPF map" am: dc62c75b1e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1864481

Change-Id: I87c4be30810fcfa076363d9b823ddec7d849ff42
2022-02-17 03:28:24 +00:00
Nucca Chen
dc62c75b1e Merge "Add test for IPv4 UDP forwarding rules in BPF map" 2022-02-17 02:59:07 +00:00