Commit Graph

1802 Commits

Author SHA1 Message Date
Treehugger Robot
5298ddbb00 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: Ia49eb7404bc856acac6f62fd3e480efd1674e66c
2021-06-15 07:34:49 +00:00
Lorenzo Colitti
704b8013f1 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
2021-06-15 12:49:07 +09:00
Remi NGUYEN VAN
79471813b4 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: I3827d12719ddc930a18e8651dd66a2e28b6f92f6
2021-06-10 14:03:59 +00:00
Remi NGUYEN VAN
c94a1ffd55 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
2021-06-10 13:44:00 +00:00
Treehugger Robot
c3ff65a0b8 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: I0dea36f0270a493a8a4b5867e07e5e12ac0ec550
2021-06-10 06:18:34 +00:00
Maciej Żenczykowski
23f5d805ed 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
2021-06-09 19:53:13 -07:00
Lorenzo Colitti
7d9f43c6f3 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: Iad96cfcdd5f385c084be76b3b25ffd10b080df7f
2021-06-09 08:33:36 +00:00
Lorenzo Colitti
a3f12dd52c Merge "Don't send onLinkPropertiesChanged after onLost for 464xlat." 2021-06-09 07:59:25 +00:00
TreeHugger Robot
f15137fb9f Merge "Fix TetheringTest crash on eng build" into sc-dev 2021-06-09 07:57:25 +00:00
junyulai
9c5d40beca 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)
2021-06-09 01:57:37 +00:00
Mark Chien
1f5e9d4d83 Merge changes Ib8fe719f,Ia8c05780 am: 7648833bd4 am: f9074acfa3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1729160

Change-Id: Iae8f9bb61662f17b2aa3ae7f4f4983f94144f799
2021-06-08 10:45:58 +00:00
Mark Chien
7648833bd4 Merge changes Ib8fe719f,Ia8c05780
* changes:
  Suppress IpServer message logs
  Remove *Locked wording
2021-06-08 10:02:44 +00:00
Anton Hansson
175e9a0873 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: I80ecfa0d0b9f3d1258f6db5402539ba52df98d27
2021-06-08 09:15:00 +00:00
markchien
21021efbe1 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
2021-06-08 15:57:04 +08:00
markchien
dc5903ae56 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
2021-06-08 15:56:14 +08:00
Lorenzo Colitti
b4bf015b57 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
2021-06-08 15:48:57 +09:00
Remi NGUYEN VAN
f20103940e 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
2021-06-08 15:24:05 +09:00
Anton Hansson
3669599dec 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
2021-06-07 15:46:33 +01:00
Nikita Ioffe
8148656efc Merge "Mark tethering apex as compressible" into sc-dev 2021-06-07 11:13:35 +00:00
Chiachang Wang
0acaa74538 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
2021-06-04 13:29:38 +00:00
Chiachang Wang
a3df1ed5f1 Merge changes I5d3e448e,Id69ac1d3 am: 02eea987c0 am: b675eba4c1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1711429

Change-Id: Iede15400f50e5e0f37a95f59b924d8b7dd698509
2021-06-03 09:22:36 +00:00
Remi NGUYEN VAN
4cda76cdb9 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: Ib7698688fe1dec6f534a6571c715c4989a93fada
2021-06-03 09:13:30 +00:00
Chiachang Wang
02eea987c0 Merge changes I5d3e448e,Id69ac1d3
* changes:
  Add test for ConnectivityManager.factoryReset
  Correct the logic for CtsTetheringUtils.isWifiTetheringSupported
2021-06-02 01:24:10 +00:00
Treehugger Robot
c4d26414f8 Merge "Test tethered callback with TetheringInterface" 2021-06-01 14:35:48 +00:00
Treehugger Robot
414edc4ac9 Merge "Add the tethering type to TetheringEventCallback methods" 2021-06-01 14:33:51 +00:00
Aaron Huang
87f051bfa6 Merge "Add required permission to Tethering" 2021-06-01 10:13:34 +00:00
Chiachang Wang
4f5c4c4323 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
2021-06-01 15:08:48 +08:00
markchien
3a23d2e2a6 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
2021-06-01 14:36:09 +08:00
markchien
35ad54b25e 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
2021-06-01 14:35:39 +08:00
Remi NGUYEN VAN
43740568b6 Merge "Revert "Add owners block for migration"" 2021-06-01 00:05:06 +00:00
Remi NGUYEN VAN
b22e9ad95d Revert "Add owners block for migration"
The migration is now done.
Modification in revert: kept tests/OWNERS deleted.

