Commit graph android_packages_modules_Co.../Tethering
Message SHA1
Merge "Allow mocking permission in TetheringServiceTest" am: ec48bb82aa am: 4abe3f8db3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1731231

Change-Id: I634aca925b30b6b15c5b786d7b03db57eadbde36

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-06-21 10:34:54 +00:00
8c3ef7d73f
Merge "Allow mocking permission in TetheringServiceTest"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-06-21 10:19:07 +00:00
ec48bb82aa
Merge "Correctly dump IPv4 downstream flows." am: a8afcd3b0e am: 18e6921d00
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1737399

Change-Id: I703da7753110539f3c30e489879a03fd678ae259

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-06-16 11:38:05 +00:00
69221f5a7d
Merge "Correctly dump IPv4 downstream flows."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2021-06-16 11:15:30 +00:00
a8afcd3b0e
Allow mocking permission in TetheringServiceTest
The test will currently fail if it is run in a package that has
ACCESS_NETWORK_STATE. Add utilities to mock permissions, and mock the
ACCESS_NETWORK_STATE permission to be denied.

Bug: 187935317
Test: atest TetheringServiceTest
Change-Id: I8df5f2ac21bf0314098e8c2e5ba583676ae8ab38

Remi NGUYEN VAN   commited 2021-06-16 17:53:10 +09:00
0ae7e5bdcd
Correctly dump IPv4 downstream flows.
The current code does not print these correctly: it prints the
public address twice and then the NAT address. Fix this to print
the src, nat, and dst addresses.

Also dump the output MAC address.

Example output:

    IPv4 Upstream: [inDstMac] iif(iface) src -> nat -> dst [outDstMac] age
      [66:f1:6f:d8:66:0a] 31(31) 192.168.146.173:48594 -> 11(rmnet_data1) 100.100.109.185:48594 -> 8.8.8.8:853 [00:00:00:00:00:00] 32305ms
      [66:f1:6f:d8:66:0a] 31(31) 192.168.146.173:45806 -> 11(rmnet_data1) 100.100.109.185:45806 -> 8.8.4.4:853 [00:00:00:00:00:00] 32305ms
    IPv4 Downstream: [inDstMac] iif(iface) src -> nat -> dst [outDstMac] age
      [00:00:00:00:00:00] 11(rmnet_data1) 8.8.8.8:853 -> 31(31) 100.100.109.185:48594 -> 192.168.146.173:48594 [0e:a8:7f:ba:76:48] 32305ms
      [00:00:00:00:00:00] 11(rmnet_data1) 8.8.4.4:853 -> 31(31) 100.100.109.185:45806 -> 192.168.146.173:45806 [0e:a8:7f:ba:76:48] 32305ms

Test: manual
Bug: 190783768
Change-Id: I93a82064c95027c7c63cb30baf8482ecddcbd09d

Lorenzo Colitti   commited 2021-06-15 23:11:27 +09:00
8569168eda
Merge "Add tethering bootclasspath fragment to its sdk"
Anton Hansson   authored and   Gerrit Code Review   commited 2021-06-15 13:11:44 +00:00
ee350966fa
Merge "Improve dumping IPv4 map entries." am: 26f799f2d7 am: 7bd9af79a7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1737394

Change-Id: I7317b560e9fde5596ba134e3073eabdffc5aaac7

Nucca Chen   authored and   Automerger Merge Worker   commited 2021-06-15 08:17:23 +00:00
94b381bb8d
Merge "Dump underlying BPF traffic stats as well as higher-level stats." am: a79b785ff0 am: 3a6c47e8ca
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1737393

Change-Id: Ib7b20c1ff032b744331c679a806d4190e0fbe82e

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-06-15 07:35:03 +00:00
a916a2dc59
Improve dumping IPv4 map entries.
1. Dump both upstream and downstream rules.
2. Also dump rule last used time.

Test: manual
Bug: 190783768
Change-Id: I3fffbf4a5dea68e61349de8b41bea49b8a319f86

Lorenzo Colitti   commited 2021-06-15 12:54:08 +09:00
70f43ee58e
Dump underlying BPF traffic stats as well as higher-level stats.
This provides a better way to tell whether traffic is flowing.

