Commit Graph

5346 Commits

Author SHA1 Message Date
Paul Jensen
6cdb34183b Fix socket leaks in various android.net.Network methods.
Bug: 72124526
Test: make CtsNetTestCases
Merged-In: I2a2254ce65c2176ae0be1d6276034b1bb0cad987
Merged-In: I23150482d6c2ab2eaa2b37732af68af69320792b
Change-Id: I3398b67272360f894e01a8cdfbc47b17d77c2330
(cherry picked from commit 55eaa09f96)
2018-03-30 12:20:35 -07:00
Pavel Maltsev
5e5bc33153 Merge "Add OEM_PAID capability to system api" into pi-dev
am: 07019bb20f

Change-Id: Ic164c4a29cd449a31b2f1c12c8c345bcc5dc77fa
2018-03-30 18:30:23 +00:00
Jeff Sharkey
c798269988 Merge "API council requested tweaks to NetworkRequest." into pi-dev
am: 93fc2b5049

Change-Id: I0d090ebb7d57689a061badcf593ae9a37d88f7ce
2018-03-30 18:22:13 +00:00
Pavel Maltsev
07019bb20f Merge "Add OEM_PAID capability to system api" into pi-dev 2018-03-30 16:32:52 +00:00
Jeff Sharkey
93fc2b5049 Merge "API council requested tweaks to NetworkRequest." into pi-dev 2018-03-30 16:30:24 +00:00
Paul Jensen
fffa078935 Merge "Fix socket leaks in various android.net.Network methods." into pi-dev
am: f26c5341a5

Change-Id: I2a2254ce65c2176ae0be1d6276034b1bb0cad987
2018-03-30 16:22:51 +00:00
Chalard Jean
ddf7a1446d Merge "Limit the number of routes for performance" into pi-dev
am: dd8a3c78c5

Change-Id: Ida402ad8f864400561bba0e07cfd5fe766ee08bd
2018-03-30 16:10:31 +00:00
Chalard Jean
35805c3f97 Merge "Clarify documentation for getActiveNetworkInfo and friends" into pi-dev
am: 039947df6a

Change-Id: Iab75c8d432ca68031bcf7cbf22baf8269169a908
2018-03-30 16:05:29 +00:00
Remi NGUYEN VAN
8343728e7d [automerger skipped] Merge "Allow null subscriberId in NetworkStatsManager." into pi-dev
am: 38468e9f2f  -s ours

Change-Id: I6e8983cc087a8a42e1404bb5f99bcd297b0ff313
2018-03-30 15:55:32 +00:00
Lorenzo Colitti
729b3b5f1f Merge "Add Network.fromNetworkHandle()" into pi-dev
am: c0b767a937

Change-Id: I22e68ab29982690dee5b2c0c6e1fbd47df0b0326
2018-03-30 14:55:48 +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
TreeHugger Robot
f26c5341a5 Merge "Fix socket leaks in various android.net.Network methods." into pi-dev 2018-03-30 09:47:51 +00: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
Chalard Jean
24b861fa74 Merge "Clarify documentation for getActiveNetworkInfo and friends" am: b1016fbf14
am: bc4e495705

Change-Id: I339bb71182723907ed078e8be739c4d4ea2d1da5
2018-03-30 08:51:38 +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
e019e0e240 Merge "Mark networks with OEM_PAID always restricted"
am: dbc568ceaf

Change-Id: I4ffcf01e1f79c8a3570ea2b819688b55904939fe
2018-03-30 08:47:25 +00:00
Chalard Jean
554f03dc04 Merge "Limit the number of routes for performance"
am: 7f5163f453

Change-Id: If4de2779b24560f75a7bb977dbb0f996115a0648
2018-03-30 08:42:42 +00:00
Chalard Jean
bc4e495705 Merge "Clarify documentation for getActiveNetworkInfo and friends"
am: b1016fbf14

Change-Id: I167776fb6ec44aff4b35b58378b54e3b55907427
2018-03-30 08:36:58 +00:00
TreeHugger Robot
039947df6a Merge "Clarify documentation for getActiveNetworkInfo and friends" into pi-dev 2018-03-30 08:22:29 +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
Remi NGUYEN VAN
38468e9f2f Merge "Allow null subscriberId in NetworkStatsManager." into pi-dev 2018-03-30 07:39:23 +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
d78344d704 Merge "Require explicitly supplied truncation length"
am: 2db4d5fbda

