Commit Graph

3238 Commits

Author SHA1 Message Date
Android Build Merger (Role)
c7810244db Merge "Merge "Tcp socket metrics: implement INetdEventListener callback" am: 93b1787a3d am: 5ba62a2194" into oc-mr1-dev-plus-aosp
am: 0bde9c4355

Change-Id: Id17724faabe77fb7eaad7d3a7e009fb57f0d23d0
2018-01-25 23:22:31 +00:00
Hugo Benichi
65bbfa1c6c Merge "Tcp socket metrics: implement INetdEventListener callback" am: 93b1787a3d
am: 5ba62a2194

Change-Id: I6c30a47ed35394d63b266250e3525976844b0e8f
2018-01-25 22:19:53 +00:00
Treehugger Robot
93b1787a3d Merge "Tcp socket metrics: implement INetdEventListener callback" 2018-01-25 19:23:18 +00:00
nharold
f5092a106b Merge "Move Keepalive out of IpSecTransform.Builder" am: af3fb3efe4 am: bbb4b05a64
am: 461aeb4689

Change-Id: Ic554e34d9b16f522156bc7e8b176f96693e8e32c
2018-01-25 07:59:57 +00:00
nharold
461aeb4689 Merge "Move Keepalive out of IpSecTransform.Builder" am: af3fb3efe4
am: bbb4b05a64

Change-Id: I383aa402d9d570ee7c7d5a603d022d1dade267a5
2018-01-25 07:49:59 +00:00
Chalard Jean
16897eb4aa Merge "Fix a bug where a NetworkAgent gets repeatedly torn down" am: a8452ed2a6
am: 806f0191d4

Change-Id: Ifd63fdf47348dc3a1c1871deacc61470784bdbb6
2018-01-25 07:41:44 +00:00
nharold
af3fb3efe4 Merge "Move Keepalive out of IpSecTransform.Builder" 2018-01-25 05:50:33 +00:00
Chalard Jean
477e36c5fb 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
cf8c3fe19c 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
Hugo Benichi
f90773cf4f Tcp socket metrics: implement INetdEventListener callback
This patch implements the new INetdEventListener.onTcpSocketStatsEvent
callback added in INetdEventListener.

For the time being, tcp socket stats are tracked inside TcpMetrics only
for dumpsys printing and bug report integration as a first step.

Bug: 64147860
Test: manually tested, watching output of
      $ adb shell dumpsys connmetrics
Change-Id: I10ab24c6da4bb654d9198a4d8d00ccdc972cc0d5
2018-01-25 13:26:43 +09:00
Nathan Harold
c43e89f973 Move Keepalive out of IpSecTransform.Builder
The lifecycle of Keepalive offloading is, unfortunately
different from that of an IpSecTransform. Because starting
a keepalive is fundamentally asynchronous, and isn't valid
until after a transform exists, it will now be a separate
optional procedure that may succeed or fail. It remains
linked with a Transform by the need for a Transform to exist
in order to initiate a Keepalive.

Bug: 38350389
Test: compilation
Change-Id: Ia76fccee41f86d694dff436043293d0c0762c041
2018-01-24 19:32:04 -08:00
Nathan Harold
26deacfbe7 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
41002e3080 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
Benedict Wong
f68e5b63ca Merge "Add TunnelInterface API and KernelResourceRecords" am: f811dff3bc am: e1aa92f1c1
am: eacecc37e8

Change-Id: I955d5090171f08e4fa20eac5bdfe761132b87d35
2018-01-24 09:54:06 +00:00
Benedict Wong
e65d8141de Merge "Add xfrm mark in IpSecConfig" am: 73f79ceae9 am: 4077e802ad
am: 22734c40b4

Change-Id: Ibaee9700cc6befdf6bbdb792cb673611e571d19a
2018-01-24 09:48:25 +00:00
Benedict Wong
eacecc37e8 Merge "Add TunnelInterface API and KernelResourceRecords" am: f811dff3bc
am: e1aa92f1c1

Change-Id: If27d78708ce225a900ad78a82d9f323770223808
2018-01-24 09:02:56 +00:00
Benedict Wong
22734c40b4 Merge "Add xfrm mark in IpSecConfig" am: 73f79ceae9
am: 4077e802ad