Test: manual
Bug: 190783768
Change-Id: If557b0a18fc0aea1bf6a65d91547fc1930098ed0

Lorenzo Colitti   commited 2021-06-15 12:49:07 +09:00
704b8013f1
Add tethering bootclasspath fragment to its sdk
This subsumes the java_sdk_library in the sdk.

Bug: 188427719
Test: build_mainline_modules.sh
Change-Id: Ib2ebb3893135b4dd91812f1f1b0915540cfd64cb
Merged-In: Ib2ebb3893135b4dd91812f1f1b0915540cfd64cb
(cherry picked from commit 3669599dec)

Anton Hansson   commited 2021-06-14 19:23:49 +01:00
a12ffacf6c
Merge "Update TetheringTests for new connectivity shims" into sc-dev am: b81724602f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14928587

Change-Id: I815b621b780e328df898cd56a4972e9d718b514d

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-06-10 14:04:03 +00:00
6d82137abe
Update TetheringTests for new connectivity shims
The stable connectivity shims are updated to now contain S API, so
tethering tests that assumed that compatibility R behavior was used need
to be updated.

To avoid such failures Tethering tests should have a test target using
updated shims (TetheringNextTests), but this was not done in S
timeframe.

Ignore-AOSP-First: topic needs differences in AOSP
Bug: 189581241
Test: atest TetheringTests
Change-Id: Ibc04e64a1e9d82b67aff10d1a6d77f9e6b1bbdfb

Remi NGUYEN VAN   commited 2021-06-10 13:44:00 +00:00
c94a1ffd55
Merge "import copy of bpf_net_helpers.h from system/netd/bpf_progs" am: 28c51a157c am: b6c38f987f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1733033

Change-Id: I1e8f24c3253f7d1369c8180e6b97edbf898b4224

Treehugger Robot   authored and   Automerger Merge Worker   commited 2021-06-10 06:19:14 +00:00
21ea02efc3
import copy of bpf_net_helpers.h from system/netd/bpf_progs
after this:
  diff system/netd/bpf_progs/bpf_net_helpers.h packages/modules/Connectivity/Tethering/bpf_progs/bpf_net_helpers.h
shows no diff, besides a switch to '#pragma once'
as the include guard.

Test: builds, atest, TreeHugger
Bug: 177884581
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ib943321d46254ba64ce206fb9e3b3414d15e4d45

Maciej Å»enczykowski   commited 2021-06-09 19:53:13 -07:00
23f5d805ed
Merge "Don't send onLinkPropertiesChanged after onLost for 464xlat." am: a3f12dd52c am: b4e1b65298
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1727829

Change-Id: Ifbdf8908508c3bcb3387562d602cde9b3f1c2b9f

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2021-06-09 08:34:14 +00:00
52cef7c369
Merge "Don't send onLinkPropertiesChanged after onLost for 464xlat."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2021-06-09 07:59:25 +00:00
a3f12dd52c
Merge "Fix TetheringTest crash on eng build" into sc-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2021-06-09 07:57:25 +00:00
f15137fb9f
Fix TetheringTest crash on eng build
startTrackDefaultNetwork was allowed to called multiple times
before even though there is no one actually do it. However,
in the TetheringTest#verifyDefaultNetworkRequestFiled, a
manual invocation is used to ensure that function supports
multiple entrance.

But with aosp/1697371, startTrackDefaultNetwork is no longer
allowed to be called multiple times, it would lead to log.wtf
and crash system in eng build.

Since the manual invocation of startTrackDefaultNetwork is not
realistic and no longer valid anymore, remove the invocation
that caused the trouble.

Test: atest TetheringCoverageTests
Bug: 188613493
Merged-In: I61f6088783d521fd17ae1e87370842b4239fbe75
Change-Id: I61f6088783d521fd17ae1e87370842b4239fbe75
  (cherry-picked from aosp/1711433)

