Commit Graph

1921 Commits

Author SHA1 Message Date
Benedict Wong
7a2cf07c8d Merge "Add EPROTONOSUPPORT to IpSecManager SSE map" am: 7050ce9434
am: 533559234e

Change-Id: I23e0b56529b9df23558002ddb9e6210d711228cf
2019-04-29 14:16:30 -07:00
Benedict Wong
533559234e Merge "Add EPROTONOSUPPORT to IpSecManager SSE map"
am: 7050ce9434

Change-Id: I9ab4161e2b04615ce782c89cd9e99d98cdbdc92d
2019-04-29 13:35:37 -07:00
Benedict Wong
7e9c1ceadd Add EPROTONOSUPPORT to IpSecManager SSE map
This change maps EPROTONOSUPPORT to the list of error codes that map to
UnsupportedOperationException in IpSecManager.

Bug: 80103456
Test: Compiles, CTS tests ran
Change-Id: Iec3d5fc4a9bcad7c104414afefae775232d46558
2019-04-24 21:31:01 +00:00
Chenbo Feng
7e729bdaa5 [automerger skipped] Merge "Ask netd to swap stats map before reading" into qt-dev am: 197077dc8f -s ours
am: 811f91f337 -s ours
am skip reason: change_id I8fa37c26bec23ffca0b29b679e72ba1189f557f1 with SHA1 876218abcb is in history

Change-Id: I863180a63bcbaa7f7ed76fc759e2f8f2dae1d764
2019-04-23 18:23:54 -07:00
Chenbo Feng
bc13d2e0b0 [automerger skipped] Merge "Add a lock to protect persistent stats snapshot" into qt-dev am: 8e7794e97b -s ours
am: 2c8ab195b0 -s ours
am skip reason: change_id I73851336452110afb74d6dd1ca5e50047d5b3d4a with SHA1 57f207b1c7 is in history

Change-Id: Id3eca996369f20b684f2d3d0436a79288193c7b0
2019-04-23 15:27:25 -07:00
Chenbo Feng
811f91f337 [automerger skipped] Merge "Ask netd to swap stats map before reading" into qt-dev
am: 197077dc8f -s ours
am skip reason: change_id I8fa37c26bec23ffca0b29b679e72ba1189f557f1 with SHA1 876218abcb is in history

Change-Id: I48dc5783885a97a0b0c975202c5878c058695524
2019-04-23 15:13:56 -07:00
TreeHugger Robot
197077dc8f Merge "Ask netd to swap stats map before reading" into qt-dev 2019-04-23 21:57:09 +00:00
Chenbo Feng
2c8ab195b0 [automerger skipped] Merge "Add a lock to protect persistent stats snapshot" into qt-dev
am: 8e7794e97b -s ours
am skip reason: change_id I73851336452110afb74d6dd1ca5e50047d5b3d4a with SHA1 57f207b1c7 is in history

Change-Id: I30d66ea36a7beee9ccf940c547c47a6f7220e0a2
2019-04-23 12:23:12 -07:00
TreeHugger Robot
8e7794e97b Merge "Add a lock to protect persistent stats snapshot" into qt-dev 2019-04-23 18:19:06 +00:00
Chenbo Feng
10fac71887 Ask netd to swap stats map before reading
To avoid protentail race problem between netd and system_server when
reading the network stats map. Always inform netd before reading the
stats and let netd to do a swap between active stats map and inactive
stats map. So the system_server can safely remove the stats after
reading.

Bug: 126620214
Test: android.app.usage.cts.NetworkUsageStatsTest
      android.net.cts.TrafficStatsTest

Change-Id: I8fa37c26bec23ffca0b29b679e72ba1189f557f1
Merged-In: I8fa37c26bec23ffca0b29b679e72ba1189f557f1
(cherry picked from commit f729cb5fd654a0f099128734f849800fde9ba525)
2019-04-23 14:21:32 +00:00
Chenbo Feng
aeb31b53c6 Add a lock to protect persistent stats snapshot
Since the network stats could be polled from multiple services at
runtime, it is not thread safe for networkStatsFactory to hold a
persistent stats snapshot without any protection. Use a internal lock to
prevent concurrent modification on mPersistentSnapshot to fix the
problem.

Bug: 124764595
Test: android.app.usage.cts.NetworkUsageStatsTest
      android.net.cts.TrafficStatsTest

Change-Id: I73851336452110afb74d6dd1ca5e50047d5b3d4a
Merged-In: I73851336452110afb74d6dd1ca5e50047d5b3d4a
Merged-In: I22afb46f17697e8b6359d4f593802e0f4b95db8b
(cherry picked from commit 25243b4eb93c234412a35f9e5d9f1649f8964f83)
2019-04-23 14:21:05 +00:00
Benedict Wong
34c3ba6be7 Merge "Add NATT keepalive resources and methods into IpSecService" am: c345527430 am: 70e5117542
am: 5dd6a60745