Change-Id: I03ddca0611c4e0b41edc705cdb39b415205bb14b
2018-01-24 08:19:16 +00:00
Benedict Wong
8149f6eb6c 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
2c852db564 Resolve merge conflicts of 69791b6883 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
69791b6883 Merge changes I3b16caad,Iaf5ea7ab,I09a94042,I69a39039,I35300309, ... am: 6568170b32
am: 84af3a7b2b

Change-Id: I3f2185330789a8b02cc5e05912e3f17256ba1b86
2018-01-24 06:11:06 +00:00
Benedict Wong
73f79ceae9 Merge "Add xfrm mark in IpSecConfig" 2018-01-24 05:53:29 +00:00
Chalard Jean
6568170b32 Merge changes I3b16caad,Iaf5ea7ab,I09a94042,I69a39039,I35300309, ...
* changes:
  Let network requests see VPNs.
  Move constants into a new file.
  Make sure listen requests from VPN apps see their own networks
  Add a test for new UID checking code.
  Remove UID_RANGES_ADDED and REMOVED.
  Move VPN allowed UIDs into NetworkCapabilities.
  Pre-import to remove a conflict.
2018-01-24 04:09:44 +00:00
Benedict Wong
cf8f8026b5 Merge "Expose applyTunnelModeTransform as a system API" am: d056f32bd9 am: c2253ff48d
am: 9aaff41725

Change-Id: Ia1f81f5696814f5b9479882e1102a5f8508a4512
2018-01-24 02:58:17 +00:00
Benedict Wong
9aaff41725 Merge "Expose applyTunnelModeTransform as a system API" am: d056f32bd9
am: c2253ff48d

Change-Id: I85c761df4b77dba0b62adfd3488f66cdcf780fa3
2018-01-24 02:50:47 +00:00
Benedict Wong
e0d448f31e Expose applyTunnelModeTransform as a system API
Simple change to expose systemAPI for applyTunnelModeTransform

Bug: 36033193
Test: All CTS, unit tests passing
Change-Id: I2d857c048bc0dc80c3949387f946b1f5adf0527e
2018-01-23 23:25:54 +00:00
Lorenzo Colitti
f5c668bf38 Add metered, roaming, and defaultNetwork info to NetworkTemplate. am: 0f9bce6883
am: e383807d7f

Change-Id: I1faf95edec0e836c69016c84ad2a2c8518f8eb53
2018-01-23 19:39:18 +00:00
Lorenzo Colitti
5d50149710 Add the defaultNetwork element to the netstats.proto. am: 9781f785bc
am: adcb94472a

Change-Id: I292e903617d3af1867529e68eb20538afb66f665
2018-01-23 19:30:57 +00:00
Ricky Wai
c61216d4a2 Merge "Add ConnectivityManager.getNetworkWatchlistConfigHash()" 2018-01-23 14:25:39 +00:00
Chalard Jean
dda156ab0c 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
f474fc3ac1 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
f213ca1345 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
ecacd5e00b 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
ce1a9d8fd7 Pre-import to remove a conflict.
Test: compiles and passes checkstyle
Change-Id: I1ffdd88e6268fee0cf88992420ab21eb42928957
2018-01-23 21:38:00 +09:00
Lorenzo Colitti
0f9bce6883 Add metered, roaming, and defaultNetwork info to NetworkTemplate.
This will allow data usage clients to query for and receive
callbacks on data usage matching these conditions.

Bug: 35142602
Test: atest FrameworksNetTests
Change-Id: I4d985a2734eeab7ee454c09cc2098b6b3c671c23
Merged-In: I4d985a2734eeab7ee454c09cc2098b6b3c671c23
2018-01-23 18:38:48 +09:00
Lorenzo Colitti
9781f785bc Add the defaultNetwork element to the netstats.proto.
This is in its own commit because AOSP has diverged from internal
master.

