Commit graph android_packages_modules_Co.../core/java
Message SHA1
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

Remi NGUYEN VAN   commited 2018-05-23 20:48:46 +09:00
c2491572d5
Add explicit override for default Private DNS mode
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 79719289
Change-Id: I943c5476666e47d04690626e2133f501cb875b46

Erik Kline   commited 2018-05-17 17:41:12 +09:00
a7edf6ff56
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

Jeff Sharkey   commited 2018-05-14 17:17:33 -06:00
7b6ed22507
Merge "Actually @hide unwanted capability methods." into pi-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2018-04-24 21:20:25 +00:00
9d64b6e6b2
Actually @hide unwanted capability methods.
Bug: 77601789
Test: builds, boots
Test: make doc-comment-check-docs
Change-Id: I7a913b83ab5110047d187564b3a1b0bbe1631942

Lorenzo Colitti   commited 2018-04-24 13:12:56 +09:00
88e7d8e3e5
Add the list of private DNS addresses to LinkProperties
Test: atest android.net.LinkPropertiesTest, also new tests pass
Bug: 73641539
Change-Id: If33a35b1354a67db09411ff098f20064797296ad

Chalard Jean   commited 2018-04-20 16:48:43 +09:00
3e0a46a439
Merge "Add a new ssid field in NetworkCapabilities." into pi-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2018-04-13 08:59:23 +00:00
f920300665
Add a new ssid field in NetworkCapabilities.
Bug: 77891227
Test: frameworks-net
Change-Id: Ifba33ecd48ccecce7e8f8d05ff70bb85653f6163

Chalard Jean   commited 2018-04-13 15:38:35 +09:00
3ec2c0fc84
Merge "APIs to disable data usage notifications." into pi-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2018-04-11 23:05:03 +00:00
d6e54408bd
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

Jeff Sharkey   commited 2018-04-11 22:07:40 +00:00
7403f8207b
Merge "Remove unwanted capabilitiy from the java-doc" into pi-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2018-04-11 03:26:22 +00:00
d5b916a0a8
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

Jeff Sharkey   commited 2018-04-09 16:17:23 -06:00
ab5f8652d3
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

Pavel Maltsev   commited 2018-04-09 13:16:00 -07:00
47839a0cb4
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

Lorenzo Colitti   commited 2018-04-06 23:02:51 +09:00
f4bdf74cd6
Merge "Add hasUnwantedCapability method" into pi-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2018-04-04 16:55:14 +00:00
3d735d02d6
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)

Lorenzo Colitti   authored and   Pavel Maltsev   commited 2018-04-04 05:35:54 +00:00
9b58dd356c
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

Pavel Maltsev   commited 2018-04-02 11:10:13 -07:00
a389a03bd5
Merge "Make addUnwantedCapability method public" into pi-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2018-04-02 15:07:25 +00:00
95f4b59348
Merge "Add OEM_PAID capability to system api" into pi-dev
Pavel Maltsev   authored and   Android (Google) Code Review   commited 2018-03-30 16:32:52 +00:00
07019bb20f
Merge "API council requested tweaks to NetworkRequest." into pi-dev
Jeff Sharkey   authored and   Android (Google) Code Review   commited 2018-03-30 16:30:24 +00:00
93fc2b5049
Merge "Fix socket leaks in various android.net.Network methods." into pi-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2018-03-30 09:47:51 +00:00
f26c5341a5
Merge "Clarify documentation for getActiveNetworkInfo and friends" into pi-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2018-03-30 08:22:29 +00:00
039947df6a
Clarify documentation for getActiveNetworkInfo and friends
For VPNs it's unobvious what these methods do, so document that.

Bug: 70917007
Test: Comment changes only. Checkdoc passes.
Change-Id: I31ec1aea356d88d969eaf9fc7d8c2ed13ce924eb

Chalard Jean   commited 2018-03-30 12:22:06 +09:00
96d10a75b6
Fix socket leaks in various android.net.Network methods.
Bug: 72124526
Test: make CtsNetTestCases
Change-Id: I3398b67272360f894e01a8cdfbc47b17d77c2330

