Commit Graph

4476 Commits

Author SHA1 Message Date
Lorenzo Colitti
6eb22572ce Merge changes Id8776d14,Ifa291c62,I5ea9d200 am: 5087f93c36
am: 69a42fa9c5

Change-Id: I1ac9d349850d607c5fbf4a47760bc09de1c18043
2018-01-19 16:37:44 +00:00
Lorenzo Colitti
69a42fa9c5 Merge changes Id8776d14,Ifa291c62,I5ea9d200
am: 5087f93c36

Change-Id: I7a0b01cba8bdee67cffabddacb4ff5f4591cbc34
2018-01-19 16:30:17 +00:00
Treehugger Robot
5087f93c36 Merge changes Id8776d14,Ifa291c62,I5ea9d200
* changes:
  Track and persist in stats whether traffic is on the default network.
  Add the default network to NetworkStats and NetworkStatsCollection.
  Pass all default networks to NetworkStatsService
2018-01-19 14:48:52 +00:00
Lorenzo Colitti
9d93e1a453 Track and persist in stats whether traffic is on the default network.
This change adds the defaultNetwork to the ident based on current
system networking state, and persists that value to flash.

Bug: 35142602
Test: runtest frameworks-net
Test: downloaded files using default/non-default networks while watching dumpsys netstats
Change-Id: Id8776d149b2977548a9eb455ad4926af55e25aba
2018-01-19 19:49:16 +09:00
Lorenzo Colitti
cd969ef97c Add the default network to NetworkStats and NetworkStatsCollection.
This allows us to maintain NetworkStats entries that track
whether the traffic was on the default network.

At the moment, the stats collection code always passes in
DEFAULT_NETWORK_NO. However, this value is a no-op, since it is
not persisted to disk. Only the ident, the uid/set/tag, and the
packet/byte/operation counters are persisted.

A future change will add defaultNetwork to the ident and start
persisting it.

Bug: 35142602
Test: runtest frameworks-net
Change-Id: Ifa291c62c0fa389b88e5561086a29dcd7cee2253
2018-01-19 19:49:16 +09:00
Lorenzo Colitti
2486188d7b Pass all default networks to NetworkStatsService
This will allow NetworkStatsService to treat traffic on these
networks differently from traffic where the app selects a network
that is not the default.

Bug: 35142602
Test: runtest frameworks-net
Change-Id: I5ea9d200d9fb153490c6108bb9390bf152f297da
2018-01-19 16:40:10 +09:00
Jeff Sharkey
59f824c977 Merge "Add ability to override subscriber capabilities." am: d6cd4b241a
am: d358b0d1ea

Change-Id: Ib22d57c7cde75560cfd5bdd71b75d29b1056f783
2018-01-19 01:11:41 +00:00
Jeff Sharkey
d358b0d1ea Merge "Add ability to override subscriber capabilities."
am: d6cd4b241a

Change-Id: Id035d437e9b297ba70ba9231f6cfdd44e5b9c257
2018-01-19 01:04:32 +00:00
Di Lu
fcf78b1727 Add xfrm mark in IpSecConfig
Bug: 63589600
Test: runtest frameworks-net
Change-Id: I2d38d781b8b31d8bf39fd4e9a7e31509f15a9e16
2018-01-18 15:23:56 -08:00
Jeff Sharkey
0f2738ecb0 Add ability to override subscriber capabilities.
In a future set of CLs, NPMS will offer to override a handful of
capabilities on a per-subId basis.  Define a no-op version of the
interface to make it easier to add new methods in the future.

Test: bit FrameworksNetTests:android.net.,com.android.server.net.
Test: bit FrameworksTelephonyTests:com.android.internal.telephony.dataconnection.DataConnectionTest
Bug: 64133169
Change-Id: I03dfd98463861f0338c4174e8d8a88c300ea5b55
2018-01-18 14:46:13 -07:00
Jeff Sharkey
f22a540007 Merge "Add "not congested" network capability." am: 8a06cca651
am: 944a9864a2

