Commit Graph

44662 Commits

Author SHA1 Message Date
Maciej Żenczykowski
57305b4dd9 Merge "[CTT-1] Rename conntrack related function, variable and constant" am: 2c2eccac73 am: d85fc83e41 am: 954c8d383e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1762185

Change-Id: Id3603ab15d1fde3a39039e296946cde1360fbaa1
2021-07-13 02:58:21 +00:00
Maciej Żenczykowski
954c8d383e Merge "[CTT-1] Rename conntrack related function, variable and constant" am: 2c2eccac73 am: d85fc83e41
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1762185

Change-Id: Ie0b8eee8dd649432835ef89369d3ac2e6166d8da
2021-07-13 02:44:53 +00:00
Maciej Żenczykowski
d85fc83e41 Merge "[CTT-1] Rename conntrack related function, variable and constant" am: 2c2eccac73
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1762185

Change-Id: I9da178744d3a276ac3a26058eb5fd95240882beb
2021-07-13 02:28:12 +00:00
Maciej Żenczykowski
2c2eccac73 Merge "[CTT-1] Rename conntrack related function, variable and constant" 2021-07-13 02:09:00 +00:00
Remi NGUYEN VAN
63a0b12501 Merge "Jarjar all classes in service-connectivity" am: 23c627b090 am: 793a4424d7 am: bfb22a0a0a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1759589

Change-Id: Ibc05406e026ddd471b1cd0e064963dae20fbc5f4
2021-07-13 00:16:06 +00:00
Remi NGUYEN VAN
bfb22a0a0a Merge "Jarjar all classes in service-connectivity" am: 23c627b090 am: 793a4424d7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1759589

Change-Id: I7a55b08af6efb311af1c5385b63a450e9c343fd7
2021-07-12 23:53:14 +00:00
Remi NGUYEN VAN
793a4424d7 Merge "Jarjar all classes in service-connectivity" am: 23c627b090
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1759589

Change-Id: I51c65720e00ab652daf8af51e74ace09347ece7d
2021-07-12 23:40:56 +00:00
Remi NGUYEN VAN
23c627b090 Merge "Jarjar all classes in service-connectivity" 2021-07-12 23:29:25 +00:00
paulhu
082eb6b851 Update network preference priority value for VPN am: da7129d862 am: 29797ebfae am: 525b37ccd0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1762867

Change-Id: Ifd744b25da4bce1a26eaccd7244acaaf5d3c7c80
2021-07-12 15:32:48 +00:00
paulhu
525b37ccd0 Update network preference priority value for VPN am: da7129d862 am: 29797ebfae
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1762867

Change-Id: I0065cc135f1988eaf8eff4d8c8696576ce7146a3
2021-07-12 15:14:59 +00:00
paulhu
29797ebfae Update network preference priority value for VPN am: da7129d862
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1762867

Change-Id: I8aaea58aa38921cd354d326e074285f06d724f2b
2021-07-12 15:00:06 +00:00
Remi NGUYEN VAN
0755183fae Jarjar all classes in service-connectivity
This ensures classes are used from the service-connectivity jar, instead
of using classes from the system_server bootclasspath when there is a
name conflict.
Any developer adding a future class should do so in a subpackage of
com.android.connectivity (such as com.android.connectivity.server).
Otherwise, jarjar rules need to be added manually until b/180995093 is
fixed.

Also update current jarjar rules so that classes are jarjared to
com.android.connectivity.[original name], making it easier to find the
original source. This is consistent with the wifi module.

Bug: 193086215
Test: atest CtsNetTestCases
      dexdump on service-connectivity.jar shows no classes outside of
      com.android.connectivity and com.android.server
Change-Id: I2aadeca32751267b74d4fd2fd93bb3e8c62e46c0
2021-07-12 19:33:33 +09:00
paulhu
da7129d862 Update network preference priority value for VPN
Currently netd supports only the default value for VPN but CS
send priorty value 1 to netd. It will break the default routing
for VPN. Thus, update network preference priority value to 0 for
VPN.

Bug: 193245476
Test: atest CtsHostsideNetworkTests:HostsideVpnTests
Change-Id: I197cb358e8e30355fbf675e4c623abebe7abdb7f
2021-07-12 18:15:46 +08:00
Remi NGUYEN VAN
44f31fd1c0 Merge "Remove catch clause on compat shim" am: 5b37955322 am: 19122edbc5 am: 2cff18c9f5
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1760688

Change-Id: I0a75b7759892b86647bd142e9fa5ffd2cdf2867a
2021-07-12 04:32:02 +00:00
Remi NGUYEN VAN
2cff18c9f5 Merge "Remove catch clause on compat shim" am: 5b37955322 am: 19122edbc5
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1760688

