Commit Graph

704 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
ef7e3afa1e Add method to NetworkStatsService for UID stats.
Useful for clients such as BatteryStats which currently rely
on NetworkStatsFactory. Data at that stage is incomplete as
it does not account for tethering, VT data and corresponding
464xlat corrections.

Test: runtest frameworks-net, CTS tests pass.
Bug: b/72107146
Merged-In: I31c5b9b4a7c6e72910152415894a137f000a5858
Merged-In: I2527d95000c7500c824ede70f87ecb38e21ed323
(cherry picked from aosp 088ff6824f13145ea52207bdead0d7e454a6f3ce)

Change-Id: Ie80f1bb21124241f3414f9be77aceac9a44ec6d1
2018-03-30 18:58:18 +09:00
Lorenzo Colitti
3754e152e7 Merge "Mark networks with OEM_PAID always restricted" am: dbc568ceaf
am: e019e0e240

Change-Id: I88500f6add4f1a6c8a77eb976a489c11c7dc5b6d
2018-03-30 09:05:09 +00:00
Chalard Jean
e2a49b5b4e Merge "Limit the number of routes for performance" am: 7f5163f453
am: 554f03dc04

Change-Id: I1fcf34b553b4a7cbadd0a2a7bf697140e948243e
2018-03-30 08:58:44 +00:00
TreeHugger Robot
dd8a3c78c5 Merge "Limit the number of routes for performance" into pi-dev 2018-03-30 08:48:25 +00:00
Lorenzo Colitti
56d68c37ea Merge "Require explicitly supplied truncation length" am: 2db4d5fbda
am: d78344d704

Change-Id: I347bfd43be54d162dea831770ab08d792ea1443f
2018-03-30 07:45:04 +00:00
Lorenzo Colitti
dbc568ceaf Merge "Mark networks with OEM_PAID always restricted" 2018-03-30 07:00:54 +00:00
Pavel Maltsev
8cb5245570 Mark networks with OEM_PAID always restricted
Bug: 68762530
Exempt-From-Owner-Approval: OWNERS have approved, but gerrit doesn't see it
Test: runtest -x frameworks/base/tests/net/ -c android.net.NetworkCapabilitiesTest
Change-Id: Ieadef7c42634d890281543226203530fb18eb0a3
2018-03-30 07:00:39 +00:00
Lorenzo Colitti
57498b9359 Merge "Clarify UDP encapsulation socket API" am: db1e624ee1
am: bdc59ca370

Change-Id: I5fcf79691c670e710e46b3a9eac8a580c44028fb
2018-03-30 06:48:17 +00:00
Chalard Jean
f0473e8650 Limit the number of routes for performance
In evaluating whether "most" of the addressing space is
covered, the list of routes are obtained from a third-party
app, so it's possbile the system service stalls unless
some limit is enforced on how much work it has to do.
This change limits the number of routes to 400, as determined
by time measurement on various devices.

Bug: 74176086
Test: runtest framework-net
Change-Id: Ie4a96098bc044ade87b188839586f14dd101c100
2018-03-30 15:41:50 +09:00
Chalard Jean
7f5163f453 Merge "Limit the number of routes for performance" 2018-03-30 06:40:29 +00:00
Benedict Wong
2e1ebb60e6 Require explicitly supplied truncation length
Instead of providing default truncation lengths (based on RFC or
otherwise), this change imposes a restriction that the truncation length
must be supplied for all auth or aead algorithms.

Bug: 77204048
Test: Updated tests, ran on walleye
Merged-In: I4a0e2e71aa97259e56f44e7c8a2ce53135708d97
Change-Id: I4a0e2e71aa97259e56f44e7c8a2ce53135708d97
(cherry picked from commit bb7f2820f5bcccf8618078c2cbe4ea9836797e3b)
2018-03-29 23:07:42 -07:00
Benedict Wong
c165885206 Clarify UDP encapsulation socket API
This change updates the getSocket() methods for IPsec to improve clarity
of the return types, both for public APIs, and internal-only methods.

