Commit Graph

150 Commits

Author SHA1 Message Date
Chalard Jean
33ada883b8 Merge "Add a new ssid field in NetworkCapabilities." into pi-dev
am: f920300665

Change-Id: Ia1f4e51b7c2e9118789242cf6d9e7576c4167cda
2018-04-13 02:14:02 -07:00
Chalard Jean
3ec2c0fc84 Add a new ssid field in NetworkCapabilities.
Bug: 77891227
Test: frameworks-net
Change-Id: Ifba33ecd48ccecce7e8f8d05ff70bb85653f6163
2018-04-13 15:38:35 +09:00
Benedict Wong
534cfd2477 Merge "Force creation of Socket upon Transform application" into pi-dev 2018-04-09 20:55:30 +00:00
Benedict Wong
d370c857f5 Merge "Update IpSecManager to use InetAddress and prefixLen" into pi-dev
am: b172d5b437

Change-Id: I03c0745662ab8868f719dc65c9ff8502e2ff817c
2018-04-05 17:34:11 -07:00
Benedict Wong
2ea91aee42 Update IpSecManager to use InetAddress and prefixLen
LinkAddress constructors are currently @hide; this change updates
IpSecManager to use InetAddress and prefixLen, and then construct a
LinkAddress internally. LinkAddress is used over the binder interface to
IpSecService to ensure validity.

Bug: 77528639
Test: CTS, Java unit tests ran on walleye
Change-Id: I19e124adef6d9f4992d8293db3190bcf74c95848
2018-04-05 17:41:11 +00:00
Benedict Wong
218bfc4751 Merge "Force creation of Socket upon Transform application" am: 4acfd60844
am: 1f8c0950b1

Change-Id: I2034448a22461d51728e66bcc0e965821aa4a42f
2018-04-04 12:52:00 -07:00
Benedict Wong
031d447363 Force creation of Socket upon Transform application
This change forces Socket and DatagramSocket to populate the
SocketImpl, ensuring that the socket file descriptor can be
retrieved when applying Transport mode Transforms

This is done by calling getSoLinger(), triggering a getImpl(), which
triggers setImpl() if needed.

Bug: 77491294
Test: Added tests in IpSecManagerTest, ran on walleye
Merged-In: I40da08b031357710eb794e0f866aec5660c79594
Change-Id: I40da08b031357710eb794e0f866aec5660c79594
(cherry picked from commit d175a3d3a01cfdb5ab6d4e61d15950583f8006d6)
2018-04-04 10:33:49 -07:00
TreeHugger Robot
4f58ec4b83 Merge "Mark networks with OEM_PAID always restricted" into pi-dev 2018-04-04 16:54:46 +00:00
Lorenzo Colitti
9b58dd356c Mark networks with OEM_PAID always restricted
Bug: 68762530
Test: runtest -x frameworks/base/tests/net/ -c android.net.NetworkCapabilitiesTest

Cherry-picked from AOSP with no conflicts

Merged-in: I173ee0a3bc1797d03ba34c5f025844eaada87ee4
Change-Id: I173ee0a3bc1797d03ba34c5f025844eaada87ee4
(cherry picked from commit efbacc0ccb70917b2782272e6b8f1a0fb3f56cbe)
2018-04-04 05:35:54 +00:00
Benedict Wong
412ff4144b Force creation of Socket upon Transform application
This change forces Socket and DatagramSocket to populate the
SocketImpl, ensuring that the socket file descriptor can be
retrieved when applying Transport mode Transforms

This is done by calling getSoLinger(), triggering a getImpl(), which
triggers setImpl() if needed.

Bug: 77491294
Test: Added tests in IpSecManagerTest, ran on walleye
Change-Id: I40da08b031357710eb794e0f866aec5660c79594
2018-04-03 17:04:55 -07:00
Nathan Harold
78fd96e934 Merge "Add AppOps Checks for MANAGE_IPSEC_TUNNELS" into pi-dev
am: 80a2bba9a6

Change-Id: Icd1b2cfc699ab44e4ca536b98298d5b23db7372e
2018-04-03 14:41:56 -07:00
Nathan Harold
68a7edf1cb Add AppOps Checks for MANAGE_IPSEC_TUNNELS
Adds support for a new AppOp to permit services to
use IpSec tunnel mode. The IpSecService now needs
a context so change the service mode to a cached
service rather than a static service.

Bug: 66955045
Test: runtest frameworks-net
Change-Id: I17a4a286225b432c3e15ea1587d946189931b4f4
2018-04-03 18:23:11 +00:00
Remi NGUYEN VAN
1720e75aa2 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
Merged-In: Ieb25c41c651499fdd01225ae5ac21d95e3d823f5
Merged-In: I016722f3a0ae2ae0a1d48bfacc4fe07ee3578ef7
(cherry-pick of aosp I5ce450e616b4fddf21f2a491fe5d0c9e9f969bda)

Change-Id: Id41cf22a0f9a63cb1832e9375bfb045861f08e52
2018-04-02 13:30:02 +00:00
Remi NGUYEN VAN
d197642ba8 Merge "Add method to NetworkStatsService for UID stats." into pi-dev 2018-04-02 05:40:04 +00:00
Benedict Wong
c37a5742a2 Merge changes from topic "encap-api" into pi-dev
* changes:
  Require explicitly supplied truncation length
  Clarify UDP encapsulation socket API
2018-03-30 20:28:19 +00:00
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
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
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
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
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
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
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
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
Chalard Jean
9cbc882c08 Give VPNs the INTERNET capability when they route most of the IP space
Test: manual, plus wrote some new tests for this
Bug: 72765718
Change-Id: I9759da72b752fd8eeb1d0647db9ab341f04c0528
2018-03-02 16:20:22 +09:00