Change-Id: I962a30ce497292d4bc65d6724251d2a16a98d995
2021-07-12 04:19:04 +00:00
Remi NGUYEN VAN
19122edbc5 Merge "Remove catch clause on compat shim" am: 5b37955322
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1760688

Change-Id: I9b3dea9ce41f0afb1093c9c0affb185e870c4cd3
2021-07-12 04:05:37 +00:00
Remi NGUYEN VAN
5b37955322 Merge "Remove catch clause on compat shim" 2021-07-12 03:52:54 +00:00
Remi NGUYEN VAN
2205be85bb Merge "Remove hidden ArrayUtils usage in test" am: 946da61e70 am: 3c5a0f7de9 am: 92b099b4e7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1760689

Change-Id: I0d2477417b15a91a8cd0776e3b2d018558fed663
2021-07-12 02:59:14 +00:00
Remi NGUYEN VAN
92b099b4e7 Merge "Remove hidden ArrayUtils usage in test" am: 946da61e70 am: 3c5a0f7de9
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1760689

Change-Id: I9a96b7cbef135a86d13171cd5b1edfc69b68c2e0
2021-07-12 02:50:20 +00:00
Remi NGUYEN VAN
3c5a0f7de9 Merge "Remove hidden ArrayUtils usage in test" am: 946da61e70
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1760689

Change-Id: If2a051f415f46544955e6646ed7d74c52d4e2d22
2021-07-12 02:31:43 +00:00
Remi NGUYEN VAN
946da61e70 Merge "Remove hidden ArrayUtils usage in test" 2021-07-12 02:21:12 +00:00
Hungming Chen
378bdbc2ef [CTT-1] Rename conntrack related function, variable and constant
Bug: 190783768
Bug: 192804833
Test: atest TetheringCoverageTests

Change-Id: Ib7ba480138b8aa8c6f8dffaa97787bac74a3972e
2021-07-11 15:04:37 +08:00
Remi NGUYEN VAN
12f4783a07 Merge "Rename shared utils to connectivity-module-utils" am: c5ba57ec15 am: bd514f4993 am: 7ae63c2f2a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1757315

Change-Id: I72f122d1c2cf9e0d4baadf7747361bbccad80507
2021-07-09 10:20:09 +00:00
Remi NGUYEN VAN
7ae63c2f2a Merge "Rename shared utils to connectivity-module-utils" am: c5ba57ec15 am: bd514f4993
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1757315

Change-Id: I253c86c016332aed02b480c54036e78fb3295bdb
2021-07-09 10:06:29 +00:00
Remi NGUYEN VAN
bd514f4993 Merge "Rename shared utils to connectivity-module-utils" am: c5ba57ec15
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1757315

Change-Id: Ib72d1cf70e1d1842ba7563fb106fde3d30e9c4f6
2021-07-09 09:53:36 +00:00
Remi NGUYEN VAN
61cc1ac9bd Remove hidden ArrayUtils usage in test
Internal utils are generally jarjared by connectivity jarjar rules, but
ArrayUtils is not actually statically linked into the tests, so this
makes the ConnectivityCoverageTests fail. FrameworksNetTests has been
fine because it does not use jarjar, but does not exercise updated code
because of that.

Remove usage of the hidden utility, as there are reasonable alternatives
with non-hidden APIs that avoid other breakages long-term.

Bug: 187935317
Test: atest ConnectivityCoverageTests:ConnectivityServiceTest
Change-Id: I8ed85b941c3d1028771a5ac33196b1509a95789d
2021-07-09 18:52:51 +09:00
Remi NGUYEN VAN
c5ba57ec15 Merge "Rename shared utils to connectivity-module-utils" 2021-07-09 09:41:22 +00:00
James Mattis
d8037b7bca [automerger skipped] Only pass the NRI for removal in NRI#binderDied am: 4846fff84d am: a89e4e03ed -s ours
am skip reason: Merged-In I2a2ad4ec6d415423182a1856a898779203658f8b with SHA-1 8f03680fdb is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15236913

Change-Id: Ia142bb0eb716e07ac078c1a0361dedc826fb39fe
2021-07-09 05:51:17 +00:00
James Mattis
00f01b169b [automerger skipped] Only pass the NRI for removal in NRI#binderDied am: 4846fff84d -s ours am: 07afe491d5 -s ours
am skip reason: Merged-In I2a2ad4ec6d415423182a1856a898779203658f8b with SHA-1 8f03680fdb is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15236913