Bug: 35142602
Test: builds, boots
Change-Id: I75fc85b961bc919e3d6c2adce6d6861c6f2c8379
Merged-In: I75fc85b961bc919e3d6c2adce6d6861c6f2c8379
2018-01-23 18:38:48 +09:00
Ricky Wai
44dcbde52a 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
Lorenzo Colitti
683f590c37 Merge "Remove obsolete NetworkStats.Entry constructor." am: 1683b6968d am: cdeb50aa48
am: cbbed8ee1f

Change-Id: Id6a664fd5ad8c182468b742e810e65afee248ad5
2018-01-23 02:35:08 +00:00
Lorenzo Colitti
cbbed8ee1f Merge "Remove obsolete NetworkStats.Entry constructor." am: 1683b6968d
am: cdeb50aa48

Change-Id: If60b58f95707bab3ae89050234226d54386398e8
2018-01-23 02:23:32 +00:00
Lorenzo Colitti
9c93808e5e Merge changes I4d985a27,Ic6f2bc18
* changes:
  Add metered, roaming, and defaultNetwork info to NetworkTemplate.
  Unbreak frameworks-net tests broken by missing libutilscallstack.
2018-01-23 00:28:39 +00:00
Lorenzo Colitti
1683b6968d Merge "Remove obsolete NetworkStats.Entry constructor." 2018-01-23 00:15:15 +00:00
Benedict Wong
77dad60634 Merge "Rename create/delete transform methods" am: 7ee26e72cf am: 5b71c4a0a5
am: 5b3e788908

Change-Id: Ie07b0b608b3dfcbfc4228a15e26fe6f6559315f9
2018-01-22 20:03:48 +00:00
Benedict Wong
5b3e788908 Merge "Rename create/delete transform methods" am: 7ee26e72cf
am: 5b71c4a0a5

Change-Id: I16bfb511ac2d6094e246f79d51fe4520d3e765cd
2018-01-22 19:53:15 +00:00
Benedict Wong
7ee26e72cf Merge "Rename create/delete transform methods" 2018-01-22 17:57:15 +00:00
Lorenzo Colitti
53ba2f0c12 Add metered, roaming, and defaultNetwork info to NetworkTemplate.
This will allow data usage clients to query for and receive
callbacks on data usage matching these conditions.

Bug: 35142602
Test: atest FrameworksNetTests
Change-Id: I4d985a2734eeab7ee454c09cc2098b6b3c671c23
2018-01-22 21:41:20 +09:00
Lorenzo Colitti
ca74e23b02 Merge changes from topic "multipath-datausage"
* changes:
  Add the defaultNetwork element to the netstats.proto.
  Add getDefaultNetwork to the NetworkStats public API.
2018-01-21 16:07:29 +00:00
Lorenzo Colitti
1e507e6178 Remove obsolete NetworkStats.Entry constructor.
The only caller is telephony code, and it's being fixed in this
topic.

Bug: 35142602
Test: builds, boots
Change-Id: Ia77a1c2c297037f311c2355610c206cd8e3192c4
2018-01-21 23:01:35 +09:00
nharold
7f013ecf5a Merge "Add Tunnel Interface APIs to IpSecManager" am: 08d07aec50 am: 696cff166c
am: 0174b8afcf

Change-Id: I094751d965b679e85a0f200b2382f1715d69e400
2018-01-19 20:25:18 +00:00
nharold
0174b8afcf Merge "Add Tunnel Interface APIs to IpSecManager" am: 08d07aec50
am: 696cff166c

Change-Id: I0cd07c51e9512b7e9471e1a09c977fca2bf12e48
2018-01-19 20:16:38 +00:00
nharold
08d07aec50 Merge "Add Tunnel Interface APIs to IpSecManager" 2018-01-19 19:43:17 +00:00
Benedict Wong
f33f031344 Rename create/delete transform methods
CreateTransportModeTransform and DeleteTransportModeTransform are both
agnostic as far as which mode of transform it creates/deletes. As such,
to facilitate the implementation of tunnel mode, this patch renames them
to CreateTransform and DeleteTransform, along with all test names.

Bug: 63588681
Test: frameworks/base unit tests and CTS tests run, passed
Change-Id: I1f015eb7ad0e85fca966658a9402485ca2b44091
2018-01-19 10:43:01 -08:00