Commit Graph

5014 Commits

Author SHA1 Message Date
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
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
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
Chalard Jean
818f6b5c6a Make sure getActiveNetwork is consistent with default callbacks
Almost clean cherry-pick of ag/3889538.

Bug: 77737389
Test: runtest framework-net
      new test don't pass without the main code change, but they
      do with it
Change-Id: I0cd83a935ab0b349aa47e065b830e5a43ab9a091
Merged-In: Iaa0285825735d3f16bba6e4946723a437fd9b0b9
Merged-In: Ia8f985b448251f911484e6bd63fa562bffc1b0e4
2018-06-06 08:24:21 +00:00
Chalard Jean
d94e48ff95 Add tests for getActiveNetwork.
Clean cherry-pick of ag/3918295
One-line adjustment for ag/3638326 which has not been put in AOSP.

Bug: 77737389
Test: runtest frameworks-net
Change-Id: I03ae2bbb08559f2cd44979e291c1f5d50eb215da
Merged-In: Iaa0285825735d3f16bba6e4946723a437fd9b0b9
Merged-In: Ia8f985b448251f911484e6bd63fa562bffc1b0e4
2018-06-06 08:24:12 +00:00
Chalard Jean
4ea84827b3 Guard the SSID with NETWORK_SETTINGS
Clean cherry-pick of ag/3904260

Bug: 77865258
Test: manual
Change-Id: I2a2e236041797df495759dd4e07648545cad6c7c
Merged-In: Iba59e93875c28b8e30db0c013575bc2f117cb16c
Merged-In: I6cf364f0815a2eaab60f5de5e1d5ccc4908e9eca
2018-06-06 08:24:01 +00:00
Chalard Jean
390bee5f2c Add a new ssid field in NetworkCapabilities.
Clean cherry-pick of ag/3887737

Bug: 77891227
Test: frameworks-net
Change-Id: Icefe1657bca52b913a72b56705342a7285769658
Merged-In: Ia1f4e51b7c2e9118789242cf6d9e7576c4167cda
Merged-In: I6dd1aba6fde5a502b4a9145cf16393d8ce623c89
2018-06-06 08:23:52 +00:00
Chalard Jean
dd7d9f4c84 Notif manager and captive portal app to read SSID again
Cherry-picked from ag/3887738 ; almost clean CP, only had
to add an import.

Bug: 77114259
Test: frameworks-net pass
      manual test shows the SSID is now displayed again
Change-Id: I5cb2b4777ad78d972031e8f2ff22e2155f4ab894
Merged-In: I588fedba49ea5d08e40bd2b3ea8ba2c2383958ec
Merged-In: I663a59ff2847a9f44ea1395326f6cb00e97237b6
2018-06-06 08:23:43 +00:00
Pavel Maltsev
4fc3638fa7 Remove unwanted capability from the java-doc
Per API council feedback remove unwanted capaibility from public API
java docs

Clean cherry-pick from ag/3868438

Bug: 77601789
Test: make docs
Test: build and flash
Change-Id: I4f3b8b558e8dab2bcc9ef4cc6cfc3135c264c291
Merged-In: I7fef43cce3cfe17dae6a5e4f564ad8857371502a
Merged-In: Ib02988daf44dabfaef7a0b788385b7f7c655b8b2
2018-06-06 08:23:27 +00:00
Pavel Maltsev
5b7ec405f4 Actually @hide unwanted capability methods.
Cherry-pick of ag/3943779

Bug: 77601789
Test: builds, boots
Test: make doc-comment-check-docs
Merged-In: I80a88123b16c54734306da7e5dc0670972041648
Merged-In: I923e5377a1abe761217612452cbfdba752e53de2
2018-06-06 08:23:13 +00:00
Jeff Sharkey
20329ac8bb API council requested tweaks to NetworkRequest.
If you put values into the Builder, you should be able to observe
those values on the built object.

Clean cherry-pick of ag/3813257

Test: atest android.net.cts.NetworkRequestTest
Bug: 74945408
Change-Id: Ib28de279efb8b33ab46aa64f580e10fe5f8720e3
Merged-In: I0d090ebb7d57689a061badcf593ae9a37d88f7ce
Merged-In: I539184f7385c1f288cfb77be8307e4463e07e9e6
2018-06-06 08:23:00 +00:00
Pavel Maltsev
e023bc215d Add OEM_PAID capability to system api
Some system apps should be able to request OEM_PAID networks.  This
makes a lot of sense when Android is used as in-vehicle infotainment
systems.

Clean cherry-pick of ag/3782591

