Commit Graph

5014 Commits

Author SHA1 Message Date
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
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
Bernie Innocenti
4c10a834f1 [automerger skipped] Merge changes from topic "apf-read-ram" am: b5dda0e316
am: e9c2a1aa3d  -s ours

Change-Id: I8fac093bd2a55d6c59856374fa31d88207fc7623
2018-05-21 10:32:00 -07:00
Bernie Innocenti
e9c2a1aa3d Merge changes from topic "apf-read-ram"
am: b5dda0e316

Change-Id: I80d70e5bce6d1a0903599e98d2d251459df1292a
2018-05-21 09:40:29 -07:00
Chalard Jean
e15627ef72 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.

Bug: 79748782
Test: new tests written, old tests pass
Change-Id: Ie46581bdaf9ecc2f14aab44788bbdb27a3fec8c1
2018-05-21 14:46:40 +09:00
Erik Kline
0e5c8f2092 Merge "Add explicit override for default Private DNS mode" into pi-dev
am: 2b3c858296

Change-Id: If480ab40c7cf9ab75c52feafc28338a049cbceef
2018-05-18 01:08:26 -07:00
Erik Kline
a7edf6ff56 Add explicit override for default Private DNS mode
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 79719289
Change-Id: I943c5476666e47d04690626e2133f501cb875b46
2018-05-17 17:41:12 +09:00
Jeff Sharkey
eb25084c11 Merge "Let tests enumerate all transports/capabilities." into pi-dev
am: 8e6445a1a5

Change-Id: Ie5cd22cfa2b6a60510fd1e31d7ebcd8f6cc890a0
2018-05-15 08:27:40 -07:00
Bernie Innocenti
4d93537e9a apf: Add counters for dropped / passed packets
ApfFilter maintains separate counters for each reason why a packet was
passed or dropped by the filter logic.

There's also a total which should match the individual counters,
*unless* the APF interpreter aborted execution early due to an illegal
instruction or an out-of-bounds access.

Test: both on APFv2 and APFv4-capable device:
	runtest -x tests/net/java/android/net/ip/IpClientTest.java
	runtest -x tests/net/java/android/net/apf/ApfTest.java
	manual tests connected to an AP
Bug: 73804303
Change-Id: I54b17fcbb95dfaea5db975d282314ce73d79d6ec
Merged-In: I54b17fcbb95dfaea5db975d282314ce73d79d6ec
(cherry picked from commit f1089bfa95)
2018-05-15 14:21:54 +09:00
Jeff Sharkey
7b6ed22507 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.

Bug: 16207332
Test: atest com.android.cts.net.HostsideVpnTests
Change-Id: I35ca412512dc8515b44d5518e1ca4caa5bdc678f
2018-05-14 17:17:33 -06:00
Chalard Jean
a642bf55db Merge "Fix SSID not being logged by the validation logs" into pi-dev
am: 322d916195

Change-Id: I8bdd4a020e9d04f46847ef3c7e80ccf5c5cd19ea
2018-05-09 23:07:34 -07:00
Chalard Jean
f2da177b59 Fix SSID not being logged by the validation logs
Also add it in the logs of the notification manager.

Bug: 78547904
Test: manual
Change-Id: I262e65efadb00e1efce5056771978053f304ca6f
2018-05-09 18:11:10 +09:00
Remi NGUYEN VAN
80770e423c Merge "Fix testRegisterUsageCallback" am: 899283d833
am: bc3a7a5ba5

Change-Id: If16708b5ce00dc374663e3c3dedd1d96342175f1
2018-05-08 02:13:00 -07:00
Remi NGUYEN VAN
bc3a7a5ba5 Merge "Fix testRegisterUsageCallback"
am: 899283d833

Change-Id: I7ec1e3a05971e8e0448289e3c3f979fd7dcfe144
2018-05-08 02:00:59 -07:00
Remi NGUYEN VAN
899283d833 Merge "Fix testRegisterUsageCallback" 2018-05-08 07:55:42 +00:00
Erik Kline
d221c95c92 [automerger skipped] Merge "Add static IpClient logging" am: 3f966e9c62
am: 946050d3fd  -s ours

Change-Id: If8e8dc57346e315462c4a6ff020f7dee16115d76
2018-05-03 05:15:34 -07:00
Erik Kline
946050d3fd Merge "Add static IpClient logging"
am: 3f966e9c62

Change-Id: Id566002382162a848de91b85559e69bc6f7ea28d
2018-05-03 05:05:05 -07:00
Erik Kline
3f966e9c62 Merge "Add static IpClient logging" 2018-05-03 10:44:30 +00:00
Erik Kline
d1de8fb748 Add static IpClient logging
Support keeping IpClient logs around and dumping them
during dumpsys.  Previously we got this benefit for
wifi by virtue of WifiStateMachine's long-lived nature.
Now that this is changing we need to be sure we have
logs, and this method gets us Ethernet logs as well.

Bug: 62476366
Bug: 77999594
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
    - dumpsys connmetrics [ipclient] works
