Commit Graph

5464 Commits

Author SHA1 Message Date
Chalard Jean
b8702350ac Merge changes I4b1bca8b,Idb7d2f28,I4825e632 am: 84d4e535ae
am: fb5f0d1c37

Change-Id: Iea011d1dc5df03b58fcbb9dcbd4833b20cb5b5a8
2018-06-18 04:07:09 -07:00
Chalard Jean
fb5f0d1c37 Merge changes I4b1bca8b,Idb7d2f28,I4825e632
am: 84d4e535ae

Change-Id: I7278ffe7ca8e25b040d6bce7fb880ccf0984f6ee
2018-06-18 03:06:05 -07:00
Chalard Jean
240b6be537 Merge changes I6abd2221,I2c149d29,I45d22857,I1f879b2c,If4986a25, ... am: 6c0106b57f
am: 24749e0b40

Change-Id: Ica8e290909a34976e00bebbb622dd49d8f0d6b8d
2018-06-12 07:04:45 -07:00
Chalard Jean
24749e0b40 Merge changes I6abd2221,I2c149d29,I45d22857,I1f879b2c,If4986a25, ...
am: 6c0106b57f

Change-Id: I86bc83e2bd859b48017f12832e9ff0080ec162b8
2018-06-12 06:57:33 -07:00
Chalard Jean
fe357814b4 [PT09] Add javadoc comments to all ProxyTracker methods/members.
Also rename some vars and inline a function that is now private.

Test: runtest
Change-Id: I4b1bca8b29f46d97056973cd38ed8effc3f5b591
2018-06-12 19:03:16 +09:00
Chalard Jean
d9e70ac17e [PT08] Move setDefaultProxy to ProxyTracker
Test: runtest
Change-Id: Idb7d2f2895aac63d54e3a6481379b739a726eff6
2018-06-12 19:03:16 +09:00
Chalard Jean
8cbd2dd7e4 [PT06] Move setGlobalProxy into ProxyTracker
Test: runtest
Change-Id: I6abd2221882db368a411b7174c66d8bd3b6b5110
2018-06-12 19:03:15 +09:00
Chalard Jean
e18083062e [PT07] Small cleanup of setGlobalProxy
Test: runtest
Change-Id: I4825e6326f7ce7bd45d625d57824f8d27c51d6f2
2018-06-12 19:03:15 +09:00
Chalard Jean
5c0ca509d5 [PT05] Move sendProxyBroadcast into ProxyTracker.
Test: runtest
Change-Id: I2c149d29d4b75d3978021b940b6bc58f677b8d17
2018-06-12 19:03:15 +09:00
Chalard Jean
faf4a2083d [PT04] Move PacManager into ProxyTracker.
Test: runtest
Change-Id: I45d22857459fe1746d484ac04f8d5cd81fc61835
2018-06-12 19:03:15 +09:00
Chalard Jean
777e2e59e6 [PT03] Move some more code into ProxyTracker.
Add finals and annotations. Remove comments that have lost their
context (they were in the context of disabling a permission check
that had been added, but constituted an API change that would not
serve any real purpose).

Test: runtest
Change-Id: I1f879b2c105d2127072b88233d72097a0d78fe14
2018-06-12 19:03:15 +09:00
Chalard Jean
7d97afc73f [PT02] Move static methods to ProxyTracker
No logic changes. Only changes are adding nullability annotations,
final modifiers, and adding an s in a comment.

Test: runtests
Change-Id: If4986a25bb36819de8ff459c4c0439c56d4e5a50
2018-06-12 19:03:14 +09:00
Chalard Jean
5d70ba4502 [PT01] Introduce ProxyTracker
The goal of this is to simplify ConnectivityService by reducing
the amount of code it contains. This is small enough to be obviously
correct and followup changes will move code into this class.

Test: runtest
Change-Id: Ic5ab19b521e98ae397c9bf657856820304362fbb
2018-06-12 19:03:14 +09:00
Chalard Jean
0ceb26580f Remove a useless parameter.
This argument is useless because all its callers pass the same
value : false.

Test: runtest
Change-Id: Id921caa4ffadef535a5bbcfea052283a07320b28
2018-06-12 19:03:14 +09:00
Chalard Jean
040a41f850 Small cleanup of Network.
Test: runtest
Change-Id: I56dbd37bb8f890938d360f45835de72be4beb91a
2018-06-12 19:03:14 +09:00
Chalard Jean
d51966a41b Cleanup of LinkProperties.
Test: runtest
Change-Id: I7299de93a79901635ce755a2d933666ee43767d5
2018-06-12 19:03:07 +09:00
Chalard Jean
c902f8cfa9 Merge changes Ifd7d73ad,Id79096fa am: abf2a3f652
am: d5a1bfbef2