Bug: 68762530
Test: runtest -x frameworks/base/tests/net/ -c android.net.NetworkCapabilitiesTest
Change-Id: I306f060c5a386ff4b82cd99a03dc037ce60ded6a
Merged-In: Ic164c4a29cd449a31b2f1c12c8c345bcc5dc77fa
Merged-In: I6e9c4130db23a4f1c89ce7e9071ae519a2b0b7ec
2018-06-06 08:22:51 +00:00
mswest46
04f08d4dae add airplane mode shell commands to connectivity
Clean cherry-pick of ag/3718273

Change-Id: I302802afc952b9df7a5544b12d9015091997bd67
Fixes: 74410990
Test: Manually checked that commands enable/disable airplane mode.
Merged-In: I8787d642594e6852bff5b902e8d0fa380ce7c37f
2018-06-06 08:22:31 +00:00
Junyu Lai
893c6dc7f7 Merge "Copy clat modified linkProperties into new one." into pi-dev
am: 183ec8ee35

Change-Id: Icbaa50cde14a3d00e151c1175d214cbf186fa74a
2018-06-05 23:46:27 -07:00
junyulai
6adee26d73 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.

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-06 03:55:36 +00:00
Chad Brubaker
e90c0e624f Expose CONNECTIVITY_ACTION to Instant Apps
Clean cherry-pick of ag/3710436

Test: Broadcast is visible to Instant Apps
Bug: 69421898
Change-Id: Ibac92b5aa16bf1538776b90df5dc05362667e785
Merged-In: I0434f8c7292a85e25df3da2858e4d89cf55fab3d
Merged-In: I62ed2107d0b0712267a903e465cbeba6a4f0b346
2018-06-05 17:46:37 +09:00
Eric Enslen
24e3fe60a5 fix isActiveNetworkMetered with VPNs
Clean cherry-pick of ag/3580901
Bug: 72871435
Test: flashed and verified, also ran runtest framework-net
Merged-In: I177eff1237dd59514ccf91397a3d307148bc37b1

Change-Id: Ic5919a32f91f7baee5f1370703ad166e6ea52b58
2018-06-05 17:46:37 +09:00
Lorenzo Colitti
1b0ae341f8 Merge "Don't complain if a VPN changes capabilities." into pi-dev
am: c58ef904d5

Change-Id: I26d2e1526c21ad2bac369a565b06155780190692
2018-05-31 10:41:34 -07:00
Lorenzo Colitti
c58ef904d5 Merge "Don't complain if a VPN changes capabilities." into pi-dev 2018-05-31 03:03:04 +00:00
Benedict Wong
70d1f47f7d [automerger skipped] DO NOT MERGE: Add unit tests to ensure VPN meteredness am: f0713b5491 -s ours
am: e240835101

Change-Id: Iddfe4fcc6f7eca5ac94955205fb57296d6b029ad
2018-05-30 16:23:34 -07:00
Benedict Wong
e240835101 [automerger skipped] DO NOT MERGE: Add unit tests to ensure VPN meteredness
am: f0713b5491  -s ours

Change-Id: I7ce4d1327e4f26080bd1001fb8fa1d370d2bcb96
2018-05-30 16:10:46 -07:00
Lorenzo Colitti
614891d0d3 Don't complain if a VPN changes capabilities.
VPNs are not driven by NetworkRequests, so there's no risk of a
capability change on a VPN causing a connect/teardown loop.

Bug: 80439912
Test: builds, boots
Change-Id: Ic4c489ccc9fb97551d1ef440766f6cf6f99522db
2018-05-30 21:34:23 +09:00
Benedict Wong
f0713b5491 DO NOT MERGE: Add unit tests to ensure VPN meteredness
These new tests ensure that VPNs report the meteredness of their
underlying networks correctly. The added test verifies VPN meteredness
for cases of metered and unmetered WiFi and Cell

Bug: 78644887
Test: This; ran on walleye-eng
Change-Id: I28bdc71a336bfd97f7908455d4781d774df44b87
2018-05-25 22:11:51 +00:00
Remi NGUYEN VAN
2ec2c566de [automerger skipped] Merge "Migrating remaining core networking tests to Junit4" am: bbfe4d043f
am: 32bac17b46  -s ours

Change-Id: I7df578d4f89b94e50d9f3798fc675b6a93477200
2018-05-24 22:25:33 -07:00
Remi NGUYEN VAN
32bac17b46 Merge "Migrating remaining core networking tests to Junit4"
am: bbfe4d043f

Change-Id: I3d5c8274f76d00c61a384213ade1fae97c96ae24
2018-05-24 21:37:04 -07:00
Remi NGUYEN VAN
bbfe4d043f Merge "Migrating remaining core networking tests to Junit4" 2018-05-25 03:27:39 +00:00
Chalard Jean
ca583be98c Merge "Destroy networks as soon as they are disconnected." into pi-dev
am: d88abbfd78

