Commit Graph

4759 Commits

Author SHA1 Message Date
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
83939e37af Merge "MacAddress: Use SecureRandom and add a 46 bit randomized MAC generator" am: 028e2a048e
am: c7ec0f6fc3

Change-Id: I6dba4e244c660d29f107e471250d39e9caafb17e
2018-02-07 05:32:01 +00:00
Jong Wook Kim
c7ec0f6fc3 Merge "MacAddress: Use SecureRandom and add a 46 bit randomized MAC generator"
am: 028e2a048e

Change-Id: If35e07b78b17329a25cf78adbf3d8244af4a4f81
2018-02-07 05:20:19 +00:00
Jong Wook Kim
028e2a048e Merge "MacAddress: Use SecureRandom and add a 46 bit randomized MAC generator" 2018-02-07 02:06:07 +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
Andreas Gampe
3cdcd5d395 Merge "Frameworks: Mark tests" am: 997937820d am: 043d868185
am: 6ae05e38bd

Change-Id: I55b62b64236937c66a21ec667216f7f1d505a5b5
2018-02-06 09:29:10 +00:00
Andreas Gampe
6ae05e38bd Merge "Frameworks: Mark tests" am: 997937820d
am: 043d868185

Change-Id: I73c717b99b9660a11141b5392c6993ab9aabf85c
2018-02-06 09:14:05 +00:00
Andreas Gampe
043d868185 Merge "Frameworks: Mark tests"
am: 997937820d

Change-Id: I07af71812c623a14bd8df098e9991a331bdecbc2
2018-02-06 09:04:38 +00:00
Treehugger Robot
997937820d Merge "Frameworks: Mark tests" 2018-02-06 06:03:09 +00:00
Andreas Gampe
3fa5c22fc8 Frameworks: Mark tests
Add @Ignore and @Test to make Errorprone happy.

Bug: 72076216
Test: m javac-check RUN_ERROR_PRONE=true
Test: atest ConnectivityServiceTest
Test: atest WifiManagerTest
Change-Id: Id2423c545eccaa768203faf86e14d0a558d927cd
2018-01-31 01:04:00 +00:00
nharold
4b1ac9cb0c Merge changes from topic "cherry-pick-cell-keepalive" am: 7e8374e9fc am: 86362b4677
am: 16f3959dd0  -s ours

Change-Id: I1852cb11d6d33963b8e463729a952c4c22bc553a
2018-01-30 20:05:03 +00:00
nharold
16f3959dd0 Merge changes from topic "cherry-pick-cell-keepalive" am: 7e8374e9fc
am: 86362b4677

Change-Id: Ib4ba3f739a91ea2700611732f71afec0cc997ae4
2018-01-30 19:52:22 +00:00
nharold
86362b4677 Merge changes from topic "cherry-pick-cell-keepalive"
am: 7e8374e9fc

Change-Id: I3001cd2693b2c57643672fd7f370b5cca2890585
2018-01-30 19:41:53 +00:00
nharold
7e8374e9fc Merge changes from topic "cherry-pick-cell-keepalive"
* changes:
  Rework KeepalivePacketData for Compatibility with Cell
  Add Constants for NATT Keepalive to RILConstants
  Relocate KeepalivePacketData to frameworks/base
2018-01-30 18:39:07 +00:00
Hugo Benichi
0cfad8c7bf Merge changes I303d1102,I72c9aa43,If13a5284 am: 1aaf45bf89 am: 5001af80ff
am: bb119158f9

Change-Id: Iad1030a22f25bed92bd9d504fb1a40fc1e1cfdc5
2018-01-30 01:55:28 +00:00
Hugo Benichi
bb119158f9 Merge changes I303d1102,I72c9aa43,If13a5284 am: 1aaf45bf89
am: 5001af80ff

Change-Id: Ida5f28fc0e8e99199ac7129a6e3df0fbe864d90b
2018-01-30 01:47:07 +00:00
Hugo Benichi
5001af80ff Merge changes I303d1102,I72c9aa43,If13a5284
am: 1aaf45bf89

