Commit Graph

4476 Commits

Author SHA1 Message Date
Erik Kline
454b42eced change NMS removeNetwork to netd binder variant
Also: require NETWORK_STACK instead of CONNECTIVITY_INTERNAL.

Bug: 34953048
Bug: 64133961
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net
Change-Id: I26f07f51a8a2f4a8bb43a276da7c5e66c355c848
2018-01-15 19:51:37 +09:00
Erik Kline
420d020689 Merge changes I47ccfa99,I5db1de3e am: f98f97fe92
am: 03f3294103

Change-Id: I311f6c299daf1c8d21731187d8e78e55c5767564
2018-01-11 12:43:38 +00:00
Treehugger Robot
f98f97fe92 Merge changes I47ccfa99,I5db1de3e
* changes:
  Extract DNS setting logic into DnsManager class
  Add minimal test for setting DNS properties
2018-01-11 11:33:30 +00:00
Erik Kline
3212008036 Extract DNS setting logic into DnsManager class
In future, managing DNS-over-TLS hostname lookup and netd programming
can be encapsulated here.

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 64133961
Change-Id: I47ccfa99c30c780524c45c4af605e720ccba34a0
2018-01-11 18:16:50 +09:00
Erik Kline
6e0347d6df Add minimal test for setting DNS properties
Test: as follows
Change-Id: I5db1de3ee8e179edd56c93988b821242b81c2387
2018-01-11 18:16:20 +09:00
Lorenzo Colitti
291e7c4fce Merge "Move more core networking tests to framework/base/tests/net." am: d207b1faa3
am: 8f852c341f

Change-Id: Iab87e7ce5b62a1ff21c7aee5d0f25597713f6c65
2018-01-11 04:10:01 +00:00
Lorenzo Colitti
d207b1faa3 Merge "Move more core networking tests to framework/base/tests/net." 2018-01-11 03:09:40 +00:00
Lorenzo Colitti
a4fdc1204e Move more core networking tests to framework/base/tests/net.
Test: "runtest frameworks-net" passes except for already-failing IpConnectivityMetricsTest
Change-Id: I2a20d546089699ac67bc819f10a8fcd50c637ac4
2018-01-10 23:35:16 +09:00
Malcolm Chen
180c8da8ff Merge "Add isMobileDataEnabled in TelephonyManager." am: 278fb634c1
am: 6b943d5deb

Change-Id: I132cc6d3de77f20717a40884683fb0c81fbb7083
2018-01-10 00:06:27 +00:00
Treehugger Robot
278fb634c1 Merge "Add isMobileDataEnabled in TelephonyManager." 2018-01-09 23:46:55 +00:00
Benedict Wong
f85202f016 Merge "Add validation to IpSecConfig algorithm setters" am: a954f20f46
am: c93df5ca1c

Change-Id: I45289bc8e8b93f7eb912a76a10b951b1a615338a
2018-01-09 19:51:19 +00:00
Malcolm Chen
acf59b8403 Add isMobileDataEnabled in TelephonyManager.
Added a new hidden API isMobileDataEnabled in TelephonyManager.
Rename related APIs to isUserMobileDataEnabled,
isUserMobileDataEnabled and setUserMobileDataEnabled to better
clarify their functionality.

Bug: 69814555
Test: build
Change-Id: I2f186f1e7550cafbe4ee3a5af293c39274cbfeaa
Merged-In: I2f186f1e7550cafbe4ee3a5af293c39274cbfeaa
2018-01-08 18:08:22 -08:00
Benedict Wong
a708eec031 Add validation to IpSecConfig algorithm setters
Adds checks to ensure that users can only set the correct types of
algorithms for the Authentication, Encryption and Authenticated
Encryption algorithms.

Bug: 65223935
Test: Added tests in IpSecConfigTest, and passed on aosp_marlin-eng
Change-Id: I462c77d9eb5710b8d03a48866453649d3b6fc6bf
2018-01-04 16:56:40 -08:00
Benedict Wong
a7d1b22d6d Merge "[ipsec-doze] Add fchown to IpSecService to support doze" am: 4edb4c8ec4
am: 5949912523

Change-Id: I9036fc2768dd9664ab7407b359f3c689c7ce700e
2017-12-20 18:42:26 +00:00
Benedict Wong
b72b41b121 Merge "[ipsec-qtaguid] Tag sockets upon creation of encap sockets" am: 0b8bf40ae4
am: 8caa274ade

Change-Id: I2f27c76a1f493ff4f0bd423c06f159e629866d4d
2017-12-19 00:27:57 +00:00
Hugo Benichi
be36e5929e Merge changes I798d8fec,I4a2d5866 am: c5212b6654
am: 99be302c71

Change-Id: I41b507c4e4bf9b8b9082f5e7eaab8985b5bbef41
2017-12-19 00:06:00 +00:00
Benedict Wong
42e3fa137d [ipsec-doze] Add fchown to IpSecService to support doze
Encap sockets are currently created as the system server, and should be
fchown'd to the user for whom it was created on behalf of.