Change-Id: I20f7f910f4f0369e38eebd0b7fe6970331763e85
2018-03-30 06:48:22 +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
Chalard Jean
b1016fbf14 Merge "Clarify documentation for getActiveNetworkInfo and friends" 2018-03-30 06:37:22 +00:00
Lorenzo Colitti
bdc59ca370 Merge "Clarify UDP encapsulation socket API"
am: db1e624ee1

Change-Id: Ie1e7ea81440afee2618211d989989cf5daff3e1e
2018-03-30 06:35:22 +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
Chalard Jean
96d10a75b6 Clarify documentation for getActiveNetworkInfo and friends
For VPNs it's unobvious what these methods do, so document that.

Bug: 70917007
Test: Comment changes only. Checkdoc passes.
Change-Id: I31ec1aea356d88d969eaf9fc7d8c2ed13ce924eb
2018-03-30 12:22:06 +09: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
Paul Jensen
55eaa09f96 Fix socket leaks in various android.net.Network methods.
Bug: 72124526
Test: make CtsNetTestCases
Change-Id: I3398b67272360f894e01a8cdfbc47b17d77c2330
2018-03-29 07:43:01 -04:00
Paul Jensen
b895ac0fe6 Add Network.fromNetworkHandle()
This is the counterpart to Network.getNetworkHandle() and facilitates
native code calling back to Java with network handle values from
getNetworkHandle.

Bug: 77210159
Bug: 64148938
Test: make CtsNetTestCases

Change-Id: I032b959d84180c063a79ddd97c35e7384b0f50a1
2018-03-29 07:24:59 -04: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
Chalard Jean
33703ef8a7 Clarify documentation for getActiveNetworkInfo and friends
For VPNs it's unobvious what these methods do, so document that.

Bug: 70917007
Test: Comment changes only. Checkdoc passes.
Change-Id: I31ec1aea356d88d969eaf9fc7d8c2ed13ce924eb
2018-03-29 18:10:56 +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
Remi NGUYEN VAN
7ea8c51311 Merge "Fix network usage stats on 464xlat tethered."
am: 83088dcd8e

Change-Id: I0e13c2a6b9f6b5d0701a073ddc835781d5d2aace
2018-03-29 07:36:21 +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
Pavel Maltsev
089fe77ba7 Make addUnwantedCapability method public
Allow apps to specify a list of capabilities that network must not have
in order to satisfy the request.

Bug: 72828388
Test: m -j
Change-Id: I91ee54963f7b92899c7a107b3a450b268c62fd8d
2018-03-28 15:09:50 -07:00
Jeff Sharkey
e5886f37ec API council requested tweaks to NetworkRequest.
If you put values into the Builder, you should be able to observe
those values on the built object.

Test: atest android.net.cts.NetworkRequestTest
Bug: 74945408
Change-Id: I9aacceb82c98f7881f0eb5e1106d89d469b816a7
2018-03-28 14:02:00 -06:00
android-build-team Robot
e6a1f52884 Snap for 4683893 from f0edf03edaaf15a48295ce87baae93e1a7db0122 to pi-release
Change-Id: I8a450a70da831c3964896b1ba09467cf62f9c138
2018-03-28 07:25:50 +00:00
Pavel Maltsev
1868811e8f Add OEM_PAID capability to system api
Some system apps should be able to request OEM_PAID networks.  This
makes a lot of sense when Android is used as in-vehicle infotainment
systems.

Bug: 68762530

Test: runtest -x frameworks/base/tests/net/ -c android.net.NetworkCapabilitiesTest

Change-Id: Ic916de7522a9f803a2410bc4e3e82101fd9d0dbd
2018-03-27 23:17:14 -07:00
Pavel Maltsev
19d1da7a95 Merge "Merge "Minor clean-up in NetworkCapabilities" am: 1dd43b192c am: 6ab3c9c246 am: 5d97ad9fe4" into pi-dev
am: 601861fd1c

Change-Id: I6605aad319ea268827f47d95fb6aef7c4c07ae93
2018-03-28 05:28:17 +00: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