junyulai   authored and   Junyu Lai   commited 2021-06-09 01:57:37 +00:00
9c5d40beca
Merge changes Ib8fe719f,Ia8c05780 am: 7648833bd4 am: f9074acfa3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1729160

Change-Id: I4726595e33fd379ab0cb02e7d80d166ece680eb7

Mark Chien   authored and   Automerger Merge Worker   commited 2021-06-08 10:46:38 +00:00
e6bdace75c
Merge changes Ib8fe719f,Ia8c05780
* changes:
  Suppress IpServer message logs
  Remove *Locked wording

Mark Chien   authored and   Gerrit Code Review   commited 2021-06-08 10:02:44 +00:00
7648833bd4
Add tethering bootclasspath fragment to its sdk am: 3669599dec
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14881273

Change-Id: I26f471625c44f24edfa91770d1f01775a7622c8a

Anton Hansson   authored and   Automerger Merge Worker   commited 2021-06-08 09:16:58 +00:00
71416c0237
Suppress IpServer message logs
To avoid log flooding, suppress CMD_IPV6_TETHER_UPDATE and
CMD_NEIGHBOR_EVENT message log because they appear frequentlg and
don't have any content which means they are ueseless for debugging.
Also remove logMessage from BaseServingState to fix duplicated
message because all the message already log in TetheredState
and LocalHotspotState which inherit BaseServingState.

Bug: 162920185
Bug: 185649441
Test: atest TetheringCoverageTests
      atest MtsTetheringTestLatestSdk
      atest CtsTetheringTest
Change-Id: Ib8fe719f3c1c4a65e6b5152df5e5adf33aba2079

markchien   commited 2021-06-08 15:57:04 +08:00
21021efbe1
Remove *Locked wording
Since tethering run in single thread without any synchronized lock,
remove "Locked" wording from the methods which the use lock before.

Bug: 162920185
Test: atest TetheringCoverageTest
Change-Id: Ia8c057800cab30cdcbacae4db2d706b6427e9861

markchien   commited 2021-06-08 15:56:14 +08:00
dc5903ae56
Don't send onLinkPropertiesChanged after onLost for 464xlat.
Currently, when a network that uses 464xlat is torn down,
NetworkCallbacks will receive onLinkPropertiesChanged after
onLost. This is confusing and incorrect.

The incorrect callback is sent because handleLinkProperties
checks that the netId of the agent still exists, not that the
NetworkAgent is still registered. This is normally correct,
because the NetworkAgent is removed from mNetworkAgentInfos and
the netId are removed from mNetworkForNetId by the same method,
disconnectAndDestroyNetwork.

In this specific case it's not correct, because the call to
handleUpdateLinkProperties is from disconnectAndDestroyNetwork
itself via nai.clatd.update and calls Nat464Xlat#stop.

No other callers of handleUpdateLinkProperties are affected
because:

- EVENT_NETWORK_PROPERTIES_CHANGED is called only by
  maybeHandleNetworkAgentMessage, which first checks that the
  NetworkAgent is registered.
- handlePrivateDnsSettingsChanged only looks at registered
  NetworkAgents (it loops over mNetworkAgentInfos).
- handlePrivateDnsValidationUpdate, handleNat64PrefixEvent and
  handleCapportApiDataUpdate call getNetworkAgentInfoForNetId,
  which will correctly determine that the agent is no longer
  registered, since they run on the handler thread and thus
  cannot run at the same time as disconnectAndDestroyNetwork.

The existing code contains a check for the netId being current.
This is intended to ensure that an update from a NetworkAgent
cannot affect another agent with the same Network. This extra
check is not necessary, because code running on the handler
thread can never observe a NetworkAgent in mNetworkAgentInfos
unless mNetworkForNetId maps that NetworkAgent's Network to that
NetworkAgent. This is because mNetworkForNetId is updated by the
same methods as mNetworkAgentInfos, and those updates occur on
the handler thread. So all code on the handler thread will see
those two as consistent.

Bug: 176496580
Test: atest FrameworksNetTests CtsNetTestCases HostsideVpnTests
Change-Id: I944f4c6ad36206bdccd85a6ea7ef71324a29c685