Change-Id: I65a8e6d4b4d7c8ccbd708eb3bc16a19becfff43c
2019-04-22 14:11:15 -07:00
Benedict Wong
5dd6a60745 Merge "Add NATT keepalive resources and methods into IpSecService" am: c345527430
am: 70e5117542

Change-Id: I3affb5bdbb0c3f980b6606d728668e74c31646d0
2019-04-22 13:44:20 -07:00
Benedict Wong
70e5117542 Merge "Add NATT keepalive resources and methods into IpSecService"
am: c345527430

Change-Id: I97e7451959d619f42d68a5c29cca410bf0740852
2019-04-22 13:31:52 -07:00
Chalard Jean
a2a6e08245 [automerger skipped] Merge "Restrict access to dangerous methods to <= P" into qt-dev am: f3a812858c -s ours
am: 0ea6659635 -s ours
am skip reason: change_id I95107f7b628eecb54e9f4411785186b668e9f3d8 with SHA1 b3dbc3f845 is in history

Change-Id: Iea63d9398078fcd421f93b78b62ca5e87e77f939
2019-04-22 00:42:55 -07:00
Chalard Jean
0ea6659635 [automerger skipped] Merge "Restrict access to dangerous methods to <= P" into qt-dev
am: f3a812858c -s ours
am skip reason: change_id I95107f7b628eecb54e9f4411785186b668e9f3d8 with SHA1 b3dbc3f845 is in history

Change-Id: I18b0c3f0f36f39e8cc758b98c3e8c44a23b69f25
2019-04-22 00:32:19 -07:00
TreeHugger Robot
f3a812858c Merge "Restrict access to dangerous methods to <= P" into qt-dev 2019-04-22 07:14:10 +00:00
Benedict Wong
4aac3e9e48 Add NATT keepalive resources and methods into IpSecService
This change adds a new NATTKeepalive resource type, along with the
associated allocation/deallocation. Additionally, this change allows
ReferenceCountedResource(s) to not be binder-linked, to allow the
ConnectivityService to verify ownership and allocate a NattKeepalive
without double-registering for binder-death notifications.

Bug: 125517194
Test: IpSecService frameworks tests ran
Change-Id: I8293f79940ad57dabb6f2b9de5e334d06b869443
2019-04-19 11:17:21 -07:00
Chalard Jean
d66c1869f4 [automerger skipped] Merge "Move TrafficStats tags for the network stack constants" am: d2eb7f71b8 am: 2c28ee4cb8 -s ours
am: 19a6b5c027 -s ours
am skip reason: change_id I4882686a86e7c6d42f4b0619b921d02619ed6d4c with SHA1 cf0e250114 is in history

Change-Id: I3e682721ed3e8a574d84d12baf84cc2d6c097412
2019-04-17 00:06:14 -07:00
Chalard Jean
19a6b5c027 [automerger skipped] Merge "Move TrafficStats tags for the network stack constants" am: d2eb7f71b8
am: 2c28ee4cb8 -s ours
am skip reason: change_id I9b648ed6c687d56db61a54570c7880c51c1bae51 with SHA1 1c9c56a164 is in history

Change-Id: If30091ab2a164d01cab11fdd7e6e3aeaa805082c
2019-04-16 23:19:28 -07:00
Chalard Jean
2c28ee4cb8 Merge "Move TrafficStats tags for the network stack constants"
am: d2eb7f71b8

Change-Id: I13ba9e3077bb4ec28229a09f2d4747a43c281bcc
2019-04-16 23:08:07 -07:00
Chalard Jean
d2eb7f71b8 Merge "Move TrafficStats tags for the network stack constants" 2019-04-17 05:45:56 +00:00
Chalard Jean
8a93ab8eef Move TrafficStats tags for the network stack constants
As per API council feedback, these constants should live in
a place that is private to the network stack, only with a
range defined in system API.

Bug: 129433383
Test: m
Change-Id: I84a90f84a9af6fef4667ee4d512ebd0413222086
Merged-In: I4882686a86e7c6d42f4b0619b921d02619ed6d4c
Merged-In: I9b648ed6c687d56db61a54570c7880c51c1bae51
2019-04-17 05:45:40 +00:00
Chalard Jean
cf0e250114 Merge "Move TrafficStats tags for the network stack constants" into qt-dev am: e7ef0a61f2
am: 1c9c56a164