Change-Id: Ibce24e5d55e728a1a08f534fa91b3be0bbc3b990
2018-06-11 07:16:08 -07:00
Chalard Jean
d5a1bfbef2 Merge changes Ifd7d73ad,Id79096fa
am: abf2a3f652

Change-Id: I263f51ba2aafdf8e19e020b2a4f6ff1b8238fa3c
2018-06-11 06:12:34 -07:00
Treehugger Robot
abf2a3f652 Merge changes Ifd7d73ad,Id79096fa
* changes:
  Bugfixes in LinkProperties#toString
  Cleanup of ConnectivityManager.
2018-06-11 11:54:21 +00:00
Chalard Jean
d3930f170a Bugfixes in LinkProperties#toString
We should stop trying to use a human brain to write code

Test: manual
Change-Id: Ifd7d73ad65de0f671466080beacbd97287e17bfe
2018-06-11 18:48:37 +09:00
Chalard Jean
9dd116103e Cleanup of ConnectivityManager.
This is not exhaustive, but still an undeniable improvement.

Test: runtest frameworks-net
Change-Id: Id79096faf20eec80de7c17b261ef338b895af1e0
2018-06-11 18:48:37 +09:00
Chalard Jean
5ff96261dd Merge "No-op cleanup of ConnectivityService." am: a706027ff9
am: ee3bcc9b8b

Change-Id: I7fae0ed908cca7a4e23c37536f59b4c5df0be862
2018-06-10 22:17:20 -07:00
Chalard Jean
ee3bcc9b8b Merge "No-op cleanup of ConnectivityService."
am: a706027ff9

Change-Id: I9ec9633a85b8b2298f90419da2a73c540b6e6805
2018-06-10 22:09:18 -07:00
Treehugger Robot
a706027ff9 Merge "No-op cleanup of ConnectivityService." 2018-06-11 04:57:31 +00:00
junyulai
da4c42131e Merge "Copy clat modified linkProperties into new one." am: 7d13e7cebe
am: 2f364968b2

Change-Id: If39f47cc2caf6a119ff7e237cd8a06b069dca04e
2018-06-10 21:51:42 -07:00
junyulai
2f364968b2 Merge "Copy clat modified linkProperties into new one."
am: 7d13e7cebe

Change-Id: Ia1f9ab3d5c3b889beddb4dda56ad3389c4967275
2018-06-10 21:44:16 -07:00
Treehugger Robot
7d13e7cebe Merge "Copy clat modified linkProperties into new one." 2018-06-11 03:26:26 +00:00
Nathan Harold
1ea5d9ecbc Merge "Disable the AppOp Restriction for IpSec Tunnels" into stage-aosp-master
am: bda7c96038

Change-Id: I98f2a964b3035daf93b54dc2b72561b16d2ded92
2018-06-09 09:25:32 -07:00
Xin Li
98a949b0ee Skip 9fe9ec18c1 in proposed pi-dev-plus-aosp-without-vendor merge.
am: db82c4c8f8

Change-Id: I1a6504799a83d2736881b149a5181e78bc212193
2018-06-09 02:18:01 -07:00
nharold
42b7fcbadd [automerger skipped] Merge changes from topic "ipsec-sync-with-pi" am: ff904be7a9
am: 9fe9ec18c1  -s ours

Change-Id: Ib18c4a534b8b1f611d0d5b02897afe73055fed6e
2018-06-08 18:31:25 -07:00
Nathan Harold
1db89848ab Disable the AppOp Restriction for IpSec Tunnels
This CL temporarily removes the AppOp restriction
that disallows creation of IpSec tunnels due to
the lack of the appropriate AppOp in AOSP/master.
When the relevant framework merges out to master,
this CL should be reverted.

Manually merging this due to skipping a merge
conflict at 9fe9ec18c1

Bug: none
Test: compilation
Change-Id: Ic06c193f85f6bcdd0ead4238825c1add78703cde
2018-06-08 23:23:04 +00:00
Xin Li
db82c4c8f8 Skip 9fe9ec18c1 in proposed pi-dev-plus-aosp-without-vendor merge.
Bug: 79597307
Change-Id: I8ac04fdd94b069434e2f00b0bfab63eb916f6129
2018-06-08 14:36:00 -07:00
nharold
9fe9ec18c1 Merge changes from topic "ipsec-sync-with-pi"
am: ff904be7a9