Change-Id: I402de7fe5fc0e9bf56dc42f4c956c511baee78ab
2018-01-30 01:41:23 +00:00
Hugo Benichi
1aaf45bf89 Merge changes I303d1102,I72c9aa43,If13a5284
* changes:
  Fix default network validation overcounting
  Prevent crash in NetworkManagementServiceTest#shutdown()
  Fix ApfTest
2018-01-30 00:26:31 +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
Hugo Benichi
11f04e863e Fix default network validation overcounting
When switching from a validated default network to a new validated
default network (typically because of a better score),
DefaultNetworkMetrics would not reset the last validation timestamp.

This would cause the new default network to have a total recorded
validation time overcounted by the validation time of the previous
default network.

The following fix should be applied downstream for consumers of
previously recorded data:

  validation_time = min validation_time, duration_time);

Test: runtest -x frameworks/base/tests/net/../IpConnectivityMetricsTest
Change-Id: I303d11023527c19435f5f5e796a0295ae3f76d9f
2018-01-29 16:07:33 +09:00
Hugo Benichi
f78548d222 Prevent crash in NetworkManagementServiceTest#shutdown()
The shutdown method in NetworkManagementServiceTest was trying to close
the local socket on the test side, causing the NativeDaemonConnector
internal to NetworkManagementService to sometime crash due to the
output stream on NetworkManagementService side to throw on pending
reads.

The correct fix would be to shutdown the NativeDaemonConnector
inside NetworkManagementService and implement NetworkManagementService's
shutdown method, however there is no way to cleanly close a
NativeDaemonConnector.

Instead, this patch doesn't do any cleanup of the listening socket, the
test local socket, and its output stream. These objects' resources get
eventually collected by the system when the test process exits.

Test: runtest frameworks-net
Change-Id: I72c9aa43403754b55e9d23bf4f3ba8b7b4a3e10a
2018-01-29 16:01:56 +09:00
Chalard Jean
659130c440 Merge "Fix a bug where a NetworkAgent gets repeatedly torn down" am: f597b81b4e am: ca1ca2c465
am: bc60d7b06e

Change-Id: I06a64bbfaa501f860d7078cb2cc6d9af60b57eb8
2018-01-25 07:51:11 +00:00
Chalard Jean
bc60d7b06e Merge "Fix a bug where a NetworkAgent gets repeatedly torn down" am: f597b81b4e
am: ca1ca2c465

Change-Id: Ifd63fdf47348dc3a1c1871deacc61470784bdbb6
2018-01-25 07:41:44 +00:00
Chalard Jean
ca1ca2c465 Merge "Fix a bug where a NetworkAgent gets repeatedly torn down"
am: f597b81b4e

Change-Id: Ic37c9f60448b10c861a78848bed18ebd4e0ad910
2018-01-25 07:33:35 +00:00
Chalard Jean
f597b81b4e Merge "Fix a bug where a NetworkAgent gets repeatedly torn down" 2018-01-25 05:37:21 +00: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
TreeHugger Robot
f5082af9fa Merge "Determine the multipath hint from data usage." 2018-01-25 03:49:19 +00:00
Nathan Harold
ef085d99d7 Merge changes from topic "keepalive-on-cell"
* changes:
  Rework KeepalivePacketData for Compatibility with Cell
  Add Constants for NATT Keepalive to RILConstants
  Relocate KeepalivePacketData to frameworks/base
2018-01-25 00:48:43 +00:00
Benedict Wong
d084e3b4a3 Merge "Add tunnel-mode calls to netd in IpSecService" am: 475fe28c50 am: 77189e8a86
am: 0502191af2

Change-Id: I998d44bac0993a8f2e9e228a0b0a80adfaa4d87e
2018-01-24 20:07:20 +00:00
Benedict Wong
0502191af2 Merge "Add tunnel-mode calls to netd in IpSecService" am: 475fe28c50
am: 77189e8a86

Change-Id: I8a3d16c8e58ad1c09d967943abe1c729fe37636a
2018-01-24 19:56:24 +00:00
Benedict Wong
77189e8a86 Merge "Add tunnel-mode calls to netd in IpSecService"
am: 475fe28c50

