Commit graph android_packages_modules_Co.../core/java/android
Message SHA1
Merge "Fix setCapabilities." into pi-dev
Chalard Jean   authored and   Android (Google) Code Review   commited 2018-05-22 07:51:09 +00:00
7c65d9f23d
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

Chalard Jean   commited 2018-05-21 14:46:40 +09:00
c5c02585f5
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
ae1a3af6ce
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
93bf1bfda3
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
078049e316
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
bec4200e1e
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
9ea008ff62
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
53d1a8d88d
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
058cd31b1b
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
47fe228875
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
cad3dd0b70
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
991c6154a6
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
9813abb032
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
3e849a3d59
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
cfef78edd5
Merge "Add hasUnwantedCapability method" into pi-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2018-04-04 16:55:14 +00:00
088b1f55a0
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
653a5c203c
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
6fe8f5b7a3
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
2874a14212
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
62e4efeee2
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
66b0087e58
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
4baa5d48e3
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
7db624228a
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
7c85ba400c
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
75184ed674
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
bcf88e4576
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
fc2abf2b4c
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
fc5a07fe83
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
0b2e0b0280
Merge "Minor clean-up in NetworkCapabilities" am: 98dc002acc am: 6d8274ebf1
am: fbb48a210f

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
3585034ec9
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
9bf657d1e7
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
55f0dd815d
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
a43eede395
Improve ConnectivityManager.getNetworkWatchlistConfigHash() javadoc
Test: NULL
Bug: 74831039
Change-Id: I227ba1377a51821204cd5830e7da6ff3a15bca02

Ricky Wai   commited 2018-03-22 20:13:05 +00:00
573dcabcff
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
06f604fcbd
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
5acb7b709a
Merge "Extend network request to query networks w/o capabilites" am: 762a14565b am: 76136de729
am: 60bcd4b9d9

Change-Id: I3bf776767be61577f1bca0d98d4aaf82a0e45336

Pavel Maltsev   authored and   android-build-merger   commited 2018-03-03 00:14:52 +00:00
07aeacfbd5
Merge "Extend network request to query networks w/o capabilites"
am: 762a14565b

Change-Id: Id1d86938fa2d5aff4dbf9cde87548d80c76674d9

Pavel Maltsev   authored and   android-build-merger   commited 2018-03-02 23:52:18 +00:00
76136de729
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
762a14565b
Merge "Give apps with NETWORK_SETTINGS right to see any VPN." am: dce4d4ca32 am: e999899287
am: f6c1bf66ba

Change-Id: I9a9d0eb212f6de105abc070a1eb5ff698b4e67bc

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

Change-Id: Iab9c8df6071e6dec35b5f492eb8344ba370e0036

Chalard Jean   authored and   android-build-merger   commited 2018-03-02 13:10:45 +00:00
e999899287
Merge "Give VPNs the INTERNET capability when they route most of the IP space" am: ef307293e5 am: 58c3355b8f
am: d98aec5eee

Change-Id: Ifd77149ca2c45249b8776c878c6fac46ae81c2a4

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

Change-Id: Icd1466c79d2593fcab5bd2e31a1acb3a36a705da

Chalard Jean   authored and   android-build-merger   commited 2018-03-02 12:34:25 +00:00
58c3355b8f
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
dce4d4ca32
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
8895306c4a
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
687546ed4d
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
40ba60c765
Merge "Fix up NetworkCapabilities' toString" am: ef16e8daab am: 2e4c0bf13c
am: 7f245b1f71

Change-Id: I3d3f3f34f30b69750e197b185c4e70bd360f35e0

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

Change-Id: I21e66bc78a763f9e37725f50ca8b406ac7259518

Chalard Jean   authored and   android-build-merger   commited 2018-03-01 05:48:14 +00:00
2e4c0bf13c
Merge "Fix up NetworkCapabilities' toString"
Chalard Jean   authored and   Gerrit Code Review   commited 2018-03-01 04:01:16 +00:00
ef16e8daab