Paul Jensen   commited 2018-03-29 07:43:01 -04:00
55eaa09f96
Add Network.fromNetworkHandle()
This is the counterpart to Network.getNetworkHandle() and facilitates
native code calling back to Java with network handle values from
getNetworkHandle.

Bug: 77210159
Bug: 64148938
Test: make CtsNetTestCases

Change-Id: I032b959d84180c063a79ddd97c35e7384b0f50a1

Paul Jensen   commited 2018-03-29 07:24:59 -04:00
b895ac0fe6
Make addUnwantedCapability method public
Allow apps to specify a list of capabilities that network must not have
in order to satisfy the request.

Bug: 72828388
Test: m -j
Change-Id: I91ee54963f7b92899c7a107b3a450b268c62fd8d

Pavel Maltsev   commited 2018-03-28 15:09:50 -07:00
089fe77ba7
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.

Test: atest android.net.cts.NetworkRequestTest
Bug: 74945408
Change-Id: I9aacceb82c98f7881f0eb5e1106d89d469b816a7

Jeff Sharkey   commited 2018-03-28 14:02:00 -06:00
e5886f37ec
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.

Bug: 68762530

Test: runtest -x frameworks/base/tests/net/ -c android.net.NetworkCapabilitiesTest

Change-Id: Ic916de7522a9f803a2410bc4e3e82101fd9d0dbd

Pavel Maltsev   commited 2018-03-27 23:17:14 -07:00
1868811e8f
Merge "Minor clean-up in NetworkCapabilities" am: 539f85a18d am: b1e2bfe4df
am: 8a956a5141

Bug: 72828388
Test: frameworks/base/tests/net/ -c android.net.NetworkCapabilitiesTest

Change-Id: I2f45d2c70c7c0142ae3b3ce9e6329c5f25b63380
(cherry picked from commit feb8d1498a822730e29cf346fe3382e3f5293a58)

Pavel Maltsev   commited 2018-03-27 22:45:49 +00:00
51f4d8a11d
Merge "Improve ConnectivityManager.getNetworkWatchlistConfigHash() javadoc" into pi-dev
Ricky Wai   authored and   Android (Google) Code Review   commited 2018-03-26 16:46:20 +00:00
2ce1e6ce2a
Merge "Have the status bar listen to all macro-users VPN changes." into pi-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2018-03-23 09:26:46 +00:00
749299b1c5
Have PermissionMonitor arbiter which app can access background networks
This will let ConnectivityService send the right callbacks to the
relevant apps.

Test: manual with apps
      runtest frameworks-net
      cts
      new tests for this functionality
Bug: 67408339

Change-Id: I6f08efd9e73c7e191f833d7f307a3bf4c9e2f0b4

Chalard Jean   commited 2018-03-23 13:37:56 +09:00
38354d1f60
Improve ConnectivityManager.getNetworkWatchlistConfigHash() javadoc
Test: NULL
Bug: 74831039
Change-Id: I227ba1377a51821204cd5830e7da6ff3a15bca02

Ricky Wai   commited 2018-03-22 20:13:05 +00:00
04baf117bf
Have the status bar listen to all macro-users VPN changes.
Bug: 73217368
Test: manual
      Using Datally on work profile. Before this, enabling the VPN
      does not show the key icon. After this it does.

Change-Id: I454eb8f3881a48af1b0187c2b14a2a399d3c2445

Chalard Jean   commited 2018-03-22 13:25:52 +09:00
7c74b9f311
Deprecate most of NetworkInfo.
getType, getTypeName, isConnectedOrConnecting, isConnected,
isAvaisable, isFailover, isRoaming, getState, getDetailedState,
getReason, and the TYPE_* constants in ConnectivityManager
along with methods that use them are now stacked on a boat
bound for the other side of the Styx.

Test: no code changes
Bug: 62844794
Change-Id: Idd70763de5b1af5580b4734cd443ac4b570069cc

Chalard Jean   commited 2018-03-09 16:52:20 +09:00
7eaf3b10e5
Merge "Extend network request to query networks w/o capabilites" am: 47d4d15483 am: 334cde1ec2
am: fa04c2d802

Change-Id: I3bf776767be61577f1bca0d98d4aaf82a0e45336

