Commit Graph

10819 Commits

Author SHA1 Message Date
Automerger Merge Worker
df7118cdf6 Merge "[automerger skipped] Add a test for starting the legacy VPN. am: 3103a6ee03 am: 6995503731 -s ours" into rvc-qpr-dev-plus-aosp 2020-08-07 06:54:48 +00:00
Chalard Jean
2bacb6817d [automerger skipped] Add a test for starting the legacy VPN. am: 3103a6ee03 am: 6995503731 -s ours
am skip reason: Change-Id I3c4a94181bd71df68121fa0f71669fa4fa588bdd with SHA-1 7b76f806dd is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12330622

Change-Id: Ifee93b0591d129129731d6dcf9c47e0a6ca2f5a9
2020-08-07 06:54:27 +00:00
Chalard Jean
f2482451c0 [automerger skipped] Add a test for starting the legacy VPN. am: 3103a6ee03 -s ours am: cd5e78689a -s ours
am skip reason: Change-Id I3c4a94181bd71df68121fa0f71669fa4fa588bdd with SHA-1 7b76f806dd is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12330622

Change-Id: Ic7c62d74001747f8983b9e6585de1ddbda16b06e
2020-08-07 06:54:10 +00:00
Chalard Jean
cd5e78689a [automerger skipped] Add a test for starting the legacy VPN. am: 3103a6ee03 -s ours
am skip reason: Change-Id I3c4a94181bd71df68121fa0f71669fa4fa588bdd with SHA-1 7b76f806dd is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12330622

Change-Id: Ieff977b6742a93b3a8f335ff6022cf1fbdcec2e7
2020-08-07 06:44:53 +00:00
Lorenzo Colitti
c86ad7fb09 Merge "Fix fd leak in KeepaliveTracker." am: 3dbbfa10bb am: 2e7172387e am: 7122f9b616 am: f4056df345
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1361907

Change-Id: Idee2fcb96d2b94120d5b53b8d402faa11c94d142
2020-08-07 06:30:11 +00:00
Lorenzo Colitti
f4056df345 Merge "Fix fd leak in KeepaliveTracker." am: 3dbbfa10bb am: 2e7172387e am: 7122f9b616
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1361907

Change-Id: I69f4f8073b057f294e0665ab7b1dcf57818d3089
2020-08-07 06:17:00 +00:00
Lorenzo Colitti
7122f9b616 Merge "Fix fd leak in KeepaliveTracker." am: 3dbbfa10bb am: 2e7172387e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1361907

Change-Id: I68dcb3da95c803179733861604e092582eefb254
2020-08-07 06:02:12 +00:00
Lorenzo Colitti
2e7172387e Merge "Fix fd leak in KeepaliveTracker." am: 3dbbfa10bb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1361907

Change-Id: I13df61b292a9ec964854641ba170d39caf66125a
2020-08-07 05:48:00 +00:00
Lorenzo Colitti
3dbbfa10bb Merge "Fix fd leak in KeepaliveTracker." 2020-08-07 05:40:33 +00:00
Chalard Jean
3103a6ee03 Add a test for starting the legacy VPN.
The legacy VPN has, among many parameters, a host to connect to.
This host can be specified as a numeric address, or as a hostname.
When it's a name, resolution is required. Currently, name
resolution is performed by the native VPN daemons racoon and
mtpd. When a hostname is used, the framework does not know the
IP address of the VPN server and does not add a throw route for
the VPN server IP address. On older kernels this does not matter
because the legacy PPP kernel code binds the PPP socket to the
right network, but on newer devices that use the upstream PPP
code, this does not work. See b/133797637.

This patch instruments the legacy VPN code so that it can be
run in tests, and uses this instrumentation to simulate passing
a configuration that contains a host, and verifies that the
arguments passed to the mptd and racoon daemons receive the
expected server address, and that the expected throw route is
correctly installed.
It then adds two tests : one specifying the server as a numeric
address, and one as a hostname. As the resolution is currently
broken, the latter of these tests is added disabled, and the
followup fix to the issue enables it.

This test is basic and very targeted, but it's what we need right
now. Also there are plans to remove this entire code path in S, so
the test being ad-hoc is not much of a problem.

Test: this
Bug: 158974172
Change-Id: I96f4bbb9b109e3e5813d083bed1989d88fb156b8
Merged-In: I3c4a94181bd71df68121fa0f71669fa4fa588bdd
(cherry picked from commit dece7f3f74cb67f2a046f3a2a9757b559abc2aac)
2020-08-07 05:11:43 +00:00
Josh Gao
461a122ae6 Fix fd leak in KeepaliveTracker.
The semantics of FileDescriptor in AIDL are that the callee must close
the file descriptor it receives manually.

