Commit Graph

1807 Commits

Author SHA1 Message Date
Aurimas Liutikas
f4f18c5a47 [automerger skipped] Merge "Add missing nullability annotations." am: 9b361c2674 -s ours am: b3c5131dcb -s ours
am: 48d66161b9 -s ours
am skip reason: change_id I109260842cfc25f06e40694997fcbb4afa02c867 with SHA1 3a78d9db46 is in history

Change-Id: If5de5ce42bdec77db69dc229a2f5c7367b28a560
2019-08-30 12:33:40 -07:00
Aurimas Liutikas
48d66161b9 [automerger skipped] Merge "Add missing nullability annotations." am: 9b361c2674 -s ours
am: b3c5131dcb -s ours
am skip reason: change_id I109260842cfc25f06e40694997fcbb4afa02c867 with SHA1 3a78d9db46 is in history

Change-Id: I729acc32ce9625df646bf0a820f9f4d95a9d60cf
2019-08-30 12:08:42 -07:00
Aurimas Liutikas
b3c5131dcb [automerger skipped] Merge "Add missing nullability annotations."
am: 9b361c2674 -s ours
am skip reason: change_id I109260842cfc25f06e40694997fcbb4afa02c867 with SHA1 3a78d9db46 is in history

Change-Id: I7b2712e4ab3635f94f8257d88f24c20bc68a3ac0
2019-08-30 11:49:09 -07:00
Aurimas Liutikas
aa02c3d5b8 Merge "Add missing nullability annotations." into stage-aosp-master am: 85c0a5a2be
am: 88be2b2667

Change-Id: I202951d51820be47b9195734601830553215bdd7
2019-08-30 08:43:01 -07:00
Aurimas Liutikas
88be2b2667 Merge "Add missing nullability annotations." into stage-aosp-master
am: 85c0a5a2be

Change-Id: Ic9ea2b9840fbb678bbb6ab77038415581feba918
2019-08-30 08:35:52 -07:00
Aurimas Liutikas
8bc65d215c Add missing nullability annotations.
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
2019-08-30 00:16:24 +00:00
Aurimas Liutikas
3a78d9db46 Add missing nullability annotations.
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
2019-08-30 00:14:44 +00:00
Xin Li
52a49fafb8 [automerger skipped] DO NOT MERGE - Merge qt-dev-plus-aosp-without-vendor (5713463) into stage-aosp-master am: 111584b14c -s ours
am: d7dec84e0c

Change-Id: Ib875870cdd045beff56e16ff2357df404ae76270
2019-08-15 17:29:17 -07:00
Xin Li
d7dec84e0c [automerger skipped] DO NOT MERGE - Merge qt-dev-plus-aosp-without-vendor (5713463) into stage-aosp-master
am: 111584b14c -s ours
am skip reason: subject contains skip directive

Change-Id: Ibb510ec02656e59b851599f88ae31c6e10377fca
2019-08-15 16:35:23 -07:00
Xin Li
111584b14c DO NOT MERGE - Merge qt-dev-plus-aosp-without-vendor (5713463) into stage-aosp-master
Bug: 134405016
Change-Id: I303c0268e8e454b0f0f460eb286812a50c9add88
2019-08-14 12:04:06 -07:00
Remi NGUYEN VAN
1563afc646 Merge "Extract test utilities for ConnectivityService" am: b7d270a73e am: b374d3953c
am: 0e84cb5bfa

Change-Id: Ib760ef922a440d54bab8c1647d8444ab2a717094
2019-08-06 15:57:04 -07:00
Remi NGUYEN VAN
0e84cb5bfa Merge "Extract test utilities for ConnectivityService" am: b7d270a73e
am: b374d3953c

Change-Id: Idfea637a9fd071c8fa62798bf8e3b9f241bc6348
2019-08-06 15:33:53 -07:00
Remi NGUYEN VAN
b374d3953c Merge "Extract test utilities for ConnectivityService"
am: b7d270a73e