Change-Id: Ic91ed8f496163c560c6f1fd306bc74e5fecb61c2
2018-06-08 12:34:09 -07:00
nharold
ff904be7a9 Merge changes from topic "ipsec-sync-with-pi"
* changes:
  Disable the AppOp Restriction for IpSec Tunnels
  Rework Exception Handling for IpSecManager
  Update IpSecManager to use InetAddress and prefixLen
  Add AppOps Checks for MANAGE_IPSEC_TUNNELS
  Add MANAGE_IPSEC_TUNNELS Permission
2018-06-08 17:07:11 +00:00
Chalard Jean
d6c33dcc5d No-op cleanup of ConnectivityService.
Funny how these things accumulate. Not exhaustive of course, but
still an improvement.
- Remove unused imports.
- Remove unused variables and members.
- Replace members with locals where applicable.
- Remove useless type parameters and explicit unboxings for Java 7.
- Conversely add the diamond operator for auto-genericity for
  Java 6.
- Reduce visibility of members where possible.

Test: runtest frameworks-net
Change-Id: I13586aee09b4cd1c87c525fafb5eee44dedb5360
2018-06-08 19:10:59 +09:00
junyulai
1ccc18576f Copy clat modified linkProperties into new one.
updateLinkProperties copied the linkProperties in networkAgent,
but the clat fix-up function did not copy stacked link into new one.
This caused an incorrect clat iface removal, and the IPv4 network
 to be unreachable.

Clean cherry-pick of ag/4260470

Bug: 80261579
Test: 1. ping after ipv6 only data call with 2g voice call on/off
      2. runtest frameworks-net
      3. run cts -m CtsNetTestCases
Change-Id: Ide47a3b0680dddfcf3e2e759a59b19aee3605050
2018-06-08 16:28:32 +09:00
Nathan Harold
71fc014f00 Disable the AppOp Restriction for IpSec Tunnels
This CL temporarily removes the AppOp restriction
that disallows creation of IpSec tunnels due to
the lack of the appropriate AppOp in AOSP/master.
When the relevant framework merges out to master,
this CL should be reverted.

Bug: none
Test: compilation
Change-Id: Ic06c193f85f6bcdd0ead4238825c1add78703cde
2018-06-07 18:44:34 -07:00
Benedict Wong
ba38f8b79f Update IpSecManager to use InetAddress and prefixLen
LinkAddress constructors are currently @hide; this change updates
IpSecManager to use InetAddress and prefixLen, and then construct a
LinkAddress internally. LinkAddress is used over the binder interface to
IpSecService to ensure validity.

Bug: 77528639
Test: CTS, Java unit tests ran on walleye
Merged-In: I19e124adef6d9f4992d8293db3190bcf74c95848
Change-Id: I19e124adef6d9f4992d8293db3190bcf74c95848
(cherry picked from commit 2ea91aee42)
2018-06-07 18:42:52 -07:00
Nathan Harold
2a9b2c8165 Add AppOps Checks for MANAGE_IPSEC_TUNNELS
Adds support for a new AppOp to permit services to
use IpSec tunnel mode. The IpSecService now needs
a context so change the service mode to a cached
service rather than a static service.

Bug: 66955045
Test: runtest frameworks-net
Merged-In: I17a4a286225b432c3e15ea1587d946189931b4f4
Change-Id: I17a4a286225b432c3e15ea1587d946189931b4f4
(cherry picked from commit 68a7edf1cb)
2018-06-07 18:42:52 -07:00
android-build-team Robot
fdb470da63 Snap for 4826885 from a76360ddf1f709d71ac9efe55739f071ce843ca5 to pi-release
Change-Id: I38823c8a96dd5a25943a4218ae1c254a2f7feb46
2018-06-07 07:20:41 +00:00
Chalard Jean
e1bb81d9aa [automerger skipped] Merge changes Ia764b341,I4e4b41bb,I61b262d8,Ie6ace6bd,I21e866c7, ... am: b044b885cf
am: ed8bd59c1c  -s ours

Change-Id: I8c4838e96c77b58cbc7069c41c3c83a01b93ce7a
2018-06-06 03:08:03 -07:00
Chalard Jean
ed8bd59c1c Merge changes Ia764b341,I4e4b41bb,I61b262d8,Ie6ace6bd,I21e866c7, ...
am: b044b885cf

Change-Id: Ib54b132dae9e6ab4e01ee46a8afdcb2f50df2709
2018-06-06 03:00:49 -07:00
Jeff Sharkey
6ae4b88472 Let tests enumerate all transports/capabilities.
This gives them a way to collect all included values without
resorting to manual probing of each newly added value.

Cherry-pick of ag/4052941 with minor conflicts in the imports.

