Commit Graph

42623 Commits

Author SHA1 Message Date
paulhu
07aa05e464 [automerger skipped] Update network preference priority value for VPN am: b5c9e3567f -s ours
am skip reason: Merged-In I197cb358e8e30355fbf675e4c623abebe7abdb7f with SHA-1 da7129d862 is already in history

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

Change-Id: Id0562b49fc90f3c3ad5ffde0deb06af8bfae7210
2021-07-13 03:29:45 +00:00
Maciej Żenczykowski
af3d38bea3 Merge "[CTT-4] Improve conntrack timeout update logging" am: 8d2e46aec3 am: ae7fb09d69
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1760690

Change-Id: Ib662129472d947c75bf23598f2b64acbd9a67c8b
2021-07-13 02:45:06 +00:00
Maciej Żenczykowski
c5a6e13cfb Merge "[CTT-3] Add a string converter for TCP and UDP protocol number" am: 7d3d4eaca7 am: 9fd842569e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1762187

Change-Id: I5e99d3070e5c2945fbef74ca49864e9a512910f0
2021-07-13 02:45:02 +00:00
Maciej Żenczykowski
303f4de48e Merge "[CTT-2] Clean up unused {function, exception} and improve readability" am: d6ca2420bb am: 45805fe7f0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1762186

Change-Id: Ie62e21b5297a2da4ecde7f3527048ac987838105
2021-07-13 02:44:58 +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
ae7fb09d69 Merge "[CTT-4] Improve conntrack timeout update logging" am: 8d2e46aec3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1760690

Change-Id: Ifdf2ef4dae1d295d9a27f04863efd136c4c5c808
2021-07-13 02:28:28 +00:00
Maciej Żenczykowski
9fd842569e Merge "[CTT-3] Add a string converter for TCP and UDP protocol number" am: 7d3d4eaca7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1762187

Change-Id: I01167aa9e2754e7fd26054c62f49aa29f6201ffb
2021-07-13 02:28:23 +00:00
Maciej Żenczykowski
45805fe7f0 Merge "[CTT-2] Clean up unused {function, exception} and improve readability" am: d6ca2420bb
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1762186

Change-Id: Iebbf79ab6e45dbbc9f9523f40c54c1f501244d67
2021-07-13 02:28:18 +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
8d2e46aec3 Merge "[CTT-4] Improve conntrack timeout update logging" 2021-07-13 02:11:59 +00:00
Maciej Żenczykowski
7d3d4eaca7 Merge "[CTT-3] Add a string converter for TCP and UDP protocol number" 2021-07-13 02:10:09 +00:00
Maciej Żenczykowski
d6ca2420bb Merge "[CTT-2] Clean up unused {function, exception} and improve readability" 2021-07-13 02:09:36 +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
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
b5c9e3567f 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
Original-Change: https://android-review.googlesource.com/1762867
Merged-In: I197cb358e8e30355fbf675e4c623abebe7abdb7f
Change-Id: I197cb358e8e30355fbf675e4c623abebe7abdb7f
2021-07-12 16:02:38 +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
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
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
8d2bbd865a [CTT-4] Improve conntrack timeout update logging
Bug: 190783768
Bug: 192804833

Test: atest TetheringCoverageTests

Change-Id: I56792d75d12a0207e0a83a6d64e303f3bbfc3c6a
2021-07-11 15:06:22 +08:00
Hungming Chen
916ba672b7 [CTT-3] Add a string converter for TCP and UDP protocol number
Bug: 190783768
Bug: 192804833

Test: atest TetheringCoverageTests
Change-Id: I6a6452b65dd994fcf392e51917be52537a9d4cd9
2021-07-11 15:05:56 +08:00
Hungming Chen
71b85591ea [CTT-2] Clean up unused {function, exception} and improve readability
- Remove ipv4MappedAddressBytesToIpv4Address because it can be covered
  by parseIPv4Address.
- Remove IllegalArgumentException from parseIPv4Address because it has
  never happened
- Reverse the order of upstream and downstream timeout refreshing in
  refreshAllConntrackTimeouts for readability because both source and
  destination of the downstream are opposite direction to the
  upstream.

Bug: 190783768
Bug: 192804833
Test: atest TetheringCoverageTests
Change-Id: I6a1e44777a4357dd3847c2e2bb1fc6c3cf01617c
2021-07-11 15:05:39 +08: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
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
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
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
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
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
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