Bug: 72473753
Test: APIs updated, CTS + unit tests ran.
Merged-In: I0afebd432c5d04c47c93daa1ce616d712aa323d7
Change-Id: I0afebd432c5d04c47c93daa1ce616d712aa323d7
(cherry picked from commit 4c987ebade580d4abc8a3d549e0df90baab33140)
2018-03-29 23:05:42 -07:00
Lorenzo Colitti
2db4d5fbda Merge "Require explicitly supplied truncation length" 2018-03-30 04:59:22 +00:00
Lorenzo Colitti
db1e624ee1 Merge "Clarify UDP encapsulation socket API" 2018-03-30 04:58:47 +00:00
Remi NGUYEN VAN
65ffbafe88 Allow null subscriberId in NetworkStatsManager.
Use a MATCH_MOBILE_WILDCARD template to avoid filtering by
subscriberId when querying statistics from NetworkStatsService.

Bug: 74038898
Change-Id: I8296220472a9ba37044dd1a5ede9bdb45d3ed339
Fixes: 74038898
Test: runtest frameworks-net, CTS tests pass
Merged-In: I1e4e283c6eaecf33d12488e41e0c524f6ff83954
Merged-In: Ia84d2c7cc63bf8b8bf30f133e0382fd7103bf490
(cherry-picked from aosp I4b39e7031416cb33b23d89aa36ff0f774eaa942f)
2018-03-30 12:18:23 +09:00
Chalard Jean
459c9109ca Limit the number of routes for performance
In evaluating whether "most" of the addressing space is
covered, the list of routes are obtained from a third-party
app, so it's possbile the system service stalls unless
some limit is enforced on how much work it has to do.
This change limits the number of routes to 400, as determined
by time measurement on various devices.

Bug: 74176086
Test: runtest framework-net
Change-Id: Ie4a96098bc044ade87b188839586f14dd101c100
2018-03-29 18:13:23 +09:00
Remi NGUYEN VAN
c83f2378e3 Merge "Fix network usage stats on 464xlat tethered." am: 83088dcd8e
am: 7ea8c51311

Change-Id: I016722f3a0ae2ae0a1d48bfacc4fe07ee3578ef7
2018-03-29 07:46:34 +00:00
Benedict Wong
5f38c02385 Require explicitly supplied truncation length
Instead of providing default truncation lengths (based on RFC or
otherwise), this change imposes a restriction that the truncation length
must be supplied for all auth or aead algorithms.

Bug: 77204048
Test: Updated tests, ran on walleye
Change-Id: I4a0e2e71aa97259e56f44e7c8a2ce53135708d97
2018-03-28 18:02:54 -07:00
Remi NGUYEN VAN
c19a5eb8e4 Fix network usage stats on 464xlat tethered.
Usage stats corrections for 464xlat in NetworkStatsFactory are not applied
to tethered traffic. Add adjustments in NetworkStatsService. After
migrating external callers off NetworkStatsFactory, we will be able to
only apply adjustments in NetworkStatsService and remove stacked
interface tracking from NetworkStatsFactory.
Bug: 72107146
Fixes: 72107146
Test: runtest frameworks-net & manual - checked corrected network usage

Change-Id: I5ce450e616b4fddf21f2a491fe5d0c9e9f969bda
2018-03-28 12:14:14 +09:00
Benedict Wong
a042c3f82b Clarify UDP encapsulation socket API
This change updates the getSocket() methods for IPsec to improve clarity
of the return types, both for public APIs, and internal-only methods.

Bug: 72473753
Test: APIs updated, CTS + unit tests ran.
Change-Id: I0afebd432c5d04c47c93daa1ce616d712aa323d7
2018-03-27 19:46:50 -07:00
Pavel Maltsev
51f4d8a11d Merge "Minor clean-up in NetworkCapabilities" am: 539f85a18d am: b1e2bfe4df
am: 8a956a5141

Bug: 72828388
Test: frameworks/base/tests/net/ -c android.net.NetworkCapabilitiesTest