Change-Id: I4882686a86e7c6d42f4b0619b921d02619ed6d4c
2019-04-16 17:38:30 -07:00
Chalard Jean
1c9c56a164 Merge "Move TrafficStats tags for the network stack constants" into qt-dev
am: e7ef0a61f2

Change-Id: I9b648ed6c687d56db61a54570c7880c51c1bae51
2019-04-16 15:06:03 -07:00
Chalard Jean
a69a73ece7 Restrict access to dangerous methods to <= P
Test: make
Fixes: 130143562
Change-Id: I1a6a472f83cf00a1ab174a9c5e67d3e9357a0c45
Merged-In: I95107f7b628eecb54e9f4411785186b668e9f3d8
Merged-In: I890030580fdad45c3f8589bf6adbe5798d578cfe
(cherry picked from commit 0bb53dbb64bbc937a23e1dc7641c8988a6d11d64)
2019-04-16 06:13:09 +00:00
Chalard Jean
ea057ac6a7 Merge "Restrict access to dangerous methods to <= P" am: a1c9270562 am: af8f384985
am: b3dbc3f845

Change-Id: I890030580fdad45c3f8589bf6adbe5798d578cfe
2019-04-15 23:08:09 -07:00
Chalard Jean
b3dbc3f845 Merge "Restrict access to dangerous methods to <= P" am: a1c9270562
am: af8f384985

Change-Id: I95107f7b628eecb54e9f4411785186b668e9f3d8
2019-04-15 22:39:08 -07:00
Chalard Jean
af8f384985 Merge "Restrict access to dangerous methods to <= P"
am: a1c9270562

Change-Id: I3c1271e00e026518e9c4ddafc931a2cac87dcee0
2019-04-15 22:29:28 -07:00
Chalard Jean
a1c9270562 Merge "Restrict access to dangerous methods to <= P" 2019-04-16 05:17:20 +00:00
Chalard Jean
65081e4cf6 Move TrafficStats tags for the network stack constants
As per API council feedback, these constants should live in
a place that is private to the network stack, only with a
range defined in system API.

Bug: 129433383
Test: m
Change-Id: I84a90f84a9af6fef4667ee4d512ebd0413222086
(cherry picked from commit 79a6330650ca04bd7a08afbd63f8016a3b30bc72)
2019-04-16 00:41:54 +09:00
Chenbo Feng
d9e86cc9bd Merge "Ask netd to swap stats map before reading" am: f8b251fd28 am: 3878f31aff
am: 273e13711d

Change-Id: I4ac7af7b290f4f9cfeaef31e3acfc1c1e0458c3c
2019-04-12 18:30:36 -07:00
Chenbo Feng
273e13711d Merge "Ask netd to swap stats map before reading" am: f8b251fd28
am: 3878f31aff

Change-Id: I333e4cdc807da0dd1e2ca118f9ebcf2d94c683de
2019-04-12 16:39:07 -07:00
Chenbo Feng
3878f31aff Merge "Ask netd to swap stats map before reading"
am: f8b251fd28

Change-Id: I7a683e479fe7631a167138314bcf5948e72386ec
2019-04-12 16:06:30 -07:00
Treehugger Robot
f8b251fd28 Merge "Ask netd to swap stats map before reading" 2019-04-12 22:35:52 +00:00
Chenbo Feng
300b6a3b73 Merge "Add a lock to protect persistent stats snapshot" am: f31face531 am: 57f207b1c7
am: 24e9a313cd

Change-Id: I20ba17b211657542c0bfde6acd4299d9ae6b169b
2019-04-12 06:39:02 -07:00
Chenbo Feng
24e9a313cd Merge "Add a lock to protect persistent stats snapshot" am: f31face531
am: 57f207b1c7

Change-Id: Ia91b71536447e65725a85ebf2ac4f411aebe86c8
2019-04-12 05:59:36 -07:00
Chenbo Feng
57f207b1c7 Merge "Add a lock to protect persistent stats snapshot"
am: f31face531

Change-Id: I73851336452110afb74d6dd1ca5e50047d5b3d4a
2019-04-11 18:44:45 -07:00
Treehugger Robot
f31face531 Merge "Add a lock to protect persistent stats snapshot" 2019-04-12 01:33:00 +00:00
Chenbo Feng
876218abcb Ask netd to swap stats map before reading
To avoid protentail race problem between netd and system_server when
reading the network stats map. Always inform netd before reading the
stats and let netd to do a swap between active stats map and inactive
stats map. So the system_server can safely remove the stats after
reading.

Bug: 126620214
Test: android.app.usage.cts.NetworkUsageStatsTest
      android.net.cts.TrafficStatsTest

