Commit Graph

4715 Commits

Author SHA1 Message Date
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
TreeHugger Robot
f26c5341a5 Merge "Fix socket leaks in various android.net.Network methods." into pi-dev 2018-03-30 09:47:51 +00:00
TreeHugger Robot
dd8a3c78c5 Merge "Limit the number of routes for performance" into pi-dev 2018-03-30 08:48:25 +00:00
TreeHugger Robot
039947df6a Merge "Clarify documentation for getActiveNetworkInfo and friends" into pi-dev 2018-03-30 08:22:29 +00:00
Remi NGUYEN VAN
38468e9f2f Merge "Allow null subscriberId in NetworkStatsManager." into pi-dev 2018-03-30 07:39:23 +00:00
Chalard Jean
f0473e8650 Limit the number of routes for performance
In evaluating whether "most" of the addressing space is
covered, the list of routes are obtained from a third-party
app, so it's possbile the system service stalls unless
some limit is enforced on how much work it has to do.
This change limits the number of routes to 400, as determined
by time measurement on various devices.

Bug: 74176086
Test: runtest framework-net
Change-Id: Ie4a96098bc044ade87b188839586f14dd101c100
2018-03-30 15:41:50 +09:00
Chalard Jean
96d10a75b6 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
2018-03-30 12:22:06 +09:00
Remi NGUYEN VAN
65ffbafe88 Allow null subscriberId in NetworkStatsManager.
Use a MATCH_MOBILE_WILDCARD template to avoid filtering by
subscriberId when querying statistics from NetworkStatsService.

Bug: 74038898
Change-Id: I8296220472a9ba37044dd1a5ede9bdb45d3ed339
Fixes: 74038898
Test: runtest frameworks-net, CTS tests pass
Merged-In: I1e4e283c6eaecf33d12488e41e0c524f6ff83954
Merged-In: Ia84d2c7cc63bf8b8bf30f133e0382fd7103bf490
(cherry-picked from aosp I4b39e7031416cb33b23d89aa36ff0f774eaa942f)
2018-03-30 12:18:23 +09:00
Paul Jensen
55eaa09f96 Fix socket leaks in various android.net.Network methods.
Bug: 72124526
Test: make CtsNetTestCases
Change-Id: I3398b67272360f894e01a8cdfbc47b17d77c2330
2018-03-29 07:43:01 -04:00
Paul Jensen
b895ac0fe6 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
2018-03-29 07:24:59 -04:00
Jeff Sharkey
e5886f37ec 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
2018-03-28 14:02:00 -06:00
Pavel Maltsev
1868811e8f 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
2018-03-27 23:17:14 -07:00
Pavel Maltsev
51f4d8a11d 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)
2018-03-27 22:45:49 +00:00
Tony Mak
28a696afb4 Merge "Get application info in the correct user id" into pi-dev 2018-03-26 17:04:47 +00:00
Ricky Wai
2ce1e6ce2a Merge "Improve ConnectivityManager.getNetworkWatchlistConfigHash() javadoc" into pi-dev 2018-03-26 16:46:20 +00:00
Michael West
e0c1ee6414 Merge "add airplane mode shell commands to connectivity" into pi-dev 2018-03-26 16:38:03 +00:00
Tony Mak
2f6bcd9c06 Get application info in the correct user id
Fixes: 76396560

Test: Create work profile and launch hangouts in work profile.
Change-Id: Ic3727ac899153b6a96dd9b6d6921c32ba0bbd93e
2018-03-26 11:58:38 +00:00
Erik Kline
c54b9cb71a Pass all relevant resolver info to netd
Test: runtest frameworks-net passes
Test: manual testing of opportunistic and strict mode works
Bug: 34953048
Bug: 64133961
Bug: 72345192
Merged-In: I96f7747b8f0bb38d95579b688b4c2d068f1229cf
Merged-In: Ia4d896c4cc33c02f0c46d5d4c760cc33b13dff0b
Change-Id: Ia4f1905e1fa60e7a468c2246fb809191d2ba796b
(cherry picked from commit e5dac904d361a349f1cfc48500a678d22e3a7316)
2018-03-23 21:59:24 -07:00
mswest46
32928412a2 add airplane mode shell commands to connectivity
Fixes: 74410990
Test: Manually checked that commands enable/disable airplane mode.

