am: 9b361c2674 -s ours
am skip reason: change_id I109260842cfc25f06e40694997fcbb4afa02c867 with SHA1 3a78d9db46 is in history
Change-Id: I7b2712e4ab3635f94f8257d88f24c20bc68a3ac0
To prepare for enabling MissingNullability Metalava check this CL
works on adding missing nullability issues that metalava flags if
we tell it to flag new things since API 29.
This is not a complete CL, mostly addresses public api and
toString/equals for @SystemApi
Exempt-From-Owner-Approval: Large scale nullability clean up
Bug: 124515653
Test: make -j checkapi
Merged-In: I109260842cfc25f06e40694997fcbb4afa02c867
Change-Id: I109260842cfc25f06e40694997fcbb4afa02c867
To prepare for enabling MissingNullability Metalava check this CL
works on adding missing nullability issues that metalava flags if
we tell it to flag new things since API 29.
This is not a complete CL, mostly addresses public api and
toString/equals for @SystemApi
Exempt-From-Owner-Approval: Large scale nullability clean up
Bug: 124515653
Test: make -j checkapi
Merged-In: I109260842cfc25f06e40694997fcbb4afa02c867
Change-Id: I109260842cfc25f06e40694997fcbb4afa02c867
The utilities help using ConnectivityService in tests, and will be used
to write integration tests for ConnectivityService.
Test: atest FrameworksNetTests
Change-Id: Ie895ad05139cd5768d3d8a9bd5589d72571f47e6
In addition, make mMergedSubscriberIds a list to fit usage of multi-SIM
devices.
Bug: 135105735
Bug: 137137221
Test: manual
Change-Id: I364262559789112f35b88f4c298463bf4af2e82a
am: 84f11755d6 -s ours
am skip reason: change_id I8ebbefbe4df00e40f4896a17fa52c8438d41286e with SHA1 96fe3f5ff6 is in history
Change-Id: I9678ef008af3682687fe692cf98bb78e46f09748
am: e6e7d93808 -s ours
am skip reason: change_id I8ebbefbe4df00e40f4896a17fa52c8438d41286e with SHA1 96fe3f5ff6 is in history
Change-Id: I78ea7922a88791b43eb0c8bc337443f128213c63
am: 2c74b2e5d8 -s ours
am skip reason: change_id I8ebbefbe4df00e40f4896a17fa52c8438d41286e with SHA1 96fe3f5ff6 is in history
Change-Id: Ia76c06513e23c4052262c8ac4c7212a548267a8c
am: 2c74b2e5d8 -s ours
am skip reason: change_id I8ebbefbe4df00e40f4896a17fa52c8438d41286e with SHA1 e5e15aee20 is in history
Change-Id: If50b9304e64a5d4c18c78d933c121d428d660d61
am: 96fe3f5ff6 -s ours
am skip reason: change_id I8ebbefbe4df00e40f4896a17fa52c8438d41286e with SHA1 e5e15aee20 is in history
Change-Id: I179221edf5fe58a1b4b747bd51f86a569ed051b4
Interface stats on stacked interfaces is usually clatd. For
xt_qtaguid supported device, the stats is already accounted
against its final egress interface by the kernel.
Framework side does not need to handle stats on statcked
interface at all.
However, on devices that support BPF offload, xlat464
packets are seen by the iptables rules as arriving on stack
interface only. Thus, add stack interface into accounting is
needed.
Bug: 136193260
Test: 1. atest FrameworksNetTests
2. atest android.app.usage.cts.NetworkUsageStatsTest
3. manual test on ipv6-only wifi network
Merged-In: I8ebbefbe4df00e40f4896a17fa52c8438d41286e
Change-Id: I8ebbefbe4df00e40f4896a17fa52c8438d41286e
(cherry-pick from aosp/1009306)
(cherry picked from commit feb79bd0d7c5ecc7ac5ba9f54ed2d51ee9fd7e74)
Interface stats on stacked interfaces is usually clatd. For
xt_qtaguid supported device, the stats is already accounted
against its final egress interface by the kernel.
Framework side does not need to handle stats on statcked
interface at all.
However, on devices that support BPF offload, xlat464
packets are seen by the iptables rules as arriving on stack
interface only. Thus, add stack interface into accounting is
needed.
Bug: 136193260
Test: 1. atest FrameworksNetTests
2. atest android.app.usage.cts.NetworkUsageStatsTest
3. manual test on ipv6-only wifi network
Merged-In: I8ebbefbe4df00e40f4896a17fa52c8438d41286e
Change-Id: I8ebbefbe4df00e40f4896a17fa52c8438d41286e
(cherry-pick from aosp/1009306)
Interface stats on stacked interfaces is usually clatd. For
xt_qtaguid supported device, the stats is already accounted
against its final egress interface by the kernel.
Framework side does not need to handle stats on statcked
interface at all.
However, on devices that support BPF offload, xlat464
packets are seen by the iptables rules as arriving on stack
interface only. Thus, add stack interface into accounting is
needed.
Bug: 136193260
Test: 1. atest FrameworksNetTests
2. atest android.app.usage.cts.NetworkUsageStatsTest
3. manual test on ipv6-only wifi network
Change-Id: I8ebbefbe4df00e40f4896a17fa52c8438d41286e
NetworkStatsFactory is owned by NetworkStatsService, and any
accesses to NSF data should go through NSS.
Test: atest FrameworksNetTests
Change-Id: Idbd0dbbaeb11313f63474e7ec0e01f974349fc89
NetworkStatsService is the only consumer of the data coming from
NetworkStatsFactory, but the factory itself is instantiated and
owned by NetworkManagementService.
Move it into NetworkStatsService instead.
Test: atest FrameworksNetTests
Change-Id: I52df1e545c646927952579da22845a12d1d7563b
This ensures the constructor takes the necessary lock before
accessing memmber variables.
Bug: 113122541
Test: atest FrameworksNetTests
Change-Id: Ibd324ed922c738b8d77d4eb74f45b75c6645bdc7
NetworkStatsService uses an internal boolean to know when it has
started for the purpose of preventing access to other internal
variables before they are initialized.
However that boolean is set to true in systemReady() non-atomically
with respect to the initialization of the other variables it guards,
which can cause the system server to crash.
This patch fixes this concurrency bug by moving setting the internal
boolean flag and the variable it guards in one atomic synchronized
block.
This patch also removes code checking if bandwidth control is enabled,
because this is now always true.
Bug: 132767673
Test: Compiled.
Change-Id: Ia089b5767ce271d669879c975508654d4dd03429
am: f80234a9b0 -s ours
am skip reason: change_id If2ef8d8f038f32c8cf974aa02cfc1dc7e44dbad3 with SHA1 d749767f44 is in history
Change-Id: I5b525feb1e7df2a89dea4f38b521973ccaac0746
This change inlines the logic from readNetworkStatsDetailInternal, and
reduces reundant checks in mUseBpfStats
Bug: 113122541
Test: atest FrameworksNetTests run, passing
Merged-In: If2ef8d8f038f32c8cf974aa02cfc1dc7e44dbad3
Change-Id: If7d41052115ed145da8a610d676f6ed33c8d5e63
(cherry picked from commit 8c9d8c5e05cd35a340c4224c61f7fa9e95b5c861)
This change removes the now-unused VPN arrays in the network stats
observer and recorder classes. These are always null values in every
call site.
Bug: 113122541
Bug: 120145746
Bug: 129264869
Bug: 134244752
Test: FrameworksNetTest passing
Test: Manual tests show data usage fixes maintained.
Merged-In: Ieb8645acc400fdaeb0df7092c5369b96f9f35af9
Change-Id: I66f263d7e12bce7668901306c0c2ecdda634abaf
(cherry picked from commit 833603caabb1a850a63a970fc285b4c8ed7401f8)
This change fixes detailed UID stats to ensure network and battery stats
both take VPNs into account. NetworkStatsFactory is being made aware of
VPNs enabled, and the full set of underlying networks present.
Since traffic can only be migrated over a NetworkStats delta, NSF
maintains a NetworkStats snapshot across all UIDs/ifaces/tags.
This snapshot gets updated whenever NSF records a new snapshot
(based on various hooks such as VPN updating its underlying networks,
network getting lost, etc.), or NetworkStatsService's
getDetailedUidStats() method being called.
This change widens the scope of the existing mPersistentSnapshot lock,
renaming it to mPersistentDataLock, and ensures that TUN migrations are
not done in parallel. Additionally, mVpnInfos is updated via
pointer-swapping, to reduce the scope of the mPersistentDataLock.
The safety of this change is predicated on:
1. NetworkStatsFactory lock not held, so services cannot deadlock through
the cyclical lock.
2. The broadening of the scope of the lock in NetworkStatsFactory has no
threading implications, as it is always the last (leaf node) lock held,
and therefore is impossible to have lock inversion.
Additionally, to ensure VPNs work with 464xlat, the VPN info passed to
the NetworkStatsFactory includes all underlying interfaces, instead of
only passing the first one.
This (partially) re-applies changes from:
aosp/972848: Add one more test for VPN usage stats.
aosp/972847: Addressing comments for http://ag/7700679.
aosp/885338: NetworkStatsService: Fix getDetailedUidStats to take VPNs
into account.
Co-developed with: Varun Anand <vaanand@google.com>
Bug: 113122541
Bug: 120145746
Bug: 129264869
Bug: 134244752
Test: FrameworksNetTest passing
Test: Manual tests show data usage fixes maintained.
Merged-In: I6466ec1411fc5ed6954125d27d353b6cd1be719e
Change-Id: Id45ae956ad7165be346ecc010e17d260563ac1c0
(cherry picked from commit 9fbbdebc61513982a6775460e1d400956f803bde)