Commit Graph

1222 Commits

Author SHA1 Message Date
Benedict Wong
043ff486ce [automerger skipped] Merge "Force creation of Socket upon Transform application" into pi-dev
am: e7e135c3ad  -s ours

Change-Id: I42b4d0c1b40b9ae6df076d5845331a50b93f2dd6
2018-04-09 14:11:21 -07:00
Benedict Wong
e7e135c3ad Merge "Force creation of Socket upon Transform application" into pi-dev 2018-04-09 20:55:30 +00:00
Lorenzo Colitti
a646274f6d Merge changes from topic "unwanted" into pi-dev
am: 2eae1e3a45

Change-Id: Ib6f46ff91a6d774a516fa299284d9d552081dde6
2018-04-06 20:01:23 -07:00
Lorenzo Colitti
76bb817438 Add @param tag for state in queryDetailsForUidTagState.
Change-Id: I22de424ccb2b30b2a56edd17dc982565b8aa7d4a
Fix: 77518425
Test: make doc-comment-check-docs
2018-04-06 23:17:23 +09:00
Benedict Wong
09a8c052c8 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
d39837f7e2 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
50c22a9d0f Merge "Force creation of Socket upon Transform application" am: 119cf2bc61
am: abcf07af81

Change-Id: I2034448a22461d51728e66bcc0e965821aa4a42f
2018-04-04 12:52:00 -07:00
Benedict Wong
57ab3f648e 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
Benedict Wong
78652232dd 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
6807999817 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
65ef843176 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
c7aa9fa5d1 [automerger skipped] Merge "Fix network usage stats on 464xlat tethered." into pi-dev
am: 78452f1b8d  -s ours

Change-Id: I49845b0bc0183d4d1a6c694a70e30a90a9a59759
2018-04-02 20:15:50 -07:00
Lorenzo Colitti
7d3f1bbe4d Merge "Allow applications to query for foreground/background data usage." into pi-dev
am: e5161662a6

Change-Id: I755f6d28c3e881fb2f6ee864f63eb2a080a1045d
2018-04-02 19:37:19 -07:00
Remi NGUYEN VAN
78452f1b8d Merge "Fix network usage stats on 464xlat tethered." into pi-dev 2018-04-02 23:09:50 +00:00
Lorenzo Colitti
e5161662a6 Merge "Allow applications to query for foreground/background data usage." into pi-dev 2018-04-02 22:20:03 +00:00
Remi NGUYEN VAN
38ff833161 [automerger skipped] Merge "Add method to NetworkStatsService for UID stats." into pi-dev
am: 4cac91f292  -s ours

Change-Id: I4182b2dfad1f40dd29da8c3612cf0dbc4038aa7b
2018-04-02 19:43:54 +00:00
Remi NGUYEN VAN
0023be9ea9 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
Lorenzo Colitti
b0efeaf855 Allow applications to query for foreground/background data usage.
Currently the NetworkStatsManager APIs allow applications to
query for their own data usage by UID and tag, but do not allow
applications to query by foreground/background state.

This is causing popular apps to resort to parsing xt_qtaguid
stats files directly. Because this is no longer allowed for apps
targeting P and above, provide replacement functionality.

This API allows apps to query for data usage for a given state,
but not to receive data usage broken down by state. This is
consistent with how the current UID and tag APIs work. It is also
not an undue burden on apps: there are currently only two states
of interest (FOREGROUND and everything else), and even if we add
states in the future, unmodified apps can still obtain total
traffic using STATE_ALL.

Bug: 72977484
Test: New CTS test added in other change in this topic.
Change-Id: Ic8c9194569ffd599b49e4a8197c5c2ea0ec3f7f7
2018-04-02 19:58:24 +09:00
Remi NGUYEN VAN
4cac91f292 Merge "Add method to NetworkStatsService for UID stats." into pi-dev 2018-04-02 05:40:04 +00:00
Benedict Wong
0daca16b23 [automerger skipped] Merge "Disallow Reserved SPI Allocation" into pi-dev
am: 97e1f5b953  -s ours

Change-Id: I80f554392a01a4942b5c4927b8ad13d11dd5490a
2018-03-31 01:30:03 +00:00
Nathan Harold
2ca5629668 [automerger skipped] Disallow Reserved SPI Allocation
am: 1b88f0e6ab  -s ours

Change-Id: I64fb79980348f96116ad73893571babe3d7d29a6
2018-03-31 01:05:18 +00:00
Benedict Wong
4bc550c5d1 [automerger skipped] Merge changes from topic "encap-api" into pi-dev
am: cafd11d598  -s ours

Change-Id: I19ea85409c7b8653a734e74afc092959e91a0aad
2018-03-30 22:57:46 +00:00
Benedict Wong
97e1f5b953 Merge "Disallow Reserved SPI Allocation" into pi-dev 2018-03-30 22:29:26 +00:00
Benedict Wong
addb481748 [automerger skipped] Require explicitly supplied truncation length
am: ad2615cae5  -s ours