Bug: http://b/157789860
Test: treehugger
Change-Id: Ice9fc9abe2959a84ad138a95c900dff676653665
2020-08-07 03:22:38 +00:00
Chalard Jean
60e6582dcb Merge "Resolve the endpoint in legacy VPN" am: f54a70cdcd am: 616cc3dca9 am: 3285d0fca0 am: 678245fef4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1382496

Change-Id: I38622f04de2e66d11115318831a83667a76ef02c
2020-08-06 16:54:25 +00:00
Chalard Jean
24ed610da6 Merge "Add a test for starting the legacy VPN." am: 20c118c89d am: 84561026d0 am: 013486d930 am: 7b76f806dd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1372896

Change-Id: I82638711fc39d6d29d618d7a1732351dbbaf780b
2020-08-06 16:54:00 +00:00
Chalard Jean
678245fef4 Merge "Resolve the endpoint in legacy VPN" am: f54a70cdcd am: 616cc3dca9 am: 3285d0fca0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1382496

Change-Id: I96691f6091c43377f23a00621242ed034fcb0444
2020-08-06 16:35:54 +00:00
Chalard Jean
7b76f806dd Merge "Add a test for starting the legacy VPN." am: 20c118c89d am: 84561026d0 am: 013486d930
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1372896

Change-Id: I3c4a94181bd71df68121fa0f71669fa4fa588bdd
2020-08-06 16:35:30 +00:00
Chalard Jean
3285d0fca0 Merge "Resolve the endpoint in legacy VPN" am: f54a70cdcd am: 616cc3dca9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1382496

Change-Id: If649ab2763c9971c25af7732b32e97bfd50fb6f0
2020-08-06 16:06:20 +00:00
Chalard Jean
013486d930 Merge "Add a test for starting the legacy VPN." am: 20c118c89d am: 84561026d0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1372896

Change-Id: Idc49c61cc0547cdabe37cfa19b685c2beeda473b
2020-08-06 16:06:08 +00:00
Chalard Jean
616cc3dca9 Merge "Resolve the endpoint in legacy VPN" am: f54a70cdcd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1382496

Change-Id: I732bb2282cf5b4ba74653ecc0bd934bf991649de
2020-08-06 13:10:36 +00:00
Chalard Jean
84561026d0 Merge "Add a test for starting the legacy VPN." am: 20c118c89d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1372896

Change-Id: I31352ae32ddeba4a37cc37bdcf6d7568f63fd70a
2020-08-06 13:10:20 +00:00
Chalard Jean
f54a70cdcd Merge "Resolve the endpoint in legacy VPN" 2020-08-06 12:51:50 +00:00
Chalard Jean
20c118c89d Merge "Add a test for starting the legacy VPN." 2020-08-06 12:50:50 +00:00
Chalard Jean
950d10f9cb Resolve the endpoint in legacy VPN
This adds code to resolve the endpoint in the legacy VPN
runner if it was specified as a hostname, and enables the
previously added test that was disabled because this was
broken until this patch. See the linked bug for details.

This patch uses the async DNS API to do the resolution.
This lets the resolution be fully cancellable, though the
code is more complex than with the non-interruptible
getByName.

Test: VpnTest and in particular VpnTest#testStartRacoon
      Fixes the test meant to test this
      Also manual testing that resolution of a real
      hostname works as expected, that failure to resolve
      returns correctly, and that cancellation/interruption
      will unblock the thread and terminate immediately.
Bug: 158974172
Change-Id: I714985f3c7919dad9c1854830c50f29c1f94a21e
2020-08-06 17:29:59 +09:00
Chalard Jean
c9077f2a38 Add a test for starting the legacy VPN.
The legacy VPN has, among many parameters, a host to connect to.
This host can be specified as a numeric address, or as a hostname.
When it's a name, resolution is required. Currently, name
resolution is performed by the native VPN daemons racoon and
mtpd. When a hostname is used, the framework does not know the
IP address of the VPN server and does not add a throw route for
the VPN server IP address. On older kernels this does not matter
because the legacy PPP kernel code binds the PPP socket to the
right network, but on newer devices that use the upstream PPP
code, this does not work. See b/133797637.

This patch instruments the legacy VPN code so that it can be
run in tests, and uses this instrumentation to simulate passing
a configuration that contains a host, and verifies that the
arguments passed to the mptd and racoon daemons receive the
expected server address, and that the expected throw route is
correctly installed.
It then adds two tests : one specifying the server as a numeric
address, and one as a hostname. As the resolution is currently
broken, the latter of these tests is added disabled, and the
followup fix to the issue enables it.

This test is basic and very targeted, but it's what we need right
now. Also there are plans to remove this entire code path in S, so
the test being ad-hoc is not much of a problem.

