Commit Graph

1284 Commits

Author SHA1 Message Date
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
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
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
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
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
15e839f111 Minor clean-up in NetworkCapabilities
Follow up clean up for aosp/606338

Bug: 72828388
Test: frameworks/base/tests/net/ -c android.net.NetworkCapabilitiesTest
Change-Id: I2d2cfeb51caaa339602f7d97ffffed6e4cfad432
2018-03-01 18:06:25 -08: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
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
Pavel Maltsev
013f8a445f Merge "Add OEM_PAID network capability" am: 2501283064 am: 82fdea2d7b
am: 5cb05a12bd

Change-Id: Id64d288764dc5a556b60f5e3b866b40792647ac0
2018-02-28 08:42:24 +00:00
Pavel Maltsev
82fdea2d7b Merge "Add OEM_PAID network capability"
am: 2501283064

Change-Id: I2fb8825bc1038783ef45907846b52192b6fe5d18
2018-02-28 08:14:48 +00:00
Treehugger Robot
2501283064 Merge "Add OEM_PAID network capability" 2018-02-28 07:06:00 +00:00
nharold
2b1592206b Merge "Fix ConnectivityServiceTest for NATT Keepalive" am: cab3e6009c am: 4e2e3f823b
am: 3a5a4efd8a

Change-Id: I2ce9d740b82f591b847150ec1eaffa39bfbd0241
2018-02-20 23:21:59 +00:00
nharold
4e2e3f823b Merge "Fix ConnectivityServiceTest for NATT Keepalive"
am: cab3e6009c

Change-Id: Idbdffc7bbd2d9a96f6e6052810722df04a20a65c
2018-02-20 22:55:38 +00:00
nharold
cab3e6009c Merge "Fix ConnectivityServiceTest for NATT Keepalive" 2018-02-20 19:17:23 +00:00
Chalard Jean
67036aacbc Merge "DO NOT MERGE : fix useless import" 2018-02-18 23:14:42 +00:00
Nathan Harold
0990bc8b57 Fix ConnectivityServiceTest for NATT Keepalive
Fix test breakages I caused when adding cell
support for NATT keepalives.

-Make the minimum keepalive interval a constant in
 ConnectivityManager and use it in tests.
-Re-Disallow IPv6 Keepalives

Bug: 73327535
Test: 'runtest -x ConnectivityServiceTest' now passes
Change-Id: I5ec4367d250ee371014e65c897c3897a25a05e2d
2018-02-16 16:34:50 -08:00
Chalard Jean
31cbef1cbc DO NOT MERGE : fix useless import
This was added to avoid a merge conflict at a sensitive time.
It can (and should) go.

Test: no code change
Change-Id: I11d73e2d988ae61a168aa0f1cc7c2c506f509d30
2018-02-16 17:21:39 +09:00
Hugo Benichi
299e793837 Merge "Add missing'}' in javadoc of public API method" am: 8f22a42cf7 am: e7b8b95aa8
am: 8d2c7aa52b

Change-Id: I2cfda60077c57d151fb8599845cd202bbc4e625d
2018-02-16 07:58:57 +00:00
Treehugger Robot
8f22a42cf7 Merge "Add missing'}' in javadoc of public API method" 2018-02-16 03:19:35 +00:00
Pavel Maltsev
d4d611954e Add OEM_PAID network capability
Bug: 68762530

Test: runtest -x frameworks/base/tests/net/

Change-Id: I51c07e0c2211d631e90b27468c26b599e7b07bc8
2018-02-15 10:46:00 -08:00
Chalard Jean
74ef4d0b1d Merge changes I3d68dbf8,I6ea524bb,I978d9119 am: 91d3912eab am: 004939fd82
am: d9663d47c5

Change-Id: Ic6d639358c3310820bd925df93d4843d7edffc57
2018-02-15 14:23:57 +00:00
Chalard Jean
52e239618b Deprecate CONNECTIVITY_ACTION.
That was its destiny.
Use NetworkCallbacks instead.

Test: runtest frameworks-net, but this is only doc changes
Change-Id: I3d68dbf817de92c66d899a7cc4519c5639e4c049
2018-02-14 15:14:44 +09:00
Chalard Jean
a23bc9e501 Publish FOREGROUND and add NOT_SUSPENDED capabilities.
NOT_SUSPENDED and FOREGROUND are capabilities that need to
be public so as to reach feature parity with what information
can be gotten through the use of CONNECTIVITY_ACTION and
synchronous calls to ConnectivityManager. This change makes
them public, and wires up the NOT_SUSPENDED capability.
This deprecates in effect the old onSuspended and onResumed
callbacks, but these have never been public.

