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)
am: 0ea6659635 -s ours
am skip reason: change_id I95107f7b628eecb54e9f4411785186b668e9f3d8 with SHA1 b3dbc3f845 is in history
Change-Id: Iea63d9398078fcd421f93b78b62ca5e87e77f939
am: f3a812858c -s ours
am skip reason: change_id I95107f7b628eecb54e9f4411785186b668e9f3d8 with SHA1 b3dbc3f845 is in history
Change-Id: I18b0c3f0f36f39e8cc758b98c3e8c44a23b69f25
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
am: 19a6b5c027 -s ours
am skip reason: change_id I4882686a86e7c6d42f4b0619b921d02619ed6d4c with SHA1 cf0e250114 is in history
Change-Id: I3e682721ed3e8a574d84d12baf84cc2d6c097412
am: 2c28ee4cb8 -s ours
am skip reason: change_id I9b648ed6c687d56db61a54570c7880c51c1bae51 with SHA1 1c9c56a164 is in history
Change-Id: If30091ab2a164d01cab11fdd7e6e3aeaa805082c
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
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)
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
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
am: 80e078d789 -s ours
am skip reason: change_id I6db75853da9f29e1573512e26351623f22770c5d with SHA1 04738f5b07 is in history
Change-Id: Ibecfa12754acbdce0eb3369d1577eedea91ecaa4
am: 21dbd30681 -s ours
am skip reason: change_id I6db75853da9f29e1573512e26351623f22770c5d with SHA1 04738f5b07 is in history
Change-Id: I3e0bd244d8a2ddf86cf4dab99d4a563ea1e2b01e
am: dee0e3d241 -s ours
am skip reason: change_id I1b26dc64eaab2151e6885fd01cc5e8d4e18c4e60 with SHA1 e3f8027e89 is in history
Change-Id: I20681ad9cedf6beddf3fdf528e6a514694839258
am: 60cc2ab6e7 -s ours
am skip reason: change_id I1b26dc64eaab2151e6885fd01cc5e8d4e18c4e60 with SHA1 e3f8027e89 is in history
Change-Id: I23657309145be45306d2df70dcc517e4c36a82a1
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)
This patch fixes a bug where if a binder dies before the linkToDeath
call, the cleanup will be performed before the entry is added to the
array. While it is safe in that quotas and tracking performs as per
normal, the RefcountedRecord may not be cleaned up.
Rethrowing this exception is safe, since the only paths that would hit
this are all on binder threads coming from applications. Further, it
seems there is only one real way of this getting hit - if the app that
called the creation died during the binder call.
Bug: 126802451
Test: Compiled, CTS tests passing
Change-Id: Ib955acaa5e498c0e977cb5f2e48cffbc9fea8c7c
Merged-In: I6db75853da9f29e1573512e26351623f22770c5d
Merged-In: I416c2e43961ec0e1cc6b2fbcef970fbce858603b
Merged-In: Ib955acaa5e498c0e977cb5f2e48cffbc9fea8c7c
(cherry picked from commit 6c089d90bfa728e9842de0f5947f0c557c62dea0)
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
Change-Id: I776484921b2dbb6735d7940c558fb5e4baed6d1e
am: 8c9e2b7871 -s ours
am skip reason: change_id Idf040a67e53d9b9ec6e6c647ce24f8ada501d355 with SHA1 4be55d08d9 is in history
Change-Id: Ic488c621c0ebe04c6298d7d2a06201abcbb61a37
am: 634dff01cb -s ours
am skip reason: change_id Idf040a67e53d9b9ec6e6c647ce24f8ada501d355 with SHA1 4be55d08d9 is in history
Change-Id: Ic9b6b8c2ca4aabd3ed18291a94992a2b67286064