Change-Id: I0ac2a480f961bb6fd1d83dedad6a7942ee03858f
2019-08-06 14:58:43 -07:00
Remi NGUYEN VAN
a18a355536 Extract test utilities for ConnectivityService
The utilities help using ConnectivityService in tests, and will be used
to write integration tests for ConnectivityService.

Test: atest FrameworksNetTests
Change-Id: Ie895ad05139cd5768d3d8a9bd5589d72571f47e6
2019-08-01 16:32:30 +09:00
Xiangyu/Malcolm Chen
e0f8c07335 Merge changes from topic "135105735" into qt-r1-dev
am: 896cdfa547

Change-Id: Ie661fdc8a29645fa1b319cf1db8a896a8d21deae
2019-07-12 10:43:52 -07:00
Malcolm Chen
5069dbeaab Use new API to get mergedSubscriberIds based on grouping.
In addition, make mMergedSubscriberIds a list to fit usage of multi-SIM
devices.

Bug: 135105735
Bug: 137137221
Test: manual
Change-Id: I364262559789112f35b88f4c298463bf4af2e82a
2019-07-11 13:19:54 -07:00
Xin Li
625b0e195b [automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.190705.004) into master am: a1e7984084 -s ours am: c565453be9 -s ours
am: 1f8ab532af

Change-Id: I96ecd52959d20c7ebbbf662889ea2babd6e21b1b
2019-07-10 22:50:22 -07:00
Xin Li
1f8ab532af [automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.190705.004) into master am: a1e7984084 -s ours
am: c565453be9 -s ours
am skip reason: subject contains skip directive

Change-Id: I789e380a0d5458c07533bf67f4771d7ae6dc82ea
2019-07-10 22:14:19 -07:00
Xin Li
c565453be9 [automerger skipped] DO NOT MERGE - Merge pie-platform-release (PPRL.190705.004) into master
am: a1e7984084 -s ours
am skip reason: subject contains skip directive

Change-Id: Ida5e78dda30bfc7e9a0a76a2f85cc97e789ced82
2019-07-10 21:20:46 -07:00
Xin Li
a1e7984084 DO NOT MERGE - Merge pie-platform-release (PPRL.190705.004) into master
Bug: 136196576
Change-Id: I481d824726ae0260b42cd7a4acc1c6fce593c324
2019-07-09 15:13:36 -07:00
android-build-team Robot
c7fd0e0131 Snap for 5622519 from b869620327dabaebe715a7d8fb3d12cdddd5a221 to pi-platform-release
Change-Id: I77f90a13ae9a3897eeffcc49b91ab9088f5d8001
2019-07-08 23:28:48 +00:00
Xin Li
d5201355aa [automerger skipped] Merge "DO NOT MERGE - Merge qt-dev-plus-aosp-without-vendor (5699924) into stage-aosp-master" into stage-aosp-master am: 3f1f8d1315 -s ours
am: 084a82cd1a

Change-Id: Ic8ef53936a2a91dc915a5e5d967ef72be50ad15c
2019-07-02 14:24:20 -07:00
Maciej Zenczykowski
a22218b772 [automerger skipped] Merge "Fix mobile data usage didn't get increased for xlat464 traffic" into qt-dev am: 2c74b2e5d8 -s ours
am: 84f11755d6 -s ours
am skip reason: change_id I8ebbefbe4df00e40f4896a17fa52c8438d41286e with SHA1 96fe3f5ff6 is in history

Change-Id: I9678ef008af3682687fe692cf98bb78e46f09748
2019-07-02 14:07:34 -07:00
Xin Li
084a82cd1a [automerger skipped] Merge "DO NOT MERGE - Merge qt-dev-plus-aosp-without-vendor (5699924) into stage-aosp-master" into stage-aosp-master
am: 3f1f8d1315 -s ours
am skip reason: subject contains skip directive