This also converts the onAvailable path from a multiple
binder call design to a simpler, single binder call. This
is only for internal convenience

Test: runtest frameworks-net
Test: cts
Test: also manual testing
Change-Id: I6ea524bb361ecef0569ea2f9006c1e516378bc25
2018-02-14 15:14:41 +09:00
Hugo Benichi
cbfbb3755a Add missing'}' in javadoc of public API method
Bug: 73052508
Test: pure documentation change
Change-Id: I92514629da1b000dd3d1165acd8efcdec75b49b9
2018-02-07 21:17:43 +09:00
Jong Wook Kim
622cda4338 Merge "MacAddress: Use SecureRandom and add a 46 bit randomized MAC generator" am: 028e2a048e am: c7ec0f6fc3
am: 83939e37af

Change-Id: I5f2d395705841b7da03b1552b16507466e47ef84
2018-02-07 09:26:56 +00:00
Jong Wook Kim
93dd5e6964 MacAddress: Use SecureRandom and add a 46 bit randomized MAC generator
Use SecureRandom instead of Random since Random is time based and can
increase the chance of generating same MAC address across multiple
devices.

createRandomUnicastAddress should randomize all bits of the address,
except for locally assigned bit and unicast bit. The previous method
that only randomizes NIC and use Google Base OUI is renamed to
createRandomUnicastAddressWithGoogleBase.

Bug: 72450936
Test: runtest frameworks-net
Change-Id: Icda650638c2c1c9fd90d509a87e86347c0e05f2d
2018-02-07 01:28:46 +00:00
Nathan Harold
7f8d0be10d Rework KeepalivePacketData for Compatibility with Cell
KeepalivePacketData currently mixes multiple concepts: the
list of parameters that are used to generate a keepalive
packet, the keepalive packet itself, and the parameters that
are needed to send a keepalive packet over an ethernet link.

The KeepalivePacketData is now a parcelable that can be used
generically by any NetworkAgent, regardless of how that Agent
fulfills its duty to initiate and maintain a keepalive session.

Bug: 69063212
Test: verified with SL4A, additional tests pending
Merged-In: I23dc4827ae729583356a8ff0f02e39a2ad2b81f5
Change-Id: I23dc4827ae729583356a8ff0f02e39a2ad2b81f5
(cherry picked from commit 5be3f5a2b1)
2018-01-29 11:20:20 -08:00
Nathan Harold
583c95be3b Relocate KeepalivePacketData to frameworks/base
Due to an issue resolving the boot classpath, the
KeepalivePacketData structure cannot be referenced
by frameworks/opt/telephony while it is in services.

-Move KeepalivePacketData to android.net
-Also, relocate IpUtils without changing the package
 name.

Bug: 38350389
Test: compilation
Merged-In: If5fc63e9ad8b9b2d4c2fee47ff4bab2ab190a05a
Change-Id: If5fc63e9ad8b9b2d4c2fee47ff4bab2ab190a05a
(cherry picked from commit f8a2bc3eee)
2018-01-29 11:19:43 -08:00
Chalard Jean
179b37dbf4 Fix a bug where a NetworkAgent gets repeatedly torn down
mUids is not marshalled correctly when null so if the
NetworkAgent runs in another process and is not a VPN then
the system will see its allowed Uids as being the empty
list (= nobody can use this network) instead of a null
list (= everybody can use this network). This breaks
emulator networking.

Bug: 72436966
Test: runtests frameworks-net
Test: also manual testing, this does fix emulator networking
      and seems not to break phone networking
Cherry-pick of : Id2bbf3808e80b19cd055c832c11cf72372710942

Change-Id: I4b88d5eccbdea745a947d12635cd751e38632589
2018-01-25 13:57:51 +09:00
Chalard Jean
715d078639 Fix a bug where a NetworkAgent gets repeatedly torn down
mUids is not marshalled correctly when null so if the
NetworkAgent runs in another process and is not a VPN then
the system will see its allowed Uids as being the empty
list (= nobody can use this network) instead of a null
list (= everybody can use this network). This breaks
emulator networking.

Bug: 72436966
Test: runtests frameworks-net
Test: also manual testing, this does fix emulator networking
      and seems not to break phone networking