Bug: 62994731
Test: New tests added and run to IpSecService
Change-Id: Icc49e709ae588981e69765fdb77537d7ffbac5fe
2017-12-18 16:01:58 -08:00
Benedict Wong
0b8bf40ae4 Merge "[ipsec-qtaguid] Tag sockets upon creation of encap sockets" 2017-12-18 23:50:52 +00:00
Benedict Wong
c41067d51a [ipsec-qtaguid] Tag sockets upon creation of encap sockets
Added calls to tag encap sockets to that of the UID for which the encap
socket is being created on behalf of. This ensures that all data
accounting generated for the UDP-encap-ESP socket is correctly billed to
the right UID.

Bug: 62994731
Test: New tests added to IpSecServiceTest.java, passing
Change-Id: I15365ea9c982fd7b4e3cdeff314ddfba2289c86e
2017-12-18 19:46:06 +00:00
Hugo Benichi
3f83b8ad4e MacAddress: address api review comments
1) toSafeString() is renamed to toOuiString()
2) toOuiString() returns a String that only contains the first 3 bytes
   of the mac address.

Bug: 70336442
Test: runtest frameworks-net
Change-Id: I798d8fec32dbff5687a682028e5d90eb941f81c1
2017-12-18 09:22:47 +09:00
Hugo Benichi
3f33d23522 Expose the MacAddress class in the api
Test: built,  flashed, $ runtest frameworks-net
Bug: 69390696
Change-Id: Ica5efdf5ffe8ad2500a87f574508a2bcd074b33d
Merged-In: Ica5efdf5ffe8ad2500a87f574508a2bcd074b33d

(cherry picked from commit d411cf61ed5b948aaf6f6234217d6c6999c35159)
2017-12-18 09:21:26 +09:00
nharold
9f34247bc3 Merge "Fix broken test due to API rename" am: 2ea0bc5ffa
am: ee898c81a7

Change-Id: I7e99991cd2c71c66e1acb3aa3957efb28c9a426a
2017-12-14 23:28:16 +00:00
nharold
2ea0bc5ffa Merge "Fix broken test due to API rename" 2017-12-14 23:07:53 +00:00
Nathan Harold
bcbe3b6bf2 Fix broken test due to API rename
A race condition during an Api rename has caused
the name change from reserveSecurityParameterIndex
to allocateSecurityParameterIndex to be wrong in
a test. Fixing.

Bug: 69128142
Test: runtest frameworks-net
Change-Id: I12fb9832cb938dc19f463b1f1124127435d7b173
2017-12-14 23:04:42 +00:00
nharold
b6bca5a59d Merge "Use consistent naming for allocating SPI." am: 37303d5e94
am: 4753ed4b1b

Change-Id: Ib5d89044313341790b1ee9271642072ddce181af
2017-12-14 21:36:32 +00:00
nharold
37303d5e94 Merge "Use consistent naming for allocating SPI." 2017-12-14 21:10:16 +00:00
Benedict Wong
393a328478 Merge "Convert IpSecService resources to use refcounting" am: a87a442c5a
am: 8698b33cc2

Change-Id: I9645df5304d7f11068d190cbdaccfe83ca0580bc
2017-12-14 02:20:20 +00:00
Benedict Wong
a87a442c5a Merge "Convert IpSecService resources to use refcounting" 2017-12-14 01:45:15 +00:00
Benedict Wong
d21105064e Convert IpSecService resources to use refcounting
This is part 2 of 2 of the refcounting refactor for IpSecService
resources.

Switched ManagedResources to use RefcountedResource structure for
managing reference counts and eventual cleanup. Further, resource arrays
and quota management have been aggregated into a UserRecord for better
isolation. UID access checking has been similarly moved into the
UserRecordTracker, and resourceId checking has been rolled into
RefcountedResourceArray's accessor methods.

Bug: 63409385
Test: CTS, all unit tests run on aosp_marlin-eng, new tests added
Change-Id: Iee52dd1c9d2583bb6bfaf65be87569e9d50a5b63
2017-12-13 23:28:41 +00:00
Benedict Wong
5dd409e76b Merge "Add reference counted resources to IpSecService" am: 05013f3965
am: adb6437fea

Change-Id: I927ac534570b3836510e0fb4feda8cf544f5a9e4
2017-12-13 22:00:26 +00:00
Benedict Wong
05013f3965 Merge "Add reference counted resources to IpSecService" 2017-12-13 21:33:38 +00:00
Benedict Wong
11c8f27e22 Add reference counted resources to IpSecService
This patch adds (but does not enable the usage of) RefcountedResource
objects to IpSecService, with tests to ensure correct function. This is
patch 1 of a series of patches to refactor the resource management
systems in IpSecService.

RefcountedResource objects allow for management of acyclical dependency
trees, ensuring eventual cleanup when resources are no longer used. This
cleanup may be triggered by binder death or by explicit user action.

Bug: 63409385
Test: New tests written in IpSecServiceRefcountedResourceTest,
explicitly testing the RefcountedResource class