Merged-In: Ib4daf0902cae91acadbe9965de1fb73c96a47bec
Merged-In: Ie947394fabcaca7fc1d067f095c2442ee2704593
Change-Id: I1136a83de8097fdb4130debe1eaf689be7132fe5
(cherry picked from commit 78b85e6ca3)
2018-05-03 18:00:09 +09:00
android-build-team Robot
79e87de9e2 Merge "Add static IpClient logging" into pi-dev
am: 8c9396a826

Change-Id: Ib4daf0902cae91acadbe9965de1fb73c96a47bec
2018-05-03 01:30:22 -07:00
android-build-team Robot
8c9396a826 Merge "Add static IpClient logging" into pi-dev 2018-05-03 08:19:43 +00:00
android-build-team Robot
20fe0c37a1 [automerger skipped] Merge changes from topic "ifaceStatsDetail" into pi-dev
am: 24596473b7  -s ours

Change-Id: Ia25540fd865f6040e2a5d943c19b2a12965c4d5b
2018-05-02 12:42:24 -07:00
Chenbo Feng
443bb79efc [automerger skipped] Remove the unused file parsing function
am: cf7567ba7a  -s ours

Change-Id: I264e9826246ebfc74cf74f8af623a428909a56e3
2018-05-02 12:32:53 -07:00
android-build-team Robot
24596473b7 Merge changes from topic "ifaceStatsDetail" into pi-dev
* changes:
  Remove the unused file parsing function
  Use eBPF map data for per iface stats
2018-05-02 19:17:27 +00:00
Erik Kline
78b85e6ca3 Add static IpClient logging
Support keeping IpClient logs around and dumping them
during dumpsys.  Previously we got this benefit for
wifi by virtue of WifiStateMachine's long-lived nature.
Now that this is changing we need to be sure we have
logs, and this method gets us Ethernet logs as well.

Bug: 62476366
Bug: 77999594
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
    - dumpsys connmetrics [ipclient] works
Change-Id: I1136a83de8097fdb4130debe1eaf689be7132fe5
2018-05-02 21:53:17 +09:00
Remi NGUYEN VAN
b1ff5a381e Fix testRegisterUsageCallback
noteOp (introduced in go/ag/3897834) checks that the calling uid matches
the calling package, which is not correct when using a fake calling
package. Use the real package of the test so permissions are checked
properly.

The test currently only fails this way in pi-dev as noteOp is only used
in pi-dev.
Change-Id: I9ac3717af9335ba9efa0b8842a2df0d7b69ec9ab
Test: Fixed test now passes in pi-dev
Bug: b/78487385
2018-05-02 16:51:13 +09:00
android-build-prod (mdb)
feed20b4e9 Merge changes from topic "ifaceStats" am: 3f675c25e0
am: 7df94359d4

Change-Id: I460bc25806182bc2dc5fcc2512ab01e776a0e8e6
2018-05-01 19:53:30 -07:00
Chenbo Feng
cf7567ba7a Remove the unused file parsing function
With the new xt_bpf support for iface stats. We no longer need to parse
the per interface stats from /proc/net/dev. And since the old xt_qtaguid
code path also not depend on it, we can completly remove that helper
function since no caller is depending on it now.

Bug: 72111305
Test: runtest frameworks-net -c com.android.internal.net.NetworkStatsFactoryTest
Change-Id: Icb7eaeef0eeb9fdffd32a90316c76ee05bafffbe
Merged-In: Icb7eaeef0eeb9fdffd32a90316c76ee05bafffbe
(cherry picked from aosp commit b815c978b81eee4b1494bd0b9d25bfad52f08b72)
2018-05-01 19:48:03 -07:00
android-build-prod (mdb)
7df94359d4 Merge changes from topic "ifaceStats"
am: 3f675c25e0

Change-Id: I0b564b2d3b13c0e5d033c5cf4aaddad3a750f2c7
2018-05-01 19:41:39 -07:00
android-build-prod (mdb)
3f675c25e0 Merge changes from topic "ifaceStats"
* changes:
  Remove the unused file parsing function
  Use eBPF map data for per iface stats
2018-05-02 01:19:23 +00:00
Chenbo Feng
84c1437111 Remove the unused file parsing function
With the new xt_bpf support for iface stats. We no longer need to parse
the per interface stats from /proc/net/dev. And since the old xt_qtaguid
code path also not depend on it, we can completly remove that helper
function since no caller is depending on it now.

Bug: 72111305
Test: runtest frameworks-net -c com.android.internal.net.NetworkStatsFactoryTest
Change-Id: Icb7eaeef0eeb9fdffd32a90316c76ee05bafffbe
2018-05-01 14:13:55 -07:00
Chalard Jean
a7e19aace2 [automerger skipped] Merge "Let DnsManager fill in LinkProperties for private DNSes" am: 6b5358f16e
am: 6bbbb06bc7  -s ours

Change-Id: I7a0f888a7f5f0e7424f6ad01fe155bbe48089b87
2018-05-01 02:12:52 -07:00