Commit Graph

1321 Commits

Author SHA1 Message Date
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
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
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
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
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
2e7a6c1b8f Merge "Fix setCapabilities." into pi-dev
am: cb42feb502

Change-Id: I13d7782a6c0c7b1f94137995bbb0d257a58d89c1
2018-05-22 01:01:39 -07:00
Chalard Jean
cb42feb502 Merge "Fix setCapabilities." into pi-dev 2018-05-22 07:51:09 +00: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
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
299d856143 Add the list of private DNS addresses to LinkProperties
(clean cherry-pick from ag/3874803)

Test: atest android.net.LinkPropertiesTest, also new tests pass
Bug: 73641539
Change-Id: If33a35b1354a67db09411ff098f20064797296ad
Merged-In: I4b739c56e658690532ae9deb0b9a3bc9b2adf8b0
Merged-In: I6bdbef78d078d68534c8e07e9af031ce374560ef
2018-04-27 13:32:10 +09:00
Lorenzo Colitti
8e28cb01c4 Merge "Actually @hide unwanted capability methods." into pi-dev
am: 9d64b6e6b2

Change-Id: I80a88123b16c54734306da7e5dc0670972041648
2018-04-24 14:43:06 -07:00
Lorenzo Colitti
9d64b6e6b2 Merge "Actually @hide unwanted capability methods." into pi-dev 2018-04-24 21:20:25 +00:00
Lorenzo Colitti
88e7d8e3e5 Actually @hide unwanted capability methods.
Bug: 77601789
Test: builds, boots
Test: make doc-comment-check-docs
Change-Id: I7a913b83ab5110047d187564b3a1b0bbe1631942
2018-04-24 13:12:56 +09:00
Chalard Jean
2cc723e410 Merge "Add the list of private DNS addresses to LinkProperties" into pi-dev
am: f12a2130a4

Change-Id: I4b739c56e658690532ae9deb0b9a3bc9b2adf8b0
2018-04-20 04:49:43 -07:00
Chalard Jean
3e0a46a439 Add the list of private DNS addresses to LinkProperties
Test: atest android.net.LinkPropertiesTest, also new tests pass
Bug: 73641539
Change-Id: If33a35b1354a67db09411ff098f20064797296ad
2018-04-20 16:48:43 +09:00
Chalard Jean
33ada883b8 Merge "Add a new ssid field in NetworkCapabilities." into pi-dev
am: f920300665

Change-Id: Ia1f4e51b7c2e9118789242cf6d9e7576c4167cda
2018-04-13 02:14:02 -07:00
TreeHugger Robot
f920300665 Merge "Add a new ssid field in NetworkCapabilities." into pi-dev 2018-04-13 08:59:23 +00:00
Chalard Jean
3ec2c0fc84 Add a new ssid field in NetworkCapabilities.
Bug: 77891227
Test: frameworks-net
Change-Id: Ifba33ecd48ccecce7e8f8d05ff70bb85653f6163
2018-04-13 15:38:35 +09:00
Jeff Sharkey
d43f738892 Merge "APIs to disable data usage notifications." into pi-dev
am: d6e54408bd

Change-Id: I7b5bd380f00b6e94da79f43b354ecfc52df3f8e4
2018-04-11 16:14:26 -07:00
TreeHugger Robot
d6e54408bd Merge "APIs to disable data usage notifications." into pi-dev 2018-04-11 23:05:03 +00:00
Jeff Sharkey
7403f8207b APIs to disable data usage notifications.
Certain carriers have requested the ability to disable the warning,
limit, and rapid data usage notifications shown by the OS, so give
them that ability on a per-subId basis.  (The notifications are still
enabled by default.)

Unhide NOT_CONGESTED to match setSubscriptionOverrideCongested().

Fix bug in getPrimarySubscriptionPlanLocked() to find the first
currently active plan; the first non-recurring plan may be no longer
active.  Fix bug in SubscriptionPlan which allowed invalid negative
or zero-length Period objects.

Bug: 77851691, 77506882, 77662747
Test: atest com.android.server.NetworkPolicyManagerServiceTest
Test: atest android.telephony.cts.SubscriptionManagerTest
Exempt-From-Owner-Approval: SDK deadline, responding to API feedback
Change-Id: Ib6e6dbadd5022937c3f0661ab4b66aa617f0b5af
2018-04-11 22:07:40 +00:00
Pavel Maltsev
7b0fb3fa55 Merge "Remove unwanted capabilitiy from the java-doc" into pi-dev
am: d5b916a0a8

Change-Id: I7fef43cce3cfe17dae6a5e4f564ad8857371502a
2018-04-10 20:58:01 -07:00
TreeHugger Robot
d5b916a0a8 Merge "Remove unwanted capabilitiy from the java-doc" into pi-dev 2018-04-11 03:26:22 +00:00
Jeff Sharkey
a9d7daabce Merge "Disable roaming sanity checking." into pi-dev
am: aacd7eb672

Change-Id: I93bb07583ef90fb8c31c5c9a0c3e2c6e4968f975
2018-04-09 18:15:36 -07:00
Jeff Sharkey
ab5f8652d3 Disable roaming sanity checking.
We've traced down all code paths where NetworkInfo.isRoaming() and
NET_CAPABILITY_NOT_ROAMING can disagree, so we're only left with
noise that happens from NetworkAgent race conditions when someone
asks for a NetworkState between pending NetworkInfo and
NetworkCapabilities updates.

We can look at adding a way for a NetworkAgent to update these
two objects atomically, but not for this release.

Bug: 70174865
Test: builds, boots
Change-Id: I830e1fc6dc922e9eb7f8c2698d75181e00aaf7fb
2018-04-09 16:17:23 -06:00
Pavel Maltsev
47839a0cb4 Remove unwanted capabilitiy from the java-doc
Per API council feedback remove unwanted capaibility from public API
java docs