Change-Id: Ib5be7482b2ef5f1c8dec9be68f15e90d8b3aba6d
2017-12-12 23:40:52 -08:00
Hugo Benichi
7a480f3f67 ConnectivityService: synchronize access on mLockdownEnabled
The mLockdownEnabled boolean and the mLockdownTracker objects are read
and mutated in many places involving vpn logic inside of
ConnectivityService. This includes codepaths run on the
ConnectivityService handler and codepaths run on Binder calls from
IConnectivityManager.aidl, however the access to these variables are not
synchronized.

This patch adds proper synchronization to mLockdownEnabled and
mLockdownTracker by moving access to them into the mVpns lock used for
all of vpn logic.

Bug: 18331877
Test: runtest frameworks-net
Change-Id: I4abde43b1036861f4486dd2b5567782d10204bd6
2017-12-13 09:54:38 +09:00
Jonathan Basseri
fbe3a82340 Use consistent naming for allocating SPI.
Throughout the IPsec code (API, system server, netd) we use "reserve"
SPI and "allocate" SPI interchangeably. This renames to use "allocate"
everywhere for self-consistency and consistency with the kernel
(ALLOCSPI).

In javadoc, I am leaving the word "reserve" in several places because it
is still an accurate description of how the method behaves.

Bug: 69128142
Test: TreeHugger should be enough
Change-Id: I8ea603b4612303b0393beef04032671fa53d2106
2017-12-12 13:50:35 -08:00
Xin Li
26f226f058 Merge "DO NOT MERGE: Merge Oreo MR1 into master" am: 49f174beba -s ours
am: 3aafa4c9ce

Change-Id: I0e586f759df230aeff2dd045e5ff1d138d284ec3
2017-12-07 08:34:18 +00:00
Xin Li
49f174beba Merge "DO NOT MERGE: Merge Oreo MR1 into master" 2017-12-06 23:18:26 +00:00
ludi
5b77df1729 Merge "Cleanup of resource limit tests" am: 7d0a38956e
am: dc7693b146

Change-Id: I102693c752fb8fbaf9c1bac824047b5ed6d3d9c1
2017-12-06 03:49:56 +00:00
ludi
dc7693b146 Merge "Cleanup of resource limit tests"
am: 7d0a38956e

Change-Id: Ifcbc61ad8003c43ba1baff6d4d534192f6498206
2017-12-06 03:29:35 +00:00
Treehugger Robot
7d0a38956e Merge "Cleanup of resource limit tests" 2017-12-06 02:58:41 +00:00
Hugo Benichi
23649344d2 Merge "Fix bug in MacAddress.fromString()" am: cdb84d2fc7
am: a31109c229

Change-Id: If67d0b8fcc2270d4b152d4e07c79725b457574c6
2017-12-05 10:01:19 +00:00
Hugo Benichi
a31109c229 Merge "Fix bug in MacAddress.fromString()"
am: cdb84d2fc7

Change-Id: If4c85f0a5ea259f53f9cffa6eacb58fcde1fd1df
2017-12-05 09:47:50 +00:00
Hugo Benichi
21c7a52042 Fix bug in MacAddress.fromString()
Test: runtest frameworks-net
Bug: 69390696
Change-Id: I83f01e4915092e08ed201d9b6738bb02498d3bba
2017-12-05 13:14:08 +09:00
nharold
96af5bbd36 Merge "Validate IpSecAlgorithm Length" am: 98ecd7efb2
am: 2a20e7a677

Change-Id: I1ffaa4de392777c5199a411aef9cd10f4e7c3666
2017-12-05 02:37:14 +00:00
nharold
2a20e7a677 Merge "Validate IpSecAlgorithm Length"
am: 98ecd7efb2

Change-Id: I23f7612c119e67f9a1647568aeefde38a365f8da
2017-12-05 02:28:10 +00:00
nharold
98ecd7efb2 Merge "Validate IpSecAlgorithm Length" 2017-12-05 02:13:55 +00:00
Jeff Sharkey
6e46b3bba8 Merge "Match network roaming state to avoid wtf()." am: cd797a5069
am: 5f948c9bc1

Change-Id: I3dd62df8b9bb89936c1c722849bfa921bc8b3e6d
2017-12-05 01:28:55 +00:00
Jeff Sharkey
5f948c9bc1 Merge "Match network roaming state to avoid wtf()."
am: cd797a5069

Change-Id: I6796d37e4458ef4da16d16f4c0f2bdd495007515
2017-12-05 01:11:53 +00:00
Jeff Sharkey
cd797a5069 Merge "Match network roaming state to avoid wtf()." 2017-12-05 00:58:46 +00:00
Hugo Benichi
6600538c55 Merge "MacAddress: light refactors and improve documentation" am: d871cab32d
am: 56eeb80dc5

Change-Id: I1e9948225e7c5ad64fad2e596d03deb3524c411c
2017-12-04 23:51:41 +00:00
Hugo Benichi
56eeb80dc5 Merge "MacAddress: light refactors and improve documentation"
am: d871cab32d

Change-Id: I51bb8786ecd7f53e3342625c7a2625007eedfc0f
2017-12-04 23:38:27 +00:00