Change-Id: Id2bbf3808e80b19cd055c832c11cf72372710942
2018-01-25 04:51:44 +00:00
Nathan Harold
5be3f5a2b1 Rework KeepalivePacketData for Compatibility with Cell
KeepalivePacketData currently mixes multiple concepts: the
list of parameters that are used to generate a keepalive
packet, the keepalive packet itself, and the parameters that
are needed to send a keepalive packet over an ethernet link.

The KeepalivePacketData is now a parcelable that can be used
generically by any NetworkAgent, regardless of how that Agent
fulfills its duty to initiate and maintain a keepalive session.

Bug: 69063212
Test: verified with SL4A, additional tests pending
Change-Id: I23dc4827ae729583356a8ff0f02e39a2ad2b81f5
2018-01-24 11:13:19 -08:00
Nathan Harold
f8a2bc3eee Relocate KeepalivePacketData to frameworks/base
Due to an issue resolving the boot classpath, the
KeepalivePacketData structure cannot be referenced
by frameworks/opt/telephony while it is in services.

-Move KeepalivePacketData to android.net
-Also, relocate IpUtils without changing the package
 name.

Bug: 38350389
Test: compilation
Change-Id: If5fc63e9ad8b9b2d4c2fee47ff4bab2ab190a05a
(cherry picked from commit bd4093be7cab51d6ad031854324134a9c8637c2c)
2018-01-24 10:26:04 -08:00
Chalard Jean
5589119697 Resolve merge conflicts of d15f09adf7 to master
Test: this is the exact code these changes were meant to give
      without conflict had the auto-merger not squashed them
      together before it tried to merge them. It was tested on
      master in this state.

Change-Id: I5cbde17fb6016e5e6b5d0b04c8f41858d708ef4a
2018-01-24 15:59:26 +09:00
Chalard Jean
fd3a4ae0fe Let network requests see VPNs.
Test: runtest frameworks-net
Test: also tested with VPN app
Test: also cts passing
Change-Id: I3b16caad7787c3c1f2921ca1583815c89efbadc5
2018-01-23 21:38:00 +09:00
Chalard Jean
b399bf16d1 Make sure listen requests from VPN apps see their own networks
Test: runtest frameworks-net
Test: CTS pass, including with the next patch which is what this
      actually matters for

Change-Id: I09a94042acbefa24ab884f95326e30d6ab280b82
2018-01-23 21:38:00 +09:00
Chalard Jean
b2a4991781 Remove UID_RANGES_ADDED and REMOVED.
Test: runtest frameworks-net
Test: also tested with VPN app
Test: also cts passing
Change-Id: I3530030996daeba05a8f2fffc5c6e21ed62e3f40
2018-01-23 21:38:00 +09:00
Chalard Jean
753d9734d2 Move VPN allowed UIDs into NetworkCapabilities.
Test: runtest frameworks-net
Test: also new specific tests for this new code
Test: also tested with VPN app
Test: also cts passing
Change-Id: If0311bae2bf99dedac959febadecf4f92f3064b8
2018-01-23 21:38:00 +09:00
Chalard Jean
cbe99b35a0 Pre-import to remove a conflict.
Test: compiles and passes checkstyle
Change-Id: I1ffdd88e6268fee0cf88992420ab21eb42928957
2018-01-23 21:38:00 +09:00
Ricky Wai
7097cc9319 Add ConnectivityManager.getNetworkWatchlistConfigHash()
Apps can use this API to get network watchlist config hash for auditing.

Bug: 63908748
Test: Able to compile
Change-Id: I5ce9e6bb6dad88139c0a102da58be0dd7c284b7a
2018-01-23 06:32:36 +00:00
Jeff Sharkey
d86a06f7b4 Merge "Add "not congested" network capability." am: 8a06cca651 am: 944a9864a2
am: f22a540007

Change-Id: I836fedeab34f34a43e0257e395fca1f735bc6d61
2018-01-18 04:20:44 +00:00
Lorenzo Colitti
482dfac4be Merge "Add public API methods for private DNS." am: 6cba185910 am: a57e5c074c
am: 2e00fc0771

Change-Id: Icd04bc83624ea4d13ac7737e6f9a7b0c5f0f7314
2018-01-18 03:36:37 +00:00
Jeff Sharkey
8a06cca651 Merge "Add "not congested" network capability." 2018-01-18 03:28:34 +00:00