Change-Id: I2f45d2c70c7c0142ae3b3ce9e6329c5f25b63380
(cherry picked from commit feb8d1498a822730e29cf346fe3382e3f5293a58)
2018-03-27 22:45:49 +00:00
Erik Kline
c54b9cb71a Pass all relevant resolver info to netd
Test: runtest frameworks-net passes
Test: manual testing of opportunistic and strict mode works
Bug: 34953048
Bug: 64133961
Bug: 72345192
Merged-In: I96f7747b8f0bb38d95579b688b4c2d068f1229cf
Merged-In: Ia4d896c4cc33c02f0c46d5d4c760cc33b13dff0b
Change-Id: Ia4f1905e1fa60e7a468c2246fb809191d2ba796b
(cherry picked from commit e5dac904d361a349f1cfc48500a678d22e3a7316)
2018-03-23 21:59:24 -07:00
Erik Kline
905e6feea0 Merge "Pass all relevant resolver info to netd" am: ce907ddfc4
am: 189415933f

Change-Id: I96f7747b8f0bb38d95579b688b4c2d068f1229cf
2018-03-24 01:16:37 +00:00
Treehugger Robot
ce907ddfc4 Merge "Pass all relevant resolver info to netd" 2018-03-23 23:41:11 +00:00
Erik Kline
286974f384 Pass all relevant resolver info to netd
Test: runtest frameworks-net passes
Test: manual testing of opportunistic and strict mode works
Bug: 34953048
Bug: 64133961
Bug: 72345192
Change-Id: Ia4f1905e1fa60e7a468c2246fb809191d2ba796b
2018-03-22 23:50:13 -07:00
Chalard Jean
d7a649f8fc Merge "Have PermissionMonitor arbiter which app can access background networks" into pi-dev
am: 1f654aa247

Change-Id: I8d725b07e59654232ee41b82aac007dc6a495a01
2018-03-23 06:48:49 +00:00
Chalard Jean
433c0e652f Merge "Have PermissionMonitor arbiter which app can access background networks" 2018-03-23 06:15:00 +00:00
Chalard Jean
38354d1f60 Have PermissionMonitor arbiter which app can access background networks
This will let ConnectivityService send the right callbacks to the
relevant apps.

Test: manual with apps
      runtest frameworks-net
      cts
      new tests for this functionality
Bug: 67408339

Change-Id: I6f08efd9e73c7e191f833d7f307a3bf4c9e2f0b4
2018-03-23 13:37:56 +09:00
Remi NGUYEN VAN
7370f4270e Merge "Add method to NetworkStatsService for UID stats." am: db89ca3c12
am: f61f5ff462

Change-Id: I2527d95000c7500c824ede70f87ecb38e21ed323
2018-03-23 04:01:09 +00:00
Chalard Jean
e64b8d7bce Have PermissionMonitor arbiter which app can access background networks
This will let ConnectivityService send the right callbacks to the
relevant apps.

Test: manual with apps
      runtest frameworks-net
      cts
      new tests for this functionality
Bug: 67408339

Change-Id: I6f08efd9e73c7e191f833d7f307a3bf4c9e2f0b4
2018-03-22 19:03:59 +09:00
Remi NGUYEN VAN
1cb92c713f Add method to NetworkStatsService for UID stats.
Useful for clients such as BatteryStats which currently rely
on NetworkStatsFactory. Data at that stage is incomplete as
it does not account for tethering, VT data and corresponding
464xlat corrections.

Test: runtest frameworks-net, CTS tests pass.
Change-Id: I763b77f601c827fd2963204694fb5b45425cc791
2018-03-22 15:31:28 +09:00
nharold
d863c59e17 Merge "Check mOwnedByTransform to avoid DELSA on SPI" am: 94d8fa0da6
am: af4c28192c

Change-Id: Ie505e32e6f3bef3fe39198396a40a2b534e2bcda
2018-03-21 05:01:47 +00:00
Nathan Harold
bfcc17cc20 Check mOwnedByTransform to avoid DELSA on SPI
The owned by transform flag prevents the removal
of an SPI from accidentally deleting an associated
SA in the kernel. That flag wasn't actually being
checked, so deleting an SPI would result in the
transform being removed.