Change-Id: I2c7276bd657f5805c0b6492a216435270023a3c6
2018-01-18 04:10:00 +00:00
Erik Kline
4d75779d8d Merge "Add basic resolution of Private DNS hostname" am: 5c2380b0d2
am: 5d10f67617

Change-Id: Ifc776c67025925fbeb2c13038ae78061c32567f5
2018-01-18 04:02:46 +00:00
Jeff Sharkey
944a9864a2 Merge "Add "not congested" network capability."
am: 8a06cca651

Change-Id: I02ea25610df63b40547c3114c0f9a9ef59560e90
2018-01-18 03:58:13 +00:00
Erik Kline
5d10f67617 Merge "Add basic resolution of Private DNS hostname"
am: 5c2380b0d2

Change-Id: I9ce3476d80b05c140a02aaf1c21d4da2a68a8909
2018-01-18 03:54:50 +00:00
Jeff Sharkey
8a06cca651 Merge "Add "not congested" network capability." 2018-01-18 03:28:34 +00:00
Lorenzo Colitti
2e00fc0771 Merge "Add public API methods for private DNS." am: 6cba185910
am: a57e5c074c

Change-Id: I8d5a5b72c128231cca1dfb00bc00e887b5fbfc53
2018-01-18 03:27:51 +00:00
Lorenzo Colitti
a57e5c074c Merge "Add public API methods for private DNS."
am: 6cba185910

Change-Id: If2bdfb05fcb235888bf272e4cfddb14619fc3f78
2018-01-18 03:21:02 +00:00
Treehugger Robot
5c2380b0d2 Merge "Add basic resolution of Private DNS hostname" 2018-01-18 02:44:53 +00:00
Lorenzo Colitti
6cba185910 Merge "Add public API methods for private DNS." 2018-01-18 01:17:17 +00:00
dalyk
7643abcbe3 Add public API methods for private DNS.
Test: Small modifications to LinkProperties test.
Bug: 71828272
Change-Id: Id2f5acb5469132ec4a917837739f42085c71498e
2018-01-17 15:46:21 -05:00
nharold
e3ba80104d Merge "IpSec - API Tweak for removeTransportModeTransform" am: 656040874d
am: eee6875535

Change-Id: Id9e9ab09669a53f53f03e5a6e0e4757434c3f3f3
2018-01-17 20:39:29 +00:00
nharold
eee6875535 Merge "IpSec - API Tweak for removeTransportModeTransform"
am: 656040874d

Change-Id: I0ed7128014bbca8973f84d719449dcf70da45fa2
2018-01-17 20:31:15 +00:00
Benedict Wong
1142483151 Address comments and final cleanup from refcounting integration
Added some extra comments on reference counting and moved a few methods
around. No significant logical changes made in this CL

Bug: 63409385
Test: CTS, Unit tests (both frameworks-base and netd) and binder tests
all pass

Change-Id: I89f1f4a021db48ae406fefefa6aca7406045736c
2018-01-17 12:10:49 -08:00
nharold
656040874d Merge "IpSec - API Tweak for removeTransportModeTransform" 2018-01-17 19:07:10 +00:00
Erik Kline
31b4a9ef0c Add basic resolution of Private DNS hostname
Test: as follows
    - built
    - flashed
    - booted
Bug: 34953048
Bug: 64133961
Change-Id: I0a2289ea51a9294352c91d2ead23730d9b0333a5
2018-01-17 23:17:08 +09:00
nharold
00a7fde299 Merge changes from topic "ipsec-oneway-transform" am: 60a21328d5
am: ff0e4bc116

Change-Id: I58fe595ff14e3ee6be5191171367e8a2f7fad6da
2018-01-17 09:53:37 +00:00
Nathan Harold
7b0b71c853 Make Transforms Unidirectional am: 3865a008e7
am: 41fe8097ed