Change-Id: I1a32cee69d0edcb92d81a4bb8e6f98912d86a735
2019-07-02 12:40:14 -07:00
Maciej Zenczykowski
0741d47a2d [automerger skipped] Merge "Fix mobile data usage didn't get increased for xlat464 traffic" into qt-dev am: 2c74b2e5d8 -s ours
am: e6e7d93808 -s ours
am skip reason: change_id I8ebbefbe4df00e40f4896a17fa52c8438d41286e with SHA1 96fe3f5ff6 is in history

Change-Id: I78ea7922a88791b43eb0c8bc337443f128213c63
2019-07-02 12:34:36 -07:00
Maciej Zenczykowski
e6e7d93808 [automerger skipped] Merge "Fix mobile data usage didn't get increased for xlat464 traffic" into qt-dev
am: 2c74b2e5d8 -s ours
am skip reason: change_id I8ebbefbe4df00e40f4896a17fa52c8438d41286e with SHA1 96fe3f5ff6 is in history

Change-Id: Ia76c06513e23c4052262c8ac4c7212a548267a8c
2019-07-02 12:24:42 -07:00
Maciej Zenczykowski
84f11755d6 [automerger skipped] Merge "Fix mobile data usage didn't get increased for xlat464 traffic" into qt-dev
am: 2c74b2e5d8 -s ours
am skip reason: change_id I8ebbefbe4df00e40f4896a17fa52c8438d41286e with SHA1 e5e15aee20 is in history

Change-Id: If50b9304e64a5d4c18c78d933c121d428d660d61
2019-07-02 12:24:41 -07:00
junyulai
e7424f5646 [automerger skipped] Fix mobile data usage didn't get increased for xlat464 traffic
am: 96fe3f5ff6 -s ours
am skip reason: change_id I8ebbefbe4df00e40f4896a17fa52c8438d41286e with SHA1 e5e15aee20 is in history

Change-Id: I179221edf5fe58a1b4b747bd51f86a569ed051b4
2019-07-02 08:54:31 -07:00
junyulai
9bf1e821f5 Fix mobile data usage didn't get increased for xlat464 traffic
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)
2019-07-02 09:57:45 +00:00
TreeHugger Robot
3f1f8d1315 Merge "DO NOT MERGE - Merge qt-dev-plus-aosp-without-vendor (5699924) into stage-aosp-master" into stage-aosp-master 2019-07-02 07:41:13 +00:00
Maciej Żenczykowski
bb99759252 Merge "Fix mobile data usage didn't get increased for xlat464 traffic" am: e284b30c81 am: e74fb60c29
am: 854c2786ae

Change-Id: If8c252038d86ffb9d60de27d50994a2ebcca8408
2019-07-01 21:52:01 -07:00
junyulai
96fe3f5ff6 Fix mobile data usage didn't get increased for xlat464 traffic
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)
2019-07-02 04:34:33 +00:00
Maciej Żenczykowski
854c2786ae Merge "Fix mobile data usage didn't get increased for xlat464 traffic" am: e284b30c81
am: e74fb60c29

Change-Id: I670c09dd9aaf0e440a2e43b01cf1d94edbca28b7
2019-07-01 21:31:42 -07:00
junyulai
e5e15aee20 Fix mobile data usage didn't get increased for xlat464 traffic
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
2019-07-01 14:17:47 -07:00
Lorenzo Colitti
0f3466c1a4 Merge "Remove all static members from NetworkStatsFactory." am: 63f94f411b am: 5409264cee
am: 05f0587ca2

Change-Id: I7f787d14b7c7dee7a77dbed84266f8192c21c446
2019-06-27 19:56:01 -07:00
Lorenzo Colitti
05f0587ca2 Merge "Remove all static members from NetworkStatsFactory." am: 63f94f411b
am: 5409264cee

Change-Id: Iada14a1fea74197014e75a1112c7a5b35d6b1a1d
2019-06-27 19:40:01 -07:00
Lorenzo Colitti
468053d2ea Merge "Transfer ownership of NetworkStatsFactory to NetworkStatsService." am: bd94f0afd2 am: 92292f556b
am: f189d8ee94