Bug: 77601789
Test: make docs
Test: build and flash
Change-Id: Ia7fd6d79546bf99448f8f2bda0370c7230ea4527
2018-04-09 13:16:00 -07:00
Lorenzo Colitti
9c5c37271c Remove unwanted capability code per API council feedback.
am: f4bdf74cd6

Change-Id: I359aad5d7dceb2b188544db18424598decf14c08
2018-04-06 19:56:30 -07:00
Lorenzo Colitti
f4bdf74cd6 Remove unwanted capability code per API council feedback.
The addition of hasUnwantedCapability was late in the release
cycle and does not simplify the API enough to be worth it. The
recommendation is, in a future release, to do something more
complete: not just add something like addUnwantedCapability, but
also deprecate all the NET_CAPABILITY_NOT_xxx constants and add
opposite NET_CAPABILITY_xxx constants for use with it.

Fix: 77601789
Test: builds, boots
Test: atest android.net.cts.NetworkRequestTest
Test: atest android.net.cts.ConnectivityManagerTest
Change-Id: Ib98fb01da4a4a0bae464787b589ad88f45002eb8
2018-04-06 23:02:51 +09:00
Pavel Maltsev
9c8a869f02 Merge "Add hasUnwantedCapability method" into pi-dev
am: 3d735d02d6

Change-Id: I7feec81a3f1525055030ee16f34b8e7251e79b9b
2018-04-04 10:15:10 -07:00
TreeHugger Robot
3d735d02d6 Merge "Add hasUnwantedCapability method" into pi-dev 2018-04-04 16:55:14 +00:00
Lorenzo Colitti
9b58dd356c Mark networks with OEM_PAID always restricted
Bug: 68762530
Test: runtest -x frameworks/base/tests/net/ -c android.net.NetworkCapabilitiesTest

Cherry-picked from AOSP with no conflicts

Merged-in: I173ee0a3bc1797d03ba34c5f025844eaada87ee4
Change-Id: I173ee0a3bc1797d03ba34c5f025844eaada87ee4
(cherry picked from commit efbacc0ccb70917b2782272e6b8f1a0fb3f56cbe)
2018-04-04 05:35:54 +00:00
Pavel Maltsev
2f3f53ee19 Merge "Make addUnwantedCapability method public" into pi-dev
am: 95f4b59348

Change-Id: I6d1676b72f125baf5b72e8718bd331a30b3c3c30
2018-04-02 21:47:22 +00:00
Pavel Maltsev
a389a03bd5 Add hasUnwantedCapability method
If you put values into the Builder, you should be able to observe
those values on the built object.

Test: atest android.net.cts.NetworkRequestTest

Bug: 74945408
Bug: 72828388
Change-Id: Ib4026b8d7370d570f1b606f0d221d00fed6e787d
2018-04-02 11:10:13 -07:00
TreeHugger Robot
95f4b59348 Merge "Make addUnwantedCapability method public" into pi-dev 2018-04-02 15:07:25 +00:00
Paul Jensen
6cdb34183b Fix socket leaks in various android.net.Network methods.
Bug: 72124526
Test: make CtsNetTestCases
Merged-In: I2a2254ce65c2176ae0be1d6276034b1bb0cad987
Merged-In: I23150482d6c2ab2eaa2b37732af68af69320792b
Change-Id: I3398b67272360f894e01a8cdfbc47b17d77c2330
(cherry picked from commit 55eaa09f96)
2018-03-30 12:20:35 -07:00
Pavel Maltsev
5e5bc33153 Merge "Add OEM_PAID capability to system api" into pi-dev
am: 07019bb20f

Change-Id: Ic164c4a29cd449a31b2f1c12c8c345bcc5dc77fa
2018-03-30 18:30:23 +00:00
Jeff Sharkey
c798269988 Merge "API council requested tweaks to NetworkRequest." into pi-dev
am: 93fc2b5049

Change-Id: I0d090ebb7d57689a061badcf593ae9a37d88f7ce
2018-03-30 18:22:13 +00:00
Pavel Maltsev
07019bb20f Merge "Add OEM_PAID capability to system api" into pi-dev 2018-03-30 16:32:52 +00:00
Jeff Sharkey
93fc2b5049 Merge "API council requested tweaks to NetworkRequest." into pi-dev 2018-03-30 16:30:24 +00:00
Paul Jensen
fffa078935 Merge "Fix socket leaks in various android.net.Network methods." into pi-dev
am: f26c5341a5

Change-Id: I2a2254ce65c2176ae0be1d6276034b1bb0cad987
2018-03-30 16:22:51 +00:00
Lorenzo Colitti
729b3b5f1f Merge "Add Network.fromNetworkHandle()" into pi-dev
am: c0b767a937

Change-Id: I22e68ab29982690dee5b2c0c6e1fbd47df0b0326
2018-03-30 14:55:48 +00:00
TreeHugger Robot
f26c5341a5 Merge "Fix socket leaks in various android.net.Network methods." into pi-dev 2018-03-30 09:47:51 +00:00
Lorenzo Colitti
3754e152e7 Merge "Mark networks with OEM_PAID always restricted" am: dbc568ceaf
am: e019e0e240

Change-Id: I88500f6add4f1a6c8a77eb976a489c11c7dc5b6d
2018-03-30 09:05:09 +00:00
Chalard Jean
24b861fa74 Merge "Clarify documentation for getActiveNetworkInfo and friends" am: b1016fbf14
am: bc4e495705

Change-Id: I339bb71182723907ed078e8be739c4d4ea2d1da5
2018-03-30 08:51:38 +00:00