Change-Id: Ie3ca37e14d977fd255a7791ae3332ddda29ab37e
2018-01-17 09:50:37 +00:00
nharold
ff0e4bc116 Merge changes from topic "ipsec-oneway-transform"
am: 60a21328d5

Change-Id: If98285e2bd41e2eedaf81f1ff0e5f2b2d3827f91
2018-01-17 09:42:03 +00:00
Nathan Harold
41fe8097ed Make Transforms Unidirectional
am: 3865a008e7

Change-Id: I7e80c75b3b227fdd16479120d8b7203cc5f28d1c
2018-01-17 09:37:57 +00:00
Jeff Sharkey
b04d5111ec Add "not congested" network capability.
Can be used by a network to indicate when it's congested, meaning that
apps should defer network traffic that could be done at a later time.

Test: bit FrameworksNetTests:android.net.,com.android.server.net.,com.android.server.connectivity.VpnTest,com.android.server.ConnectivityServiceTest
Bug: 64133169
Change-Id: I8a60b6f02dd0f42268b59690556c16335d34e220
2018-01-17 02:27:04 -07:00
Nathan Harold
dd2ed2bbe7 IpSec - API Tweak for removeTransportModeTransform
Because IpSecTransforms are now unidirectional,
and because the only mechanism for removing Transforms
removes it from both directions, the API can no longer
use the Transform parameter to meaningfully validate
that the caller had applied a transform. Since that
functionality was as-yet unimplemented and is now
infeasible, the transform parameter is removed.

Bug: 72079356
Test: cts - IpSecManagerTest; runtest frameworks-net
Change-Id: If19b0d34bdc6daf31a40d6d62bff326dcbca08c0
2018-01-17 01:11:46 -08:00
nharold
60a21328d5 Merge changes from topic "ipsec-oneway-transform"
* changes:
  Update IpSecService UnitTests
  Make Transforms Unidirectional
2018-01-17 08:40:37 +00:00
Nathan Harold
f52a471f1a Update IpSecService UnitTests
The IpSecService Unit tests relied on the
directionality of the IpSecConfig and previously
did not specify a source address. Unit tests
updated without functional change other than to
address these two requirements.

Bug: 71717213
Test: runtest frameworks-net
Change-Id: Iedbed735bc50fd4fdfe985f9e173956062a7b0d1
2018-01-16 19:38:10 -08:00
Nathan Harold
3865a008e7 Make Transforms Unidirectional
Convert the IpSecTransform from being a bi-directional
pair of SAs to a unidirectional single SA. This CL
also removes the concept of "direction from SAs meaning
that a IpSecTransform may now be applied to a socket
in either direction.

-Make transforms unidirectional
-Add Convert allocateSpi() to use destination rather
 than direction and remote address
-Remove directionality from builders for IpSecTransform
-Change applyTransportModeTransform() to take a
 direction in which to apply the transform object.
-Additional minor naming updates
-Restrict IpSecConfig to only print keys on eng builds
-Move DIRECTION constants to IpSecManager
-Add sourceAddress parameter to IpSecTransform to provide
 additional guarantees about the source address of data;
 (explicit failure rather than implicit failure).
-Move SPI to the build() method of IpSecTransform

Bug: 71717213
Test: runtest frameworks-net, CTS - IpSecManagerTest
Change-Id: I0824b37f443f4b8c62536d9801238c63ed8f2a1c
2018-01-16 11:08:31 -08:00
Lorenzo Colitti
f0c515477e Merge changes I0d0c0fac,Ifb9b00b6 am: 3fbfac269b
am: bfaf963337

Change-Id: Ie943428132fbcfcc565d54b46830ed297227ef35
2018-01-16 18:41:46 +00:00
Treehugger Robot
3fbfac269b Merge changes I0d0c0fac,Ifb9b00b6
* changes:
  Split updateCapabilities into two methods.
  More strictly check NetworkCapabilities callbacks.
2018-01-16 14:25:13 +00:00
Lorenzo Colitti
d38b9f7acf Merge "Update netId to nethandle mapping in NetworkTest." am: 75c5e3dcb5
am: 503135596b