Lorenzo Colitti   commited 2021-06-08 15:48:57 +09:00
b4bf015b57
Reference framework-connectivity stubs explicitly
To merge the framework-connectivity and framework-connectivity.impl
targets, framework-connectivity stubs need to be referenced explicitly
in java_sdk_libraries, otherwise the build system will currently see
dependency cycles.

Bug: 183600168
Test: m
Merged-In: I556747f9ba934f8b44b6ea9a518adbccc84ac2a9
Change-Id: I0ff10dcb553115d349e287c9f648d77579158f9d

Remi NGUYEN VAN   commited 2021-06-08 15:24:05 +09:00
f20103940e
Add tethering bootclasspath fragment to its sdk
This subsumes the java_sdk_library in the sdk.

Bug: 188427719
Test: build_mainline_modules.sh
Change-Id: Ib2ebb3893135b4dd91812f1f1b0915540cfd64cb

Anton Hansson   commited 2021-06-07 15:46:33 +01:00
3669599dec
Merge "Mark tethering apex as compressible" into sc-dev
Nikita Ioffe   authored and   Android (Google) Code Review   commited 2021-06-07 11:13:35 +00:00
8148656efc
Correct the logic for CtsTetheringUtils.isWifiTetheringSupported
The existing isWifiTetheringSupported only check if tethering side
supports wifi tethering or not but not wifi side. A expected
behavior should include both of them, so add the wifi side check
into the helper function. Also update in the existing caller side
due to a new parameter added.

Bug: 186061922
Test: atest MtsTetheringTestLatestSdk
Megred-In: Id69ac1d30ab2bbf23e870193335b139f54672636
Change-Id: Id69ac1d30ab2bbf23e870193335b139f54672636
Ignore-AOSP-First: cherry-pick

Chiachang Wang   commited 2021-06-04 13:29:38 +00:00
0acaa74538
Merge changes I5d3e448e,Id69ac1d3 am: 02eea987c0 am: b675eba4c1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1711429

Change-Id: I5a1a97614bd4d35347844a30bf8cad161d62d735

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-06-04 05:40:59 +00:00
481d12943a
Merge "Revert "Add owners block for migration"" am: 43740568b6 am: dc4690f77e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1722671

Change-Id: Iecd9c51d3b732798e97068bf91757e035ceeac09

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-06-04 05:40:33 +00:00
a7a74654d1
Merge changes I5d3e448e,Id69ac1d3
* changes:
  Add test for ConnectivityManager.factoryReset
  Correct the logic for CtsTetheringUtils.isWifiTetheringSupported

Chiachang Wang   authored and   Gerrit Code Review   commited 2021-06-02 01:24:10 +00:00
02eea987c0
Merge "Test tethered callback with TetheringInterface"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-06-01 14:35:48 +00:00
c4d26414f8
Merge "Add the tethering type to TetheringEventCallback methods"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-06-01 14:33:51 +00:00
414edc4ac9
Merge "Add required permission to Tethering"
Aaron Huang   authored and   Gerrit Code Review   commited 2021-06-01 10:13:34 +00:00
87f051bfa6
Correct the logic for CtsTetheringUtils.isWifiTetheringSupported
The existing isWifiTetheringSupported only check if tethering side
supports wifi tethering or not but not wifi side. A expected
behavior should include both of them, so add the wifi side check
into the helper function. Also update in the existing caller side
due to a new parameter added.

Bug: 186061922
Test: atest MtsTetheringTestLatestSdk
Change-Id: Id69ac1d30ab2bbf23e870193335b139f54672636

Chiachang Wang   commited 2021-06-01 15:08:48 +08:00
4f5c4c4323
Test tethered callback with TetheringInterface
The old callback only report interface list, new callback could provide
the mapping of interface and type. Replace old callback usage in cts
with new callback and check whether old callback could get the correct
interface list by comparing the result between old and new callback.

Bug: 162920185
Bug: 152203943
Test: atest CtsTetheringTest on S
      atest CtsTetheringTestLatestSdk on R
      atest MtsTetheringTestLatestSdk on S and R