Test: this
Bug: 158974172
Change-Id: I420b63db03a58e8c67a98a85c9f4c2d6ed7ad078
(cherry picked from commit 45846a03051a13d667732288e457eab4336a691e)
2020-08-06 17:16:00 +09:00
Automerger Merge Worker
21fba22687 Merge "[automerger skipped] Merge "Update language to comply with Android's inclusive language guidance" am: 56f5e6595b am: 9c3acacc5c -s ours" into rvc-dev-plus-aosp am: 4f547ed394 -s ours am: 4439de64d5 -s ours
am skip reason: Change-Id I971050a2665c177870ff257bd0f41343db702892 with SHA-1 2349cf350b is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1380906

Change-Id: Ib217f70780c55828d2705f856af135db53e87710
2020-08-03 22:03:43 +00:00
Automerger Merge Worker
4439de64d5 Merge "[automerger skipped] Merge "Update language to comply with Android's inclusive language guidance" am: 56f5e6595b am: 9c3acacc5c -s ours" into rvc-dev-plus-aosp am: 4f547ed394 -s ours
am skip reason: Change-Id I971050a2665c177870ff257bd0f41343db702892 with SHA-1 2349cf350b is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1380906

Change-Id: I0f2f489b8b6cddfbf86838e0acf48857fe740a6f
2020-08-03 21:50:57 +00:00
Alex Light
ba0de0c9bb [automerger skipped] Merge "Update language to comply with Android's inclusive language guidance" am: 56f5e6595b am: 9c3acacc5c -s ours
am skip reason: Change-Id I971050a2665c177870ff257bd0f41343db702892 with SHA-1 2349cf350b is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1380906

Change-Id: I267d10e1c9875e011c474ac1911a5a737cb3a86f
2020-08-03 21:25:57 +00:00
Alex Light
9c3acacc5c Merge "Update language to comply with Android's inclusive language guidance" am: 56f5e6595b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1380906

Change-Id: Id2829bcdfb836db02db9842bb250e2eb628495aa
2020-08-03 21:01:33 +00:00
Alex Light
d9b1b9daeb Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 162536543
Test: Treehugger
Change-Id: I971050a2665c177870ff257bd0f41343db702892
Merged-In: I971050a2665c177870ff257bd0f41343db702892
2020-08-03 17:04:58 +00:00
TreeHugger Robot
03f0c69df2 Merge "Update language to comply with Android's inclusive language guidance" into rvc-dev-plus-aosp am: e56c1961e6 am: da22bd6c2a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12282658

Change-Id: I293b49f1061181f07c9affad5922472ddfdf50ad
2020-08-03 16:41:37 +00:00
TreeHugger Robot
da22bd6c2a Merge "Update language to comply with Android's inclusive language guidance" into rvc-dev-plus-aosp am: e56c1961e6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12282658

Change-Id: I439c446bcd55b35ec41d7c4f76a53e39de5cdd4e
2020-08-03 16:17:14 +00:00
TreeHugger Robot
e56c1961e6 Merge "Update language to comply with Android's inclusive language guidance" into rvc-dev-plus-aosp 2020-08-03 15:49:46 +00:00
Paul Hu
a41e0d4e60 Merge "[RFPM04] Adjust hasRestrictedNetworkPermission method" am: 2933a04749 am: 6f9bce51aa am: 80804587f2 am: faff1426cd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1321322

Change-Id: I564421416ae29ce7ccd7cee19787f8263a862529
2020-08-03 11:57:37 +00:00
Paul Hu
faff1426cd Merge "[RFPM04] Adjust hasRestrictedNetworkPermission method" am: 2933a04749 am: 6f9bce51aa am: 80804587f2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1321322

Change-Id: I3a376716eb2e3d25aa60921265ffbe3dc8f093a6
2020-08-03 11:43:15 +00:00
Paul Hu
80804587f2 Merge "[RFPM04] Adjust hasRestrictedNetworkPermission method" am: 2933a04749 am: 6f9bce51aa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1321322

Change-Id: Id91c6de75e524080d15e2508007d5de997c7fd92
2020-08-03 11:18:31 +00:00
Paul Hu
6f9bce51aa Merge "[RFPM04] Adjust hasRestrictedNetworkPermission method" am: 2933a04749
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1321322

Change-Id: I54758c3e9ec37c68d45360afb10a322f749564a9
2020-08-03 10:56:42 +00:00
Paul Hu
2933a04749 Merge "[RFPM04] Adjust hasRestrictedNetworkPermission method" 2020-08-03 10:37:52 +00:00
Alex Light
2349cf350b Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 162536543
Test: Treehugger
Change-Id: I971050a2665c177870ff257bd0f41343db702892
2020-07-31 08:18:33 -07:00
Peter Wang
badd63fe0a [automerger skipped] Merge "[Telephony Mainline] Rename getActiveAndHiddenSubscriptionIdList and guard with permission" am: c80aabbd2e am: 1cd92f18b3 -s ours am: a4903ada1e -s ours am: eff3103141 -s ours
am skip reason: Change-Id I7f3b1f5170e032336d9b39b322c49e2b92573586 with SHA-1 ceba2adbbd is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1260749