Change-Id: I942bd4679fcd498a39b9b2cab68e8d3c00ce62d3
2018-03-24 01:53:45 +00:00
TreeHugger Robot
749299b1c5 Merge "Have the status bar listen to all macro-users VPN changes." into pi-dev 2018-03-23 09:26:46 +00:00
Chalard Jean
38354d1f60 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
2018-03-23 13:37:56 +09:00
Ricky Wai
04baf117bf Improve ConnectivityManager.getNetworkWatchlistConfigHash() javadoc
Test: NULL
Bug: 74831039
Change-Id: I227ba1377a51821204cd5830e7da6ff3a15bca02
2018-03-22 20:13:05 +00:00
Chalard Jean
7c74b9f311 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
2018-03-22 13:25:52 +09:00
Nathan Harold
bfcc17cc20 Check mOwnedByTransform to avoid DELSA on SPI
The owned by transform flag prevents the removal
of an SPI from accidentally deleting an associated
SA in the kernel. That flag wasn't actually being
checked, so deleting an SPI would result in the
transform being removed.

The existing code already guarantees that the SA is
deleted when the transform is deleted

Bug: 73258845
Test: runtest frameworks-net
Merged-In: I4c26aea7af817a5d9e54da5db1cdf4f943bcae06
Change-Id: I4c26aea7af817a5d9e54da5db1cdf4f943bcae06
(cherry picked from commit 22795302be4ec35449908cf566aa7c16945df836)
2018-03-20 18:29:02 -07:00
Benedict Wong
76df78ffbf Added implementation for VTI add/remove address
This change adds implementation details for add/remove addresses onto a
VTI.

Bug: 73675031
Test: New tests added, passing on Walleye
Merged-In: Idde9d943a5285d2c13c5c6b0f7b8a9faf718e6a5
Change-Id: Idde9d943a5285d2c13c5c6b0f7b8a9faf718e6a5
(cherry picked from commit ecc9f7cc08804e3fa15fea04ae94ea1bc74edbfe)
2018-03-20 16:01:27 -07:00
Chalard Jean
bf7610aa8a Merge "Deprecate most of NetworkInfo." into pi-dev 2018-03-10 07:51:11 +00:00
Chalard Jean
7eaf3b10e5 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
2018-03-09 16:52:20 +09:00
Chad Brubaker
caced413da Expose CONNECTIVITY_ACTION to Instant Apps
Test: Broadcast is visible to Instant Apps
Bug: 69421898
Change-Id: I8435e7723cf7a722668b97ff087d1f4453d3e7b7
2018-03-08 10:37:09 -08:00
Andreas Gampe
85c8c3d822 Connectivity: Fix map access
Found by Errorprone.

Bug: 73288226
Test: mmma frameworks/base/services
Merged-In: I1c4b35811c72d389e53e28c3eb1b411009471b92
Merged-In: Ice91ac58257551485231da4664027a281237de4b
Merged-In: I7d2f578b54c69139be8b887a2381ac1b2e0673a3
Change-Id: I63edad58dbc909c1e772bde85a1b9dd98c551fb1
(cherry picked from commit 3ba8106c23cdf518527f75beaabb48bf3182fb4d)
2018-03-07 11:36:57 +09:00
Pavel Maltsev
1016f7327a Merge "Extend network request to query networks w/o capabilites" am: 47d4d15483 am: 334cde1ec2
am: fa04c2d802

Change-Id: I3bf776767be61577f1bca0d98d4aaf82a0e45336
2018-03-03 00:14:52 +00:00
Pavel Maltsev
fa04c2d802 Merge "Extend network request to query networks w/o capabilites" am: 47d4d15483
am: 334cde1ec2