Change-Id: I0617f0ff6e46a1d3764335a1e7ad01b34c8cc5a8
2018-05-24 13:35:45 -07:00
Remi NGUYEN VAN
d9b4e6ed93 [automerger skipped] Merge changes I3b3bcbbd,I18b3f263,I3c416c1a am: 3f6d2b08ad
am: 9197e8ce1d  -s ours

Change-Id: Ib1c7270ff0b4dff4f693d9d9a7330bd70ec7505d
2018-05-24 12:03:38 -07:00
Erik Kline
434ba70f98 [automerger skipped] Merge "Fixup SntpClient to bypass Private DNS" am: d0d510a6e0
am: ccd6c2cffd  -s ours

Change-Id: I544b4901f51e6c3038045ef8f7e838161e06ec39
2018-05-24 11:32:32 -07:00
Remi NGUYEN VAN
9197e8ce1d Merge changes I3b3bcbbd,I18b3f263,I3c416c1a
am: 3f6d2b08ad

Change-Id: I3bf92d8c1d1b4451b1af9dcb518b352ae40cc7ca
2018-05-24 10:57:46 -07:00
Erik Kline
ccd6c2cffd Merge "Fixup SntpClient to bypass Private DNS"
am: d0d510a6e0

Change-Id: I51e0e71f81307c38599c4bbac385ebafeb9f441f
2018-05-24 07:39:50 -07:00
Remi NGUYEN VAN
3f6d2b08ad Merge changes I3b3bcbbd,I18b3f263,I3c416c1a
* changes:
  Use CaptivePortalProbeSpec method in portal app
  Add configurable captive portal probes
  Move CaptivePortalProbeResult to its own file
2018-05-24 07:53:00 +00:00
Hugo Benichi
e17657c0f1 Migrating remaining core networking tests to Junit4
Bug: 62918393
Test: runtest frameworks-net
Merged-In: I30f7eaa0307b8fad5a8de7a0da235a4f76c18677
(clean cherry-pick of I30f7eaa0307b8fad5a8de7a0da235a4f76c18677)

Change-Id: I272fea0bb4a9e7f6252bb3bd14a6b769a082039e
2018-05-24 16:24:47 +09:00
Treehugger Robot
d0d510a6e0 Merge "Fixup SntpClient to bypass Private DNS" 2018-05-24 07:07:15 +00:00
Benedict Wong
687aa58f2e DO NOT MERGE: Fix ConnectivityController meteredness checks
This patch corrects ConnectivityController's meteredness checks to
perform correct meteredness checks while VPNs are running. This fixes a
bug in O-MR1 where any apps using the DownloadProvider with unmetered
network constraints fail to start while the VPN is enabled.

This change adds a bespoke method for ConnectivityController, allowing
it to correctly identify the meteredness without affecting public API
surfaces.

Bug: 78644887
Test: Built, flashed on Walleye, and tested.
Test: Additional test coverage in subsequent patch(es).
Change-Id: Ie1d11d93d51d936ce81cd5984af61bde30325983
2018-05-23 23:15:36 -07:00
Erik Kline
9cf1c8aca3 Fixup SntpClient to bypass Private DNS
NTP may be necessary in order to validate Private DNS certificates,
so it should be allowed to bypass Private DNS.

Test: as follows
    - built, flashed, booted
    - tcpdump for port 53; adb shell am restart
      queries for the NTP hostname appear in the clear
    - runtest frameworks-net passes
Bug: 64133961
Bug: 80118648
Merged-In: I4655e3ce5691098c73bf070b8a9e4759485bb17a
Merged-In: I327b816a9f472e94328232157a3b8887d17b0baf
Change-Id: Id9ceb3fcaaffb48cbbd4cd381d48cae991572c9e
(cherry picked from commit e5e21fd4b5)
2018-05-24 13:58:58 +09:00
Remi NGUYEN VAN
03d866a6a6 Add configurable captive portal probes
The probes allow testing for a configurable status code and location
header (regexes). They are disabled by default, so this CL is a
no-op unless the probe configurations are pushed.

Bug: b/79499239
Test: tests in CL pass, manual: captive portal login works
Merged-In: Iec7a74bbf2569a91e958c497200d77e8451cbf7b
Merged-In: Ia958815325d1466345e9626efc8f62fc9d08d774
(clean cherry-pick of pi-dev I785723aaed06054b9aa8ebff77803f23d7836db9)

Change-Id: I18b3f263fed08fa4fee20d5e88f3ec8647d7f835
2018-05-24 12:08:36 +09:00