Bug: 189375701
Change-Id: Ie105882fc61f7395f2e37711d4849c63e1f7199d
2021-05-31 10:34:04 +00:00
TreeHugger Robot
1dc094b2c0 Merge "Fix memory access violation in NetworkStack" into sc-dev 2021-05-31 08:02:13 +00:00
Nikita Ioffe
5f33357348 Mark tethering apex as compressible
Bug: 178713634
Test: presubmit
Change-Id: I621305e47b5b86408a72c622b1e367cd0e75f82c
Merged-In: I621305e47b5b86408a72c622b1e367cd0e75f82c
(cherry picked from commit 31cef5ebe2)
2021-05-27 15:21:33 +01:00
Anton Hansson
f827199767 Merge "Include sdk versioning proto in tethering apex" 2021-05-27 10:05:22 +00:00
Anton Hansson
db3b06959f 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
2021-05-27 07:35:31 +00:00
Remi NGUYEN VAN
418bf1436e 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: Idbeb82f27d5217c28eac6835e381677649b6a5f6
2021-05-27 04:47:22 +00:00
Remi NGUYEN VAN
89bd526eba 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
2021-05-27 01:13:44 +00:00
Aaron Huang
3f69f1c418 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
2021-05-26 23:29:55 +08:00
Anton Hansson
154ec0442e 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: Ib0c8fe59490fe6360ea9874dda04ea9a32f44832
2021-05-26 11:42:05 +00:00
Nikita Ioffe
26179fca42 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: I06e187c8b8db28809cd12e0f3145806e87f47cac
2021-05-26 11:02:12 +00:00
Nikita Ioffe
d2d0d82a1d Merge "Mark tethering apex as compressible" 2021-05-26 10:29:16 +00:00
Anton Hansson
89eb55fb8a 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
Ignore-AOSP-first: internal topic, will cherry-pick after submission
Change-Id: If2d28b02be871594fed1fbb40b7aad284b553afb
2021-05-25 13:01:31 +01:00
Maciej Żenczykowski
365ada7e04 Fix memory access violation in NetworkStack
Fix memory access violation in com_android_networkstack_tethering_BpfUtils.cpp
caused by invalid format string in com_android_networkstack_tethering_BpfUtils_isEthernet.
If rv is not valid, jniThrowException will format a string using
"Unknown hardware address type %s on interface %s". However, rv is an int but here
"%s" is used in fmt string, thus causing access violation of memory.

Use "%d" instead of "%s" for int.

Bug: 188757793
Original-Change: https://android-review.googlesource.com/1715797
Merged-In: I9d8ec0708efd747e24b3b3ffed5336434d4f64a7
Change-Id: I9d8ec0708efd747e24b3b3ffed5336434d4f64a7
2021-05-25 08:01:17 +00:00
Maciej Żenczykowski
705d0a9644 Merge "Fix memory access violation in NetworkStack" am: fc592e8bc0 am: d417b64774
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1715797

Change-Id: Idee66cfaec05391020420070ed8874b7b8c5f1bf
2021-05-25 00:18:35 +00:00
Maciej Żenczykowski
fc592e8bc0 Merge "Fix memory access violation in NetworkStack" 2021-05-24 23:56:06 +00:00
Remi NGUYEN VAN
e107f26c5d Merge "Merge history of packages/Connectivity" 2021-05-24 23:32:43 +00:00
Baligh Uddin
087dd90e5b Merge history of packages/Connectivity am: 2afd0986d3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14700782

BUG: 186628461
Merged-In: Ie82d0fb34bda77543e31c82660c6f315efa87f62
Change-Id: Ia7945b929573c9a5e697fb69358cd6d3c8beab00
2021-05-24 08:21:53 +00:00
Ye Jiao
86f56a135a Fix memory access violation in NetworkStack
Fix memory access violation in com_android_networkstack_tethering_BpfUtils.cpp
caused by invalid format string in com_android_networkstack_tethering_BpfUtils_isEthernet.
If rv is not valid, jniThrowException will format a string using
"Unknown hardware address type %s on interface %s". However, rv is an int but here
"%s" is used in fmt string, thus causing access violation of memory.

Use "%d" instead of "%s" for int.

Bug: 188757793
Change-Id: I9d8ec0708efd747e24b3b3ffed5336434d4f64a7
2021-05-24 06:12:56 +00:00
Baligh Uddin
3684713b8a Merge history of packages/Connectivity
Modified License Import for:
- Tethering/common/TetheringLib/Android.bp
- framework/Android.bp
- service/Android.bp
- tests/common/Android.bp
- tests/deflake/Android.bp
- tests/integration/Android.bp
- tests/smoketest/Android.bp
- tests/unit/Android.bp
- tests/unit/jni/Android.bp

BUG: 186628461
TEST: TH
Merged-In: I7b5fd61cd551c7010f5b8ceabbfdd04f30f648dd
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: Ia2185820f485e8ad2d3626a96eab7f5a874736cf
2021-05-24 05:45:18 +00:00
Baligh Uddin
2afd0986d3 Merge history of packages/Connectivity
Modified Visibility / Includes for:
- Tethering/common/TetheringLib/Android.bp

Modified License Import for:
- framework/Android.bp
- service/Android.bp
- tests/common/Android.bp
- tests/deflake/Android.bp
- tests/integration/Android.bp
- tests/smoketest/Android.bp
- tests/unit/Android.bp
- tests/unit/jni/Android.bp
Modified Lint mapping for:
- framework/lint-baseline.xml
- service/lint-baseline.xml

BUG: 186628461
TEST: TH
Merged-In: Ie82d0fb34bda77543e31c82660c6f315efa87f62
Change-Id: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
2021-05-24 04:40:14 +00:00