The existing code already guarantees that the SA is
deleted when the transform is deleted

Bug: 73258845
Test: runtest frameworks-net
Merged-In: I4c26aea7af817a5d9e54da5db1cdf4f943bcae06
Change-Id: I4c26aea7af817a5d9e54da5db1cdf4f943bcae06
(cherry picked from commit 22795302be4ec35449908cf566aa7c16945df836)
2018-03-20 18:29:02 -07:00
Benedict Wong
76df78ffbf Added implementation for VTI add/remove address
This change adds implementation details for add/remove addresses onto a
VTI.

Bug: 73675031
Test: New tests added, passing on Walleye
Merged-In: Idde9d943a5285d2c13c5c6b0f7b8a9faf718e6a5
Change-Id: Idde9d943a5285d2c13c5c6b0f7b8a9faf718e6a5
(cherry picked from commit ecc9f7cc08804e3fa15fea04ae94ea1bc74edbfe)
2018-03-20 16:01:27 -07:00
Nathan Harold
bd12ffffc0 Check mOwnedByTransform to avoid DELSA on SPI
The owned by transform flag prevents the removal
of an SPI from accidentally deleting an associated
SA in the kernel. That flag wasn't actually being
checked, so deleting an SPI would result in the
transform being removed.

The existing code already guarantees that the SA is
deleted when the transform is deleted

Bug: 73258845
Test: runtest frameworks-net
Change-Id: I4c26aea7af817a5d9e54da5db1cdf4f943bcae06
2018-03-20 11:26:29 -07:00
Benedict Wong
696b853a11 Merge "Added implementation for VTI add/remove address" am: 3f3410ae6b
am: c9b0114429

Change-Id: Idaab45998f4765655bde6cf0274f2ba3c1b3ecf1
2018-03-20 00:09:15 +00:00
Benedict Wong
3f3410ae6b Merge "Added implementation for VTI add/remove address" 2018-03-19 22:05:09 +00:00
Benedict Wong
0da1f39e22 Added implementation for VTI add/remove address
This change adds implementation details for add/remove addresses onto a
VTI.

Bug: 73675031
Test: New tests added, passing on Walleye
Change-Id: Idde9d943a5285d2c13c5c6b0f7b8a9faf718e6a5
2018-03-16 10:25:43 -07:00
Pavel Maltsev
3152f214df Merge "Fixing comments in Network Capabilities" am: b6477d22ca
am: 2c36870f3d

Change-Id: If3c0d76f9598d931d801271c4d0634e15f4b9ed4
2018-03-12 08:08:31 +00:00
Pavel Maltsev
1f9f48e1c4 Fixing comments in Network Capabilities
Clean up after aosp/606338

Test: m -j (only comments has been changed)
Change-Id: I2627654450244024c2be92f9067534dfc2a80891
2018-03-09 10:42:32 -08:00
Pavel Maltsev
5d97ad9fe4 Merge "Minor clean-up in NetworkCapabilities" am: 1dd43b192c
am: 6ab3c9c246

Change-Id: Ie6839576f61563f2a82fec53afc42208f5a37f3c
2018-03-07 23:09:04 +00:00
Treehugger Robot
1dd43b192c Merge "Minor clean-up in NetworkCapabilities" 2018-03-07 21:06:59 +00:00
Remi NGUYEN VAN
1252af5564 Merge "Allow null subscriberId in NetworkStatsManager." am: 09639d8ad0
am: cbcf2a49ea

Change-Id: I1e4e283c6eaecf33d12488e41e0c524f6ff83954
2018-03-06 19:52:57 +00:00
Remi NGUYEN VAN
a08eb7203b Allow null subscriberId in NetworkStatsManager.
Use a MATCH_MOBILE_WILDCARD template to avoid filtering by
subscriberId when querying statistics from NetworkStatsService.

Bug: 74038898
Change-Id: I4b39e7031416cb33b23d89aa36ff0f774eaa942f
Fixes: 74038898
Test: runtest frameworks-net, CTS tests pass
2018-03-06 13:28:19 +09:00
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
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
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
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