Change-Id: Ic30f3dc44333a759d86920c5c9d8588d5142eec3
2020-07-31 10:18:58 +00:00
Peter Wang
eff3103141 [automerger skipped] Merge "[Telephony Mainline] Rename getActiveAndHiddenSubscriptionIdList and guard with permission" am: c80aabbd2e am: 1cd92f18b3 -s ours am: a4903ada1e -s ours
am skip reason: Change-Id I7f3b1f5170e032336d9b39b322c49e2b92573586 with SHA-1 ceba2adbbd is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1260749

Change-Id: Ic15254afce6f13f0553faf9ec98fc16fe9563c81
2020-07-31 09:55:23 +00:00
Peter Wang
a4903ada1e [automerger skipped] Merge "[Telephony Mainline] Rename getActiveAndHiddenSubscriptionIdList and guard with permission" am: c80aabbd2e am: 1cd92f18b3 -s ours
am skip reason: Change-Id I7f3b1f5170e032336d9b39b322c49e2b92573586 with SHA-1 ceba2adbbd is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1260749

Change-Id: I1e06f6cdb0e69e06cf94a543eec83478dabeda14
2020-07-31 09:34:47 +00:00
Peter Wang
1cd92f18b3 Merge "[Telephony Mainline] Rename getActiveAndHiddenSubscriptionIdList and guard with permission" am: c80aabbd2e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1260749

Change-Id: I43a19b479d4c77bb19af31381e7d998527bc068a
2020-07-31 09:04:43 +00:00
Peter Wang
c80aabbd2e Merge "[Telephony Mainline] Rename getActiveAndHiddenSubscriptionIdList and guard with permission" 2020-07-31 08:43:44 +00:00
Chalard Jean
c582b2df35 Merge "Move utils from network stack to libs." am: 21be4fabb5 am: 64573a945a am: f438cf39b7 am: dcaa22ecae
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1350083

Change-Id: I91978c34aa86b30969fdb90e57c1edd862a53a51
2020-07-31 01:28:32 +00:00
Chalard Jean
dcaa22ecae Merge "Move utils from network stack to libs." am: 21be4fabb5 am: 64573a945a am: f438cf39b7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1350083

Change-Id: I56d148261c5fe94264ff0a68e87020329d06b857
2020-07-31 01:12:13 +00:00
Chalard Jean
f438cf39b7 Merge "Move utils from network stack to libs." am: 21be4fabb5 am: 64573a945a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1350083

Change-Id: Ia163bc416e16ce56fc96855c1111a9905b712843
2020-07-31 01:09:46 +00:00
Chalard Jean
64573a945a Merge "Move utils from network stack to libs." am: 21be4fabb5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1350083

Change-Id: I846dae9b7e36ddf6360bb946cc07beb8c44a34a5
2020-07-31 00:53:12 +00:00
Chalard Jean
3b7591e1f5 Move utils from network stack to libs.
This package is using some common utilities from
a library that used to live in the network stack.
A better home for these utilities is frameworks/libs,
so this topic moves the files ther and also changes
the package of some utilities.

See aosp/1350222 and aosp/1350182 for a detailed
description of the specific files that moved.

Test: checkbuild
Change-Id: I76a9b7790f3997e3e6b3c2f75ba6308286457cde
2020-07-29 21:15:48 +09:00
Paul Hu
4c71bc2ac7 Merge "[RFPM03] Check permission by uid." am: 563de5b8c7 am: 77cba9c18e am: 8fdd2ff899 am: e2524b7a56
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1320375

Change-Id: I9d621e1342d2e8b7b4e7b0fb72303dad411abce0
2020-07-29 06:28:47 +00:00
paulhu
de5b46c10b [RFPM04] Adjust hasRestrictedNetworkPermission method
There are two parts in hasRestrictedNetworkPermission method.
One is carryover package check and one is uid permission
check. Seperate carryover package check part to another method
to be clearer the usage of hasRestrictedNetworkPermission method.

Bug: 132784544
Test: atest FrameworksNetTests
Change-Id: Iab0609fcaa52acb0dfcb31ca957f22bfe8d62392
2020-07-29 14:14:27 +08:00
Paul Hu
e2524b7a56 Merge "[RFPM03] Check permission by uid." am: 563de5b8c7 am: 77cba9c18e am: 8fdd2ff899
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1320375

Change-Id: I35df9a8bb721f1303f351dbb115b09e911ea9a69
2020-07-29 06:13:35 +00:00