Commit Graph

2198 Commits

Author SHA1 Message Date
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
Tyler Wear
5fd1a2a537 Add ThrowableBiConsumer to BpfCoordinatorShim am: 6d80f10bb3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1977767

Change-Id: Ibd5733fac0bc3a01c8cdda6eb72283ee348f23a8
2022-02-16 06:26:21 +00:00
Tyler Wear
6d80f10bb3 Add ThrowableBiConsumer to BpfCoordinatorShim
Change-Id: Iecf001ac6d9f53a64f903f5b8ab069d6be93f50a
2022-02-15 16:59:07 -08:00
Tyler Wear
c23ffbdf7e BpfBitmap Test
Privileged test case for BpfBitmap.

Test: atest BpfBitmapTest
Bug: 179733303
Change-Id: I9c32d8843176815a725eccfd1f0400ec129cd94d
2022-02-15 22:19:58 +00:00
Hungming Chen
a525e24fbc Add test for IPv4 UDP forwarding rules in BPF map
Parse the dumpsys output strings to check that the IPv4 UDP
forwarding rule is added by the UDP conntrack event on
the tethering interface.

Test: atest EthernetTetheringTest
Change-Id: I2f04af72e51ca6b7a37ba51daa4f5125cb11144c
2022-02-15 16:24:22 +08:00
Treehugger Robot
23b33420f5 Merge "Move permissions allowlist for Tethering" am: a828eb711c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1909681

Change-Id: I3b21c6d956866938869816f9c4ba75563f2c8b35
2022-02-15 04:55:19 +00:00
Treehugger Robot
a828eb711c Merge "Move permissions allowlist for Tethering" 2022-02-15 04:43:27 +00:00
Xin Li
bfa7b1a197 Merge "Merge sc-v2-dev-plus-aosp-without-vendor@8084891" into stage-aosp-master 2022-02-14 17:31:19 +00:00
Nucca Chen
61ef984d52 Merge "Dump BPF map in base64 encoded strings for testing" 2022-02-14 10:07:09 +00:00
Xin Li
a459e6a12d Merge sc-v2-dev-plus-aosp-without-vendor@8084891
Bug: 214455710
Merged-In: I5894450f3089b2ea105722a18ddf8f1eed1c28a0
Change-Id: If2045705da821c90705f7dd1e6944c0bb92e3289
2022-02-11 06:57:49 +00:00
Andrei Onea
52eac028fc Move permissions allowlist for Tethering
The allowlist will now be in the apex instead.

Test: boots && check permissions.xml is bundled
Bug: 190375768

Change-Id: Ia7434cba54d2b51479e52323f22c7f454499991d
2022-02-10 15:04:46 +00:00
Treehugger Robot
baefbc3375 Merge "Move IpSec APIs to Connectivity module" 2022-02-10 11:45:21 +00:00
Aaron Huang
2e778ee46b Move IpSec APIs to Connectivity module
(cherry picked from commit 68ca373929)
Bug: 204153604
Test: TH
Change-Id: If4afabdc65ed2ac3e918af1d4a03c4c9173c4a3c
Merged-In: If4afabdc65ed2ac3e918af1d4a03c4c9173c4a3c
2022-02-10 14:25:04 +08:00