Merged-In: I2a0b8c43fb340c3eaed7f0f90464199222a24280
Change-Id: I2a0b8c43fb340c3eaed7f0f90464199222a24280

markchien   authored and   Chiachang Wang   commited 2021-06-01 14:36:09 +08:00
3a23d2e2a6
Add the tethering type to TetheringEventCallback methods
Before this change, tethering always report a list of tethered
interfaces and the caller need to use each tethering type's interface
regex to matching tethered list to manual implement the mapping of
tethering type and interface. This change allow caller to get rid of
tethering interface regex.

Bug: 162920185
Bug: 152203943
Test: atest CtsTetheringTest on S

Merged-In: I91bcccd676d109c1b974497ac29bd366a41b8899
Change-Id: I91bcccd676d109c1b974497ac29bd366a41b8899

markchien   authored and   Chiachang Wang   commited 2021-06-01 14:35:39 +08:00
35ad54b25e
Merge "Revert "Add owners block for migration""
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-06-01 00:05:06 +00:00
43740568b6
Revert "Add owners block for migration"
The migration is now done.
Modification in revert: kept tests/OWNERS deleted.

Bug: 189375701
Change-Id: Ie105882fc61f7395f2e37711d4849c63e1f7199d

Remi NGUYEN VAN   commited 2021-05-31 10:34:04 +00:00
b22e9ad95d
Merge "Fix memory access violation in NetworkStack" into sc-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2021-05-31 08:02:13 +00:00
1dc094b2c0
Mark tethering apex as compressible
Bug: 178713634
Test: presubmit
Change-Id: I621305e47b5b86408a72c622b1e367cd0e75f82c
Merged-In: I621305e47b5b86408a72c622b1e367cd0e75f82c
(cherry picked from commit 31cef5ebe2)

Nikita Ioffe   commited 2021-05-27 15:21:33 +01:00
5f33357348
Merge "Include sdk versioning proto in tethering apex"
Anton Hansson   authored and   Gerrit Code Review   commited 2021-05-27 10:05:22 +00:00
f827199767
Include sdk versioning proto in tethering apex
Allows SdkExtensions to inspect its version to decide what the extension
sdk version is on-device.

Bug: 188787081
Test: m com.android.tethering and inspect
Merged-In: If2d28b02be871594fed1fbb40b7aad284b553afb
Change-Id: If2d28b02be871594fed1fbb40b7aad284b553afb

Anton Hansson   commited 2021-05-27 07:35:31 +00:00
db3b06959f
Merge "Add owners block for migration" am: 2b579353e3 am: 190b1fdf4e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1720350

Change-Id: I39a0f5a354db032803725457855a1ca36a39cf65

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-05-27 04:48:16 +00:00
af31cdc658
Add owners block for migration
The migration will merge history in downstream branches,
so changes should not be submitted in the meantime.

Bug: 189375701
Change-Id: I32d4c6a2d7344b1baf92eeac27b3cbbecd549c2d
Test: TH

Remi NGUYEN VAN   commited 2021-05-27 01:13:44 +00:00
89bd526eba
Add required permission to Tethering
The permission of Tethering is moved to a separate xml file,
add the xml module to the required field of tethering app.

Bug: 151213404
Test: TetheringTests
Merged-In: I40b45a0f1b44fba0b68e94811d14725a59ed4e59
Change-Id: I40b45a0f1b44fba0b68e94811d14725a59ed4e59

Aaron Huang   commited 2021-05-26 23:29:55 +08:00
3f69f1c418
Merge "Mark tethering apex as compressible" am: d2d0d82a1d am: c16043bc0d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1573041

Change-Id: If1c29ec04e8b941e5ebff4b14a5ac86bb266b209

Nikita Ioffe   authored and   Automerger Merge Worker   commited 2021-05-26 11:01:10 +00:00
03e7233e9a
Include sdk versioning proto in tethering apex am: 89eb55fb8a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14683380

Change-Id: I1b76ce846738c80e977ac8204bd5c3cb5bf96f0d

Anton Hansson   authored and   Automerger Merge Worker   commited 2021-05-26 10:29:20 +00:00
d894d23742