Change-Id: Idb38af8a6c4d86a3f72e4ad5d73d76d756d54d60
2021-07-09 05:47:37 +00:00
James Mattis
a89e4e03ed Only pass the NRI for removal in NRI#binderDied am: 4846fff84d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15236913

Change-Id: I101f9e5e148b77ffde136db16c75f21991d39d98
2021-07-09 05:36:14 +00:00
James Mattis
07afe491d5 [automerger skipped] Only pass the NRI for removal in NRI#binderDied am: 4846fff84d -s ours
am skip reason: Merged-In I2a2ad4ec6d415423182a1856a898779203658f8b with SHA-1 8f03680fdb is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15236913

Change-Id: I8cb520b41a21529fb6afdcf5d62e4433c70f086e
2021-07-09 05:35:15 +00:00
Remi NGUYEN VAN
9c7d164498 [automerger skipped] Merge "Add new network capabilities to support automotive head unit via USB" am: 8890ead0e0 am: c432565460 -s ours am: 6685af8fd8 -s ours
am skip reason: Merged-In I3c2563d4ae4e3715d0c6270344ba8f7ef067872f with SHA-1 2afd0986d3 is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1757322

Change-Id: I83cc94c771b9d0b0518268d858b49b5ba96da66d
2021-07-09 05:21:55 +00:00
Remi NGUYEN VAN
6685af8fd8 [automerger skipped] Merge "Add new network capabilities to support automotive head unit via USB" am: 8890ead0e0 am: c432565460 -s ours
am skip reason: Merged-In I3c2563d4ae4e3715d0c6270344ba8f7ef067872f with SHA-1 2afd0986d3 is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1757322

Change-Id: I4e0130d24efa406dc30ca1794af0ab413081f639
2021-07-09 05:06:11 +00:00
Remi NGUYEN VAN
c432565460 Merge "Add new network capabilities to support automotive head unit via USB" am: 8890ead0e0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1757322

Change-Id: If50a92d2cfbce8f91a179d73b5716b87758df8b2
2021-07-09 04:57:20 +00:00
Remi NGUYEN VAN
58cd24586c Rename shared utils to connectivity-module-utils
Rename net-module-utils-srcs to connectivity-module-utils-srcs.

This is done as the module utils are made specific to
service-connectivity to contain only classes used by
service-connectivity.

Bug: 192998401
Test: Tests prepared in next change
Change-Id: I354f4b84aa90cc12579c4db5479cf2de1dc9cf5d
2021-07-09 13:42:31 +09:00
Remi NGUYEN VAN
8890ead0e0 Merge "Add new network capabilities to support automotive head unit via USB" 2021-07-09 04:38:10 +00:00
James Mattis
4846fff84d Only pass the NRI for removal in NRI#binderDied
When NetworkRequestInfo#binderDied is called in ConnectivityService,
only pass the NRI to handleRemoveNetworkRequest. This is to prevent a
potential crash when unlinkDeathRecipient is called twice for the same
NRI.

Also, as a cleanup, don't iterate mRequests in the log message on binderDied.

As per the bug, the chain of events leading to a potential crash are:

- `Connectivity.NetworkRequestInfo#binderDied()` is called for an NRI
tracking multiple `NetworkRequest` items. This can happen for a TRACK_DEFAULT
request filed by a UID on a different preference than the default, which
copies the request list.
- This in turn triggers multiple `EVENT_RELEASE_NETWORK_REQUEST` events
for the same NRI, one for reach `NetworkRequest` tracked.
- When handling `EVENT_RELEASE_NETWORK_REQUEST`, each `NetworkRequest`
that is passed in will then be used to look up the parent NRI that originally
sent it to be released.
- Therefore if an NRI was tracking three requests, it would trigger three
release network events, then each request would be used to look up the
same NRI again when handling said release event.
- Finally, `ConnectivityService.NetworkRequestInfo#unlinkDeathRecipient` is
called for the NRI in question. Using the scenario above, that means we could
call `unlinkDeathRecipient` multiple times for the same NRI if it was tracking
multiple network requests causing the associated crash.
- If `unlinkDeathRecipient` is called more than once for the same NRI, it will
cause the crash listed in this bug.
- The fix is to only call handleRemoveNetworkRequest for the NRI once. This
works since when removing the NRI, we iterate over all of its requests to
remove them. By only calling handleRemoveNetworkRequest once, it's ensured
`unlinkDeathRecipient` for this NRI as part of
`Connectivity.NetworkRequestInfo#binderDied()` is only called  once and not
potentially multiple times.

