Commit Graph

1489 Commits

Author SHA1 Message Date
Roshan Pius
00ef96bc0e NetworkAgent: Send primitive integer in explicitlySelected
|Boolean| object is not parcelable and hences crashes when the binder call
crosses a process boundary. Using a primitive integer instead to
represent the boolean value.

Bug: 112358948
Test: Device boots up and able to make wifi connection.
Change-Id: Iac69fd302e1f1338ed0da1446105ffc5855451cc
2018-08-10 07:44:33 -07:00
Roshan Pius
45190f8e7f Merge "NetworkAgent: Send primitive integer in score" 2018-08-10 14:33:07 +00:00
Roshan Pius
d594290fd9 NetworkAgent: Send primitive integer in score
|Integer| is not parcelable and hences crashes when the binder call
crosses a process boundary. Using a primitive integer should suffice
for sending the value to the server. There are no other usage of
|EVENT_NETWORK_SCORE_CHANGED| in the codebase.

Bug: 112358948
Test: Device boots up and able to make wifi connection.
Change-Id: I4c8fc17f4b803f69a4d882c71a8ce014a194d1ba
2018-08-09 07:10:27 -07:00
Remi NGUYEN VAN
c9f4d7be9e Merge "Add utils to convert Inet4Address <-> int"
am: 2587292cd1

Change-Id: I347d23f4682eca623e3b10f72bc9000b1c5954a3
2018-08-06 09:34:55 -07:00
Remi NGUYEN VAN
6e2a93cf9a Add utils to convert Inet4Address <-> int
The current utilities map the higher-order bytes of ints to the
lower-order bytes of IPv4 addresses, which makes applying masks and
generating series of addresses confusing.

For example, the current utilities would convert 1.2.3.4 to 0x04030201,
or generate 0x0080ffff for a /17 subnet mask. The utilities in this CL
convert 1.2.3.4 to 0x01020304, and a /17 subnet mask is represented as
0xffff8000.

Includes tests for all the above methods and migration of
NetworkUtilsTest to JUnit4.

Test: added tests pass
Change-Id: I5f5aa2e6e3b054b66b9dc507dab64f41be9139b1
2018-08-03 15:55:24 +09: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
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
d5a1bfbef2 Merge changes Ifd7d73ad,Id79096fa
am: abf2a3f652

Change-Id: I263f51ba2aafdf8e19e020b2a4f6ff1b8238fa3c
2018-06-11 06:12:34 -07: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
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
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
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
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
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