Change-Id: I873ba85ee623a445c2ade21f656bd56e8a0fdeed
2018-03-30 22:28:03 +00:00
Benedict Wong
cafd11d598 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
8edbb9b98a [automerger skipped] Merge "Allow null subscriberId in NetworkStatsManager." into pi-dev
am: 66fcefd311  -s ours

Change-Id: I6e8983cc087a8a42e1404bb5f99bcd297b0ff313
2018-03-30 15:55:32 +00:00
Benedict Wong
693f1beccc [automerger skipped] Merge "Add documentation for TCP interactions with transforms" into pi-dev
am: 0f57fe460b  -s ours

Change-Id: I6f24e8fbffedccbbce98c8bfede66ffc764a58ec
2018-03-30 10:43:36 +00:00
Remi NGUYEN VAN
944eab8689 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
Nathan Harold
1b88f0e6ab Disallow Reserved SPI Allocation
Disallow the allocation of SPIs in the range
reserved for future use by RFC 4303.

Bug: 77205120
Test: runtest frameworks-net
Merged-In: I05e26ed34b5871f1a07d5bd7b58b79a64cd74b67
Change-Id: I05e26ed34b5871f1a07d5bd7b58b79a64cd74b67
(cherry picked from commit 7f606ee8e57d9d8b7c5d0cb2a78421aa02efb385)
2018-03-30 01:54:36 -07:00
Lorenzo Colitti
dcc60bcef3 Merge "Disallow Reserved SPI Allocation" am: 9c68e5a5b7
am: 62e6b774e3

Change-Id: Ic5c7857754a04ae7238414b55a1e5ab653d62f6b
2018-03-30 08:33:06 +00:00
Lorenzo Colitti
9951c93f3c Merge "Require explicitly supplied truncation length" am: dc77e9c3da
am: 2749432646

Change-Id: I347bfd43be54d162dea831770ab08d792ea1443f
2018-03-30 07:45:04 +00:00
Remi NGUYEN VAN
66fcefd311 Merge "Allow null subscriberId in NetworkStatsManager." into pi-dev 2018-03-30 07:39:23 +00:00
Lorenzo Colitti
3baa94c23f Merge "Clarify UDP encapsulation socket API" am: 0cf9421304
am: a12c8fe218

Change-Id: I5fcf79691c670e710e46b3a9eac8a580c44028fb
2018-03-30 06:48:17 +00:00
Lorenzo Colitti
9c68e5a5b7 Merge "Disallow Reserved SPI Allocation" 2018-03-30 06:16:17 +00:00
Benedict Wong
ad2615cae5 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
a386e37eab 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
dc77e9c3da Merge "Require explicitly supplied truncation length" 2018-03-30 04:59:22 +00:00
Lorenzo Colitti
0cf9421304 Merge "Clarify UDP encapsulation socket API" 2018-03-30 04:58:47 +00:00
Remi NGUYEN VAN
9968ec4f14 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
Benedict Wong
0f57fe460b Merge "Add documentation for TCP interactions with transforms" into pi-dev 2018-03-30 00:01:43 +00:00
Remi NGUYEN VAN
f11ee9cd95 Merge "Fix network usage stats on 464xlat tethered." am: 83088dcd8e
am: aa20932ff1

Change-Id: I016722f3a0ae2ae0a1d48bfacc4fe07ee3578ef7
2018-03-29 07:46:34 +00:00
Benedict Wong
543e30cd5d 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
Nathan Harold
c37f6f6b89 Disallow Reserved SPI Allocation
Disallow the allocation of SPIs in the range
reserved for future use by RFC 4303.

Bug: 77205120
Test: runtest frameworks-net
Change-Id: I05e26ed34b5871f1a07d5bd7b58b79a64cd74b67
2018-03-28 16:08:57 +00:00
Remi NGUYEN VAN
857952d498 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
50b0ab8086 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
Benedict Wong
3465252be3 Merge "Add documentation for TCP interactions with transforms" am: 0721bd0ff4
am: 28427a9c4d

Change-Id: I3aef3f0f16929b60cd9bb293373d18a3988076a7
2018-03-28 01:26:33 +00:00
Benedict Wong
c5106f3cfc Add documentation for TCP interactions with transforms
Updates API documentation to mention that TCP sockets where transforms
are deactivated will not send FIN packets.

Bug: 74851550
Test: API updates only
Merged-In: I8169f221c8c747538a8bddfbf02dcc73c9337189
Change-Id: I8169f221c8c747538a8bddfbf02dcc73c9337189
(cherry picked from commit 7d31a2f3579eff80c3cef07feadf77dbfcbfcd17)
2018-03-27 15:20:32 -07:00
Benedict Wong
0721bd0ff4 Merge "Add documentation for TCP interactions with transforms" 2018-03-27 22:19:37 +00:00
Jeff Sharkey
367d402c6e Merge "Don't let callers OOM the system process." into pi-dev
am: 662cedc67c

Change-Id: I9698aab0d98c564ad7779462485576121e9bc815
2018-03-27 20:08:50 +00:00
TreeHugger Robot
662cedc67c Merge "Don't let callers OOM the system process." into pi-dev 2018-03-27 19:05:24 +00:00