Change-Id: Ie0c4fa4648c235589fecd79a25d28f1e62025fb7
2018-03-03 00:03:37 +00:00
Pavel Maltsev
334cde1ec2 Merge "Extend network request to query networks w/o capabilites"
am: 47d4d15483

Change-Id: Id1d86938fa2d5aff4dbf9cde87548d80c76674d9
2018-03-02 23:52:18 +00:00
Treehugger Robot
47d4d15483 Merge "Extend network request to query networks w/o capabilites" 2018-03-02 19:04:31 +00:00
Chalard Jean
0a8dbc7886 Merge "Give apps with NETWORK_SETTINGS right to see any VPN." am: faed85f2b0 am: 331e50f601
am: ec7c68cb2b

Change-Id: I9a9d0eb212f6de105abc070a1eb5ff698b4e67bc
2018-03-02 13:25:02 +00:00
Chalard Jean
ec7c68cb2b Merge "Give apps with NETWORK_SETTINGS right to see any VPN." am: faed85f2b0
am: 331e50f601

Change-Id: I7f08217c5abc86a8784b91145f1b02d6693b3919
2018-03-02 13:17:23 +00:00
Chalard Jean
331e50f601 Merge "Give apps with NETWORK_SETTINGS right to see any VPN."
am: faed85f2b0

Change-Id: Iab9c8df6071e6dec35b5f492eb8344ba370e0036
2018-03-02 13:10:45 +00:00
Chalard Jean
562e154642 Merge "Give VPNs the INTERNET capability when they route most of the IP space" am: f477aedec5 am: 7506c131c1
am: 941de3f74c

Change-Id: Ifd77149ca2c45249b8776c878c6fac46ae81c2a4
2018-03-02 12:54:29 +00:00
Chalard Jean
941de3f74c Merge "Give VPNs the INTERNET capability when they route most of the IP space" am: f477aedec5
am: 7506c131c1

Change-Id: I33c6fcc72753e00af601cf915aa78416174a3871
2018-03-02 12:46:46 +00:00
Chalard Jean
7506c131c1 Merge "Give VPNs the INTERNET capability when they route most of the IP space"
am: f477aedec5

Change-Id: Icd1466c79d2593fcab5bd2e31a1acb3a36a705da
2018-03-02 12:34:25 +00:00
Chalard Jean
faed85f2b0 Merge "Give apps with NETWORK_SETTINGS right to see any VPN." 2018-03-02 11:52:15 +00:00
Chalard Jean
f477aedec5 Merge "Give VPNs the INTERNET capability when they route most of the IP space" 2018-03-02 11:18:10 +00:00
Chalard Jean
9a396cc3c6 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
2018-03-02 17:10:11 +09:00
Chalard Jean
9cbc882c08 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
2018-03-02 16:20:22 +09:00
Pavel Maltsev
7c600431b5 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
2018-03-01 17:52:02 -08:00
Chalard Jean
3f1d0bb1a3 Merge "Fix up NetworkCapabilities' toString" am: a23d640426 am: 03580e0ccd
am: 26afb962f5

Change-Id: I3d3f3f34f30b69750e197b185c4e70bd360f35e0
2018-03-01 06:13:04 +00:00
Chalard Jean
26afb962f5 Merge "Fix up NetworkCapabilities' toString" am: a23d640426
am: 03580e0ccd

Change-Id: I2f1578589232c49574dbf401d7f4becfa350a1c0
2018-03-01 05:56:33 +00:00
Chalard Jean
03580e0ccd Merge "Fix up NetworkCapabilities' toString"
am: a23d640426

Change-Id: I21e66bc78a763f9e37725f50ca8b406ac7259518
2018-03-01 05:48:14 +00:00
Chalard Jean
a23d640426 Merge "Fix up NetworkCapabilities' toString" 2018-03-01 04:01:16 +00:00
Chalard Jean
4409dfa9c7 Fix up NetworkCapabilities' toString
Test: manual
Change-Id: I3bcec6a6873e8ec7ced0820d3d5b92249b19fe0a
2018-02-28 19:47:48 +09:00