Bug: 185541983
Change-Id: I918c8620f2975d810894c178277771764923b5a4
Test: atest FrameworksNetTests
Merged-In: I2a2ad4ec6d415423182a1856a898779203658f8b
2021-07-09 02:12:33 +00:00
Remi NGUYEN VAN
ca5530ed1d Remove catch clause on compat shim
registerSystemDefaultNetworkCallback no longer throws
UnsupportedApiLevelException as it has compatibility behavior down to Q,
so remove the catch clause for the checked exception.

The exception would previously not be thrown since the Tethering module
is only running on R+.

Bug: 182961265
Test: atest TetheringTests
Change-Id: I3c58235f3a59294995e5f32502fec6ccd17a3cf0
2021-07-09 10:24:44 +09:00
James Mattis
e23f928666 Merge "Only pass the NRI for removal in NRI#binderDied" am: 24fa1d7a8f am: 48f3878591 am: 743bf14a13
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1741953

Change-Id: I89c7e2b31f700da5a448b06abbb9d2d6378c7901
2021-07-09 00:40:37 +00:00
James Mattis
743bf14a13 Merge "Only pass the NRI for removal in NRI#binderDied" am: 24fa1d7a8f am: 48f3878591
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1741953

Change-Id: I96cf6ee7fa18900fc0c4ea97b424b634c433083c
2021-07-09 00:25:24 +00:00
James Mattis
48f3878591 Merge "Only pass the NRI for removal in NRI#binderDied" am: 24fa1d7a8f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1741953

Change-Id: Iac74fa029c1736ae5a094d80766acbb838a6e212
2021-07-09 00:05:48 +00:00
James Mattis
24fa1d7a8f Merge "Only pass the NRI for removal in NRI#binderDied" 2021-07-08 23:54:46 +00:00
Chalard Jean
50227eacc9 [automerger skipped] Merge "Remove exclusivity restriction of multiple preferences" am: 278b92f6a0 am: b819ff4142 -s ours am: 5843b474a0 -s ours
am skip reason: Merged-In I6912db753c8b4a194aa7af92b01ca6dcfec10d8b with SHA-1 de5efb90cb is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1719390

Change-Id: I9d89c3519a491ff2e729469cec35edee30c30934
2021-07-08 04:28:38 +00:00
Chalard Jean
5843b474a0 [automerger skipped] Merge "Remove exclusivity restriction of multiple preferences" am: 278b92f6a0 am: b819ff4142 -s ours
am skip reason: Merged-In I6912db753c8b4a194aa7af92b01ca6dcfec10d8b with SHA-1 de5efb90cb is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1719390

Change-Id: Ifdf1eab16db9955e42cf1fe233edbbe9e9504d06
2021-07-08 04:15:18 +00:00
Chalard Jean
b819ff4142 Merge "Remove exclusivity restriction of multiple preferences" am: 278b92f6a0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1719390

Change-Id: Ib41c5050c389ac115221005f565ff4f59a799502
2021-07-08 04:05:45 +00:00
Chalard Jean
278b92f6a0 Merge "Remove exclusivity restriction of multiple preferences" 2021-07-08 03:50:34 +00:00
Remi NGUYEN VAN
544872f16c Merge "Ensure wifi reconnects before waiting for metered" am: 14f0d14c14 am: 577f3e158d am: 9438d0fa5a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1757311

Change-Id: I116618f8a244902727c43e4ba529ca9826f10666
2021-07-08 01:25:44 +00:00
Remi NGUYEN VAN
9438d0fa5a Merge "Ensure wifi reconnects before waiting for metered" am: 14f0d14c14 am: 577f3e158d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1757311

Change-Id: I22f911df5cb9ba95fdfe672ddd07502fa3e19f1e
2021-07-08 01:12:18 +00:00
Remi NGUYEN VAN
577f3e158d Merge "Ensure wifi reconnects before waiting for metered" am: 14f0d14c14
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1757311

Change-Id: Icdf3557348e3a4f58c7e988057609cbbbd9e5e33
2021-07-08 00:54:52 +00:00
lucaslin
6f77442d76 Add new network capabilities to support automotive head unit via USB
- Add a new transport type for USB and a new network capability
to support automotive head unit.
- In order to pass DnsManagerTest#testTransportTypesEqual, Android.bp
needs to link to dnsresolver_aidl_interface-V8-java. That test checks
whether the TRANSPORT types defined in NetworkCapabilities are the
same as IDnsResolver.aidl.

(clean cherry-pick of change in downstream branch history, original
change ID before project move:
Iec2df09a776d779108f95098e01b7ffdf6f8867a)

Bug: 181742019
Test: atest FrameworksNetTests

Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: Ie438ec68577ebdaaf990795fa27f1169b0105411
2021-07-08 09:44:39 +09:00