Pavel Maltsev   authored and   android-build-merger   commited 2018-03-03 00:14:52 +00:00
1016f7327a
Merge "Extend network request to query networks w/o capabilites"
am: 47d4d15483

Change-Id: Id1d86938fa2d5aff4dbf9cde87548d80c76674d9

Pavel Maltsev   authored and   android-build-merger   commited 2018-03-02 23:52:18 +00:00
334cde1ec2
Merge "Extend network request to query networks w/o capabilites"
Treehugger Robot   authored and   Gerrit Code Review   commited 2018-03-02 19:04:31 +00:00
47d4d15483
Merge "Give apps with NETWORK_SETTINGS right to see any VPN." am: faed85f2b0 am: 331e50f601
am: ec7c68cb2b

Change-Id: I9a9d0eb212f6de105abc070a1eb5ff698b4e67bc

Chalard Jean   authored and   android-build-merger   commited 2018-03-02 13:25:02 +00:00
0a8dbc7886
Merge "Give apps with NETWORK_SETTINGS right to see any VPN."
am: faed85f2b0

Change-Id: Iab9c8df6071e6dec35b5f492eb8344ba370e0036

Chalard Jean   authored and   android-build-merger   commited 2018-03-02 13:10:45 +00:00
331e50f601
Merge "Give VPNs the INTERNET capability when they route most of the IP space" am: f477aedec5 am: 7506c131c1
am: 941de3f74c

Change-Id: Ifd77149ca2c45249b8776c878c6fac46ae81c2a4

Chalard Jean   authored and   android-build-merger   commited 2018-03-02 12:54:29 +00:00
562e154642
Merge "Give VPNs the INTERNET capability when they route most of the IP space"
am: f477aedec5

Change-Id: Icd1466c79d2593fcab5bd2e31a1acb3a36a705da

Chalard Jean   authored and   android-build-merger   commited 2018-03-02 12:34:25 +00:00
7506c131c1
Merge "Give apps with NETWORK_SETTINGS right to see any VPN."
Chalard Jean   authored and   Gerrit Code Review   commited 2018-03-02 11:52:15 +00:00
faed85f2b0
Give apps with NETWORK_SETTINGS right to see any VPN.
...not only the ones that apply to them.

Bug: 73217368
Test: runtest frameworks-net and CTS
Change-Id: I436972a3e51e98bdd815771b451bcedadf684763

Chalard Jean   commited 2018-03-02 17:10:11 +09:00
9a396cc3c6
Give VPNs the INTERNET capability when they route most of the IP space
Test: manual, plus wrote some new tests for this
Bug: 72765718
Change-Id: I9759da72b752fd8eeb1d0647db9ab341f04c0528

Chalard Jean   commited 2018-03-02 16:20:22 +09:00
9cbc882c08
Extend network request to query networks w/o capabilites
Add another bit mask into NetworkCapabilities class that represents
unwanted capabilities and corresponding methods to add and remove them.

Bug: 72828388
Bug: 68762530

Test: runtest -x frameworks/base/tests/net/
Change-Id: Ie291167eb74fdb696c7ee145c8cc46ea8115d6ba

Pavel Maltsev   commited 2018-03-01 17:52:02 -08:00
7c600431b5
Merge "Fix up NetworkCapabilities' toString" am: a23d640426 am: 03580e0ccd
am: 26afb962f5

Change-Id: I3d3f3f34f30b69750e197b185c4e70bd360f35e0

Chalard Jean   authored and   android-build-merger   commited 2018-03-01 06:13:04 +00:00
3f1d0bb1a3
Merge "Fix up NetworkCapabilities' toString"
am: a23d640426

Change-Id: I21e66bc78a763f9e37725f50ca8b406ac7259518

Chalard Jean   authored and   android-build-merger   commited 2018-03-01 05:48:14 +00:00
03580e0ccd
Merge "Fix up NetworkCapabilities' toString"
Chalard Jean   authored and   Gerrit Code Review   commited 2018-03-01 04:01:16 +00:00
a23d640426
Fix up NetworkCapabilities' toString
Test: manual
Change-Id: I3bcec6a6873e8ec7ced0820d3d5b92249b19fe0a

Chalard Jean   commited 2018-02-28 19:47:48 +09:00
4409dfa9c7