Change-Id: I60bd2cd453b8ea7b5a0fb5eb0b59e8a9fe8f57cb
2018-01-24 19:48:26 +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
Lorenzo Colitti
389a81485e Determine the multipath hint from data usage.
Bug: 35142602
Test: builds, boots
Change-Id: I0f5de5e313ead442aa210f163db035fcf7de5e73
2018-01-25 01:25:09 +09:00
Benedict Wong
9e2e358045 Merge "Add TunnelInterface API and KernelResourceRecords" am: 7a7d04e103 am: 7cacbb3c86
am: 54cd11245e

Change-Id: I955d5090171f08e4fa20eac5bdfe761132b87d35
2018-01-24 09:54:06 +00:00
Benedict Wong
379c600c4c Merge "Add xfrm mark in IpSecConfig" am: da7f993d34 am: 6829dd8442
am: f717d668cf

Change-Id: Ibaee9700cc6befdf6bbdb792cb673611e571d19a
2018-01-24 09:48:25 +00:00
Benedict Wong
54cd11245e Merge "Add TunnelInterface API and KernelResourceRecords" am: 7a7d04e103
am: 7cacbb3c86

Change-Id: If27d78708ce225a900ad78a82d9f323770223808
2018-01-24 09:02:56 +00:00
Benedict Wong
7cacbb3c86 Merge "Add TunnelInterface API and KernelResourceRecords"
am: 7a7d04e103

Change-Id: Ic8a93b2d6d8280c01808968251e6f422fa1d2340
2018-01-24 08:55:38 +00:00
Benedict Wong
859629fa0b Add tunnel-mode calls to netd in IpSecService
Adds calls to relevant netd methods in IpSecService, enabling Tunnel
mode functionality.

Bug: 63588681
Test: Compiles, passing CTS + unit tests
Change-Id: I6deb68584cddb03f21bd76370d4ef69cadc1bf16
2018-01-24 08:19:55 +00:00
Benedict Wong
f717d668cf Merge "Add xfrm mark in IpSecConfig" am: da7f993d34
am: 6829dd8442

Change-Id: I03ddca0611c4e0b41edc705cdb39b415205bb14b
2018-01-24 08:19:16 +00:00
Benedict Wong
6829dd8442 Merge "Add xfrm mark in IpSecConfig"
am: da7f993d34

Change-Id: Idcac0878b4f74c25ef007fb7f1643fca5de80225
2018-01-24 08:00:52 +00:00
Benedict Wong
7a7d04e103 Merge "Add TunnelInterface API and KernelResourceRecords" 2018-01-24 07:25:04 +00:00
Benedict Wong
145b425fac Add TunnelInterface API and KernelResourceRecords
This change adds one KernelResourceRecord type (TunnelInterfaceRecord),
and adds methods for the creation of TunnelInterfaces, as well as the
application of Transforms to the given TunnelInterfaces

As part of the generation of ikeys/okeys, a ReserveKeyTracker manages a
java bitset to avoid collisions and reserve/release keys.

Bug: 63588681
Test: Compiles, CTS, unit tests all pass on AOSP_marlin
Change-Id: I9e9b6455e27073acd4491eae666aa966b3b10e0f
2018-01-24 07:24:27 +00: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
d15f09adf7 Merge changes I3b16caad,Iaf5ea7ab,I09a94042,I69a39039,I35300309, ... am: 515b2e9434
am: ee75f435b9

Change-Id: I3f2185330789a8b02cc5e05912e3f17256ba1b86
2018-01-24 06:11:06 +00:00
Chalard Jean
ee75f435b9 Merge changes I3b16caad,Iaf5ea7ab,I09a94042,I69a39039,I35300309, ...
am: 515b2e9434

Change-Id: I49269ac65138be59d68561ea1c15ff2ad0339d8b
2018-01-24 06:03:41 +00:00
Benedict Wong
da7f993d34 Merge "Add xfrm mark in IpSecConfig" 2018-01-24 05:53:29 +00:00