Change-Id: I5e8e57f38580742eae38f63f43e37cc647412212
2018-01-16 13:34:46 +00:00
Lorenzo Colitti
46f96cb694 Split updateCapabilities into two methods.
This makes the code a bit easier to follow.

Test: ConnectivityServiceTest continues to pass
Change-Id: I0d0c0facc1e3ba07b53542b35da40ddc096ff92e
2018-01-16 21:25:10 +09:00
Treehugger Robot
75c5e3dcb5 Merge "Update netId to nethandle mapping in NetworkTest." 2018-01-16 12:23:02 +00:00
Hugo Benichi
e1c0b97447 Merge "MacAddress: add @NonNull annotations" am: bc3edde9c6
am: a7c125e5b2

Change-Id: Icaa08c082797c6dbc3382e0662e24e1c84114175
2018-01-16 10:30:20 +00:00
Lorenzo Colitti
959f60b710 Update netId to nethandle mapping in NetworkTest.
Bug: 63052780
Test: NetworkTest now passes
Change-Id: I5f1cb3055b7042a19afb5dd62f082912157612ba
2018-01-16 17:19:04 +09:00
Hugo Benichi
bc3edde9c6 Merge "MacAddress: add @NonNull annotations" 2018-01-16 07:10:50 +00:00
Lorenzo Colitti
fb91426d12 Merge "Change the netId to nethandle mapping." am: 35bd74cfd3
am: feaf412e19

Change-Id: Idd1b2f462c1c78bdb68b43a4aa77bf2358f7cb52
2018-01-16 05:16:34 +00:00
Hugo Benichi
8f21758d4a MacAddress: add @NonNull annotations
This patch adds to the MacAddress class:
  - getAddressType() method which replaces addressType(), for naming
  consistency
  - @NonNull annotations on all input and output reference values for
  all public methods (@hide and public).

TYPE_UNKNOWN, which currently cannot be observed with a non @hide
method, is also removed from the public api.

Bug: 71866627
Test: $ runtest frameworks-net
Change-Id: I2af70408d46f431b7b32183e6b48ddae9a261a2c
2018-01-16 13:32:59 +09:00
Treehugger Robot
35bd74cfd3 Merge "Change the netId to nethandle mapping." 2018-01-16 02:58:56 +00:00
Hugo Benichi
9c8cc85a3d Merge "ConnectivityService: synchronize access on mLockdownEnabled" am: dca465ab21
am: 2d59e3cab0

Change-Id: Icadee616fc95e1c126285524dfe49331fcf87462
2018-01-16 02:31:48 +00:00
Hugo Benichi
dca465ab21 Merge "ConnectivityService: synchronize access on mLockdownEnabled" 2018-01-16 00:20:52 +00:00
Lorenzo Colitti
5183e57449 Change the netId to nethandle mapping.
Being able to update this handle is necessary to ensure that
system-only OTAs do not break vendor code that relies on
nethandles.

Bug: 63052780
Test: walleye builds, boots, networking works
Test: MultinetworkApiTest CTS tests passes
Change-Id: I049a4ad2610ca68b8f56377b63be7e5e8ce76039
2018-01-16 02:08:09 +09:00
Lorenzo Colitti
7045d61b50 More strictly check NetworkCapabilities callbacks.
This change more strictly accounts for onCapabilitiesChanged
callbaks and their values. It exposes several cases where we the
callbacks we send are spurious.

Test: ConnectivityServiceTest continues to pass
Change-Id: Ifb9b00b6f0cae48f8ed41a525100d1744b5f429b
2018-01-16 00:25:13 +09:00
Erik Kline
898092a149 Merge "change NMS removeNetwork to netd binder variant" am: e61ee4198e
am: b73571b981

Change-Id: I6de7f38c7081e14d817cc7aad44cb5b6a978328b
2018-01-15 14:38:08 +00:00