Change-Id: Ibe2fcacb3779b3c6bc484fe6f398475bf5b6383b
2019-06-27 09:26:02 -07:00
Lorenzo Colitti
8e0cd114f6 Merge "Synchronize the NetworkStatsFactory constructor." am: f2bd2bbfd8 am: e6193f4086
am: 1bb38318b4

Change-Id: Ia0112e4307c055d7fe63f0c798588c94eba3df49
2019-06-27 09:24:23 -07:00
Lorenzo Colitti
bcaf1f959b Remove all static members from NetworkStatsFactory.
NetworkStatsFactory is owned by NetworkStatsService, and any
accesses to NSF data should go through NSS.

Test: atest FrameworksNetTests
Change-Id: Idbd0dbbaeb11313f63474e7ec0e01f974349fc89
2019-06-27 17:39:05 +09:00
Lorenzo Colitti
f189d8ee94 Merge "Transfer ownership of NetworkStatsFactory to NetworkStatsService." am: bd94f0afd2
am: 92292f556b

Change-Id: If897c9c95fc8571949183c45a99a5c28cb032ebb
2019-06-27 01:31:46 -07:00
Lorenzo Colitti
1bb38318b4 Merge "Synchronize the NetworkStatsFactory constructor." am: f2bd2bbfd8
am: e6193f4086

Change-Id: I521cd368a611bedaf9e6e5af4b8d71c040b502ac
2019-06-27 01:23:07 -07:00
Lorenzo Colitti
8b6fdeca3f Transfer ownership of NetworkStatsFactory to NetworkStatsService.
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
2019-06-26 19:29:51 +09:00
Lorenzo Colitti
ebfdc7c4e7 Synchronize the NetworkStatsFactory constructor.
This ensures the constructor takes the necessary lock before
accessing memmber variables.

Bug: 113122541
Test: atest FrameworksNetTests
Change-Id: Ibd324ed922c738b8d77d4eb74f45b75c6645bdc7
2019-06-25 18:58:42 +09:00
Lorenzo Colitti
f126a7e923 Merge "NetworkStats: Fix race condition causing system server crashes" am: 08b928e8ed am: f37da9a879
am: c993c0c45f

Change-Id: Ieb9f17b6e3eed82c450a5b90dd67a00e4ede8b3f
2019-06-25 02:21:15 -07:00
Lorenzo Colitti
c993c0c45f Merge "NetworkStats: Fix race condition causing system server crashes" am: 08b928e8ed
am: f37da9a879

Change-Id: I0ab308d5215ddb174ffb115e36948685d68da3ec
2019-06-25 01:53:11 -07:00
Hugo Benichi
0308b3971d NetworkStats: Fix race condition causing system server crashes
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
2019-06-25 10:51:51 +09:00
Lorenzo Colitti
85c6ebcce9 [automerger skipped] Merge changes If7d41052,I66f263d7,Id45ae956,Iba752fed,I575a7e4f, ... into qt-r1-dev
am: f80234a9b0 -s ours
am skip reason: change_id If2ef8d8f038f32c8cf974aa02cfc1dc7e44dbad3 with SHA1 d749767f44 is in history

Change-Id: I5b525feb1e7df2a89dea4f38b521973ccaac0746
2019-06-24 08:17:26 -07:00
Benedict Wong
0768aa7770 Inline readNetworkStatsDetailInternal, make mUseBpfStats final
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)
2019-06-21 01:12:41 +00:00
Benedict Wong
4d326f96cc Remove VPN info arrays from NetworkStats(Observer|Recorder)
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)
2019-06-21 01:12:34 +00:00
Benedict Wong
dedb6bb0e5 NetworkStatsFactory: Take VPNs into account for network/battery stats
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)
2019-06-21 01:12:27 +00:00