Bug: 16207332
Test: atest com.android.cts.net.HostsideVpnTests
Change-Id: Ia764b3412bf834890612378e0c3846913f4e0a06
Merged-In: Ie5cd22cfa2b6a60510fd1e31d7ebcd8f6cc890a0
Merged-In: If07e77c92046807235229a4f67ee087bdd7bccf1
2018-06-06 08:25:36 +00:00
Chalard Jean
43847bc10c Destroy networks as soon as they are disconnected.
...as opposed to after the async channel finished disconnecting.

Clean cherry-pick of ag/4043255

Bug: 78308259
Test: runtest frameworks-net
      also used a device with this patch over the weekend and
      tried all I could think of
Merged-In: Ic4c7520e907de353a01c2a3a8a50d661dee4a994
Merged-In: I0617f0ff6e46a1d3764335a1e7ad01b34c8cc5a8

Change-Id: I4e4b41bbdf25d7d7bea4124cb58da004d47f1090
2018-06-06 08:25:28 +00:00
Chalard Jean
8cfa434e53 Fix a ConcurrentModificationException crash.
This is a pinpoint fix against the bug listed below. While a client
is synchronously reading the LinkProperties of a network, the
ConnectivityServiceThread is updating its properties. Make sure
that update is done atomically.

This is a stopgap countermeasure against a problem that is
pervasive with usage of LinkProperties, but fixing the problem
itself will happen later.

Clean cherry-pick of ag/4174798

Bug: 80077223
Test: runtest frameworks-net
Change-Id: I61b262d824c98b4ced36395a597b73de9193a199
Merged-In: I25007ac26349e451bb47f966af70d590d699c347
Merged-In: I03526187645b6955eb89ca4d2e4a930ebac236b8
2018-06-06 08:25:19 +00:00
Chalard Jean
ec3d62faa5 Unify behavior of various cases of "no underlying networks"
Before this change, VPNs having no underlying networks would be
marked as metered as the safe option, but VPNs having only
disconnected underlying networks would be marked as unmetered.
Fix this discrepancy.

Clean cherry-pick of ag/4113809

Bug: 79748782
Test: runtest frameworks-net
Change-Id: Ie6ace6bd95139605ffcfa8cd6c15cf28f8fa28c8
Merged-In: If19b85325e7d684e645470293b3c8a674084c641
Merged-in: I22f80a6a39d4a19ff74aa61fcbd66f1a041b1003
2018-06-06 08:25:10 +00:00
Chalard Jean
22670f9b93 Fix: VPNs update caps upon underlying network disconnect.
Clean cherry-pick of ag/4083954

Bug: 79748782
Test: ConnectivityServiceTests still pass
Change-Id: I21e866c723099e5c3dee54ff13e830d44427fc7a
Merged-In: I12c948ebeb2b74290908f8320ff77220dc4a9fb9
2018-06-06 08:25:02 +00:00
Chalard Jean
32f9daa029 Add tests for setUnderlyingNetworks.
Fixes come later. This is complex enough as it is.

Clean cherry-pick of ag/4083953

Bug: 79748782
Test: new test passes, old tests still pass
Change-Id: If7276fe1f751be7b9c18f689e97699e566e5bde0
Merged-In: I12c948ebeb2b74290908f8320ff77220dc4a9fb9
2018-06-06 08:24:51 +00:00
Chalard Jean
52a6d547b7 Fix setCapabilities.
P introduced setSSID, UIDs and unwanted capabilities.
None of these exhibit commutative behavior through combineCapabilities
because their semantics don't allow it. Therefore
NetworkRequest.setCapabilities() is badly broken around any of
these. Look at the comments in the new tests to realize the
extent of the damage.

Clean cherry-pick of ag/4083952

Bug: 79748782
Test: new tests written, old tests pass
Change-Id: Iafe074126132a82af37f4bf056c4a7b8d56bdc83
Merged-In: Ia5bebf8a233775367bbf1b788870528934ecbcfb
Merged-In: I13d7782a6c0c7b1f94137995bbb0d257a58d89c1
2018-06-06 08:24:43 +00:00
Chalard Jean
d082c6c128 Fix SSID not being logged by the validation logs
Also add it in the logs of the notification manager.

Clean cherry-pick of ag/4022397

Bug: 78547904
Test: manual
Change-Id: I0afc18c94adf97154c61af2a5bdf933fb5f0e622
Merged-In: Iad5388a31a1502bc1944346276bb9600ac1386bd
Merged-In: I8bdd4a020e9d04f46847ef3c7e80ccf5c5cd19ea
2018-06-06 08:24:32 +00:00