Commit Graph

5656 Commits

Author SHA1 Message Date
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
android-build-team Robot
f1faa9bf0d Snap for 4813226 from 737d83180e4b1dd5ced0b5aff275e5e98e9bfa49 to pi-release
Change-Id: I4827f8fd89588d326230a9ab370b392d56ca80a8
2018-05-31 07:26:01 +00: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
android-build-team Robot
ae8690ac9a Snap for 4807121 from 6de8729657263d0dba112573298055d9396027d6 to pi-release
Change-Id: Ia6dce4a3bf6db94f344421e74795a23233b025fb
2018-05-27 07:25:05 +00: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
android-build-team Robot
5ab2e46ae6 Snap for 4801384 from b82d3d7e741ff8fe6bf7d1cae79d519fe4922d9a to pi-release
Change-Id: I43f3badb9f29c0d8d748b896eb3d83cf740a8d49
2018-05-24 07:26:26 +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
Remi NGUYEN VAN
f3eae13de9 Move CaptivePortalProbeResult to its own file
This is necessary to resolve visibility issues for the next change.

Bug: b/79499239
Test: runtest frameworks-net
Merged-In: Ia48b32307a51a66f2672d7112f71166dd6db41b1
Merged-In: I5df7ee9f16bc6be4f02353d40a843a383dd4cbd9
(Clean cherry-pick of pi-dev I50bc96afe6ae88c8f58a693f0a4e821f1f9b3299)

Change-Id: I3c416c1a91ebfdf914fd528ff8ab73e3eb490562
2018-05-24 12:04:27 +09:00
Chalard Jean
d9fffc3510 Destroy networks as soon as they are disconnected.
...as opposed to after the async channel finished disconnecting.

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

Change-Id: I77ad6d97abb20815b801a794eaa9685acf2d1173
2018-05-24 11:44:10 +09:00
Remi NGUYEN VAN
b2d7efe619 Merge "Add configurable captive portal probes" into pi-dev
am: 8ab8d5c74e

Change-Id: Iec7a74bbf2569a91e958c497200d77e8451cbf7b
2018-05-23 15:22:24 -07:00
Erik Kline
e32feea342 Merge "Fixup SntpClient to bypass Private DNS" into pi-dev
am: de0d35a229

Change-Id: I4655e3ce5691098c73bf070b8a9e4759485bb17a
2018-05-23 12:41:09 -07:00
Chalard Jean
4c6b2d7d40 Merge "Fix a ConcurrentModificationException crash." into pi-dev
am: 61d708ea4f

Change-Id: I03526187645b6955eb89ca4d2e4a930ebac236b8
2018-05-23 11:53:34 -07:00
Remi NGUYEN VAN
8ab8d5c74e Merge "Add configurable captive portal probes" into pi-dev 2018-05-23 14:26:39 +00:00
Remi NGUYEN VAN
c2491572d5 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
Change-Id: I785723aaed06054b9aa8ebff77803f23d7836db9
2018-05-23 20:48:46 +09:00
TreeHugger Robot
de0d35a229 Merge "Fixup SntpClient to bypass Private DNS" into pi-dev 2018-05-23 10:27:28 +00:00
android-build-team Robot
bfe89ab5d5 Snap for 4799153 from 3d00f35c758ce3b4f04f626e5711e6710cb1b8b0 to pi-release
Change-Id: I5ea3599d72f5834226fdcd4e5e9cafd217cd9ccf
2018-05-23 07:23:49 +00:00
Erik Kline
e5e21fd4b5 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
Change-Id: Id9ceb3fcaaffb48cbbd4cd381d48cae991572c9e
2018-05-23 16:03:03 +09:00
Chalard Jean
8397a84ea8 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.

Bug: 80077223
Test: runtest frameworks-net
Change-Id: I9302f8fb5303cb39aa82691d4f6d7f38707a41fa
2018-05-23 10:48:02 +09:00
Chalard Jean
8edc5b4398 Merge "Unify behavior of various cases of "no underlying networks"" into pi-dev
am: 468fdc3dd2

Change-Id: I22f80a6a39d4a19ff74aa61fcbd66f1a041b1003
2018-05-22 05:19:52 -07:00
Chalard Jean
9eee2c33d4 Merge changes Ic8231b18,I30009f88 into pi-dev
am: 200cad09c7

Change-Id: I12c948ebeb2b74290908f8320ff77220dc4a9fb9
2018-05-22 04:06:35 -07:00
Chalard Jean
f90bb339f5 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.

Bug: 79748782
Test: runtest frameworks-net
Change-Id: I51c3badde29f43f692f383553bd98327d2da8dd1
2018-05-22 18:50:00 +09:00
Chalard Jean
d4f01cadc0 Fix: VPNs update caps upon underlying network disconnect.
Bug: 79748782
Test: ConnectivityServiceTests still pass
Change-Id: Ic8231b18a17e6feb5ebafe8d5688fb59f9d4d58e
2018-05-22 18:49:58 +09:00
Chalard Jean
e2b9a76574 Add tests for setUnderlyingNetworks.
Fixes come later. This is complex enough as it is.

Bug: 79748782
Test: new test passes, old tests still pass
Change-Id: I30009f88e68a534c332ca88bae517cacc39a60bb
2018-05-22 18:25:33 +09:00
Remi NGUYEN VAN
a9ba4a9d29 Merge "Move CaptivePortalProbeResult to its own file" into pi-dev
am: 11d94b5742

Change-Id: Ia48b32307a51a66f2672d7112f71166dd6db41b1
2018-05-22 01:09:08 -07:00
Chalard Jean
2e7a6c1b8f Merge "Fix setCapabilities." into pi-dev
am: cb42feb502

Change-Id: I13d7782a6c0c7b1f94137995bbb0d257a58d89c1
2018-05-22 01:01:39 -07:00
Remi NGUYEN VAN
11d94b5742 Merge "Move CaptivePortalProbeResult to its own file" into pi-dev 2018-05-22 08:00:56 +00:00
Chalard Jean
cb42feb502 Merge "Fix setCapabilities." into pi-dev 2018-05-22 07:51:09 +00:00
Remi NGUYEN VAN
cabd8329f3 Move CaptivePortalProbeResult to its own file
This is necessary to resolve visibility issues for the next change.

Bug: b/79499239
Test: runtest frameworks-net
Change-Id: I50bc96afe6ae88c8f58a693f0a4e821f1f9b3299
2018-05-22 10:00:28 +09:00