Change-Id: I8fa37c26bec23ffca0b29b679e72ba1189f557f1
2019-04-10 12:59:38 -07:00
Chenbo Feng
0c419ca9eb Add a lock to protect persistent stats snapshot
Since the network stats could be polled from multiple services at
runtime, it is not thread safe for networkStatsFactory to hold a
persistent stats snapshot without any protection. Use a internal lock to
prevent concurrent modification on mPersistentSnapshot to fix the
problem.

Bug: 124764595
Test: android.app.usage.cts.NetworkUsageStatsTest
      android.net.cts.TrafficStatsTest

Change-Id: I22afb46f17697e8b6359d4f593802e0f4b95db8b
2019-04-10 12:59:18 -07:00
Benedict Wong
5eda9257d9 [automerger skipped] Merge "Fix remove-before-add for IpSecService RefcountedResource" into qt-dev am: 21dbd30681 -s ours
am: 80e078d789 -s ours
am skip reason: change_id I6db75853da9f29e1573512e26351623f22770c5d with SHA1 04738f5b07 is in history

Change-Id: Ibecfa12754acbdce0eb3369d1577eedea91ecaa4
2019-04-10 12:14:07 -07:00
Benedict Wong
80e078d789 [automerger skipped] Merge "Fix remove-before-add for IpSecService RefcountedResource" into qt-dev
am: 21dbd30681 -s ours
am skip reason: change_id I6db75853da9f29e1573512e26351623f22770c5d with SHA1 04738f5b07 is in history

Change-Id: I3e0bd244d8a2ddf86cf4dab99d4a563ea1e2b01e
2019-04-10 11:14:47 -07:00
Benedict Wong
21dbd30681 Merge "Fix remove-before-add for IpSecService RefcountedResource" into qt-dev 2019-04-10 17:07:02 +00:00
Chiachang Wang
92625dde9a [automerger skipped] Merge "Enforce NETWORK_STACK permission for calling NSS#forceUpdateIfaces" into qt-dev am: 60cc2ab6e7 -s ours
am: dee0e3d241 -s ours
am skip reason: change_id I1b26dc64eaab2151e6885fd01cc5e8d4e18c4e60 with SHA1 e3f8027e89 is in history

Change-Id: I20681ad9cedf6beddf3fdf528e6a514694839258
2019-04-10 04:40:37 -07:00
Chiachang Wang
dee0e3d241 [automerger skipped] Merge "Enforce NETWORK_STACK permission for calling NSS#forceUpdateIfaces" into qt-dev
am: 60cc2ab6e7 -s ours
am skip reason: change_id I1b26dc64eaab2151e6885fd01cc5e8d4e18c4e60 with SHA1 e3f8027e89 is in history

Change-Id: I23657309145be45306d2df70dcc517e4c36a82a1
2019-04-10 04:14:11 -07:00
Chiachang Wang
8757df33e4 Enforce NETWORK_STACK permission for calling NSS#forceUpdateIfaces
ConnectivityManager and its usages are removed from
NetworkStatsService. After that, forceUpdateIfaces requires
information that only ConnectivityService has, hence
restricting the calling permission to NETWORK_STACK or
MAINLINE_NETWORK_STACK permission. The required permission
will be changed from READ_NETWORK_USAGE_HISTORY to
NETWORK_STACK or MAINLINE_NETWORK_STACK. This change would make
it impossible to call outside the system.

Bug: 126830974
Test: atest FrameworksNetTests
Merged-In: I1b26dc64eaab2151e6885fd01cc5e8d4e18c4e60
Change-Id: I4ea421e4126a45f65d25fe0bec74243a3b20aeab
(cherry picked from commit 6b895dea25b4fca87d275bb78367411623ded1d4)
2019-04-10 06:36:55 +00:00
Chiachang Wang
851b15c72a Merge "Enforce NETWORK_STACK permission for calling NSS#forceUpdateIfaces" am: 41c49d1a8e am: a1a994c7eb
am: e3f8027e89

Change-Id: I4ea421e4126a45f65d25fe0bec74243a3b20aeab
2019-04-09 23:24:41 -07:00
Chiachang Wang
e3f8027e89 Merge "Enforce NETWORK_STACK permission for calling NSS#forceUpdateIfaces" am: 41c49d1a8e
am: a1a994c7eb

Change-Id: I1b26dc64eaab2151e6885fd01cc5e8d4e18c4e60
2019-04-09 20:14:44 -07:00
Chiachang Wang
a1a994c7eb Merge "Enforce NETWORK_STACK permission for calling NSS#forceUpdateIfaces"
am: 41c49d1a8e

Change-Id: Id5922a41d07c95958090f88a65d22ef5883aefff
2019-04-09 19:37:20 -07:00