Commit Graph

2111 Commits

Author SHA1 Message Date
junyulai
ec1c5fe86c [SM04] Support fetching data with NetworkTemplate with subType
Add a NetworkTemplate build function that allows user to specify
subType. NetworkStats corresponding to the same group would
be retrieved.

Test: atest FrameworksNetTests
Bug: 129082217

Change-Id: Ie2d229be0b6bd239f799989c070475c73a096d71
2020-03-18 12:59:06 +08:00
junyulai
20f4805aad [SM02] Support record mobile network stats by collapsed rat type
Previously network stats could be recorded by different rat type.
However, the feature was disabled by ag/173504 since rat type
frequently flapping between HSPA+ and UMTS.

Given that this feature might be useful for collecting metrics,
re-implement it based on current architecture and reduce the
overhead introduced by frequently flapping by:
  1. only react when rat type changes between 2G/3G/4G/5G.
  2. reduce the number of records by only recording a subset
     of rat type that represented for a given network class.
  3. enforce 1 second rate limit if flapping too much.

Note that the feature is still disabled but will be enabled
in follow-up patches.

Test: manual test
Bug: 129082217
Change-Id: Ic6b2f10f2c8b082820e0662eb9cee70d70d28cd6
2020-03-18 12:59:06 +08:00
junyulai
30a20a0ba4 [SP25] Rename functions that add Entry conditionally am: 544bc807a4 am: c87482ed57
Change-Id: I22d32f9cbc9c2694160ad5cd30d7b637529b8e44
2020-03-17 23:56:28 +00:00
junyulai
23c0b21515 [automerger skipped] [SP24] Rename functions that add Entry unconditionally am: 02a6340ca0 -s ours am: effcd8d405 -s ours
am skip reason: Change-Id I801ddc49e283a254b9586700c9b597c0adb0d459 with SHA-1 e7c6c25653 is in history

Change-Id: Ib807d1cf6bf4c2a9be054bf5df7377f540201c63
2020-03-17 23:56:26 +00:00
junyulai
82090cd372 [automerger skipped] [SP23] Address misc API review comment about NetworkStats am: ca952de92d -s ours am: 959458b6dd -s ours
am skip reason: Change-Id Id1b8f41be79f847ad73197ff0e18258b6ee8a730 with SHA-1 c7e8100faa is in history

Change-Id: Ie5456b60b60dbd10b6245a971a1f908184549782
2020-03-17 23:56:23 +00:00
junyulai
cd03bb6f3e [automerger skipped] [SP21] Address comments for API council review about aosp/1172143 am: 27d58bfd96 -s ours am: af1d560d1f -s ours
am skip reason: Change-Id I141393f229e772d2eb9f7c156849e379bd71b845 with SHA-1 9a4eeaea2f is in history

Change-Id: I47afb9f93dc191b4e04e4d5bd5ff4a1cfd566b02
2020-03-17 23:56:20 +00:00
Automerger Merge Worker
10ab4d780c [automerger skipped] [SP20] Check signature permission when accessing network stats provider am: f62907d9ca -s ours am: 6a2a493c55 -s ours
am skip reason: Change-Id Idfebd0a1988c3dcfd812d87e30f6a2034d6fbf6b with SHA-1 f2b6d74356 is in history

Change-Id: If3e435581158764085240c431845c7873bac9258
2020-03-17 23:56:18 +00:00
junyulai
c87482ed57 [SP25] Rename functions that add Entry conditionally am: 544bc807a4
Change-Id: I5f9924cf5b3eccfcdaa6dda991a102b97cebd11a
2020-03-17 23:35:57 +00:00
junyulai
effcd8d405 [automerger skipped] [SP24] Rename functions that add Entry unconditionally am: 02a6340ca0 -s ours
am skip reason: Change-Id I801ddc49e283a254b9586700c9b597c0adb0d459 with SHA-1 e7c6c25653 is in history

Change-Id: I480e66ff5b65a1ba24ecffb288ba429c2f94219e
2020-03-17 23:35:52 +00:00
junyulai
959458b6dd [automerger skipped] [SP23] Address misc API review comment about NetworkStats am: ca952de92d -s ours
am skip reason: Change-Id Id1b8f41be79f847ad73197ff0e18258b6ee8a730 with SHA-1 c7e8100faa is in history

Change-Id: Ia71c3307443fc1d994fd07dcf20d5ca32d145765
2020-03-17 23:35:50 +00:00
junyulai
af1d560d1f [automerger skipped] [SP21] Address comments for API council review about aosp/1172143 am: 27d58bfd96 -s ours
am skip reason: Change-Id I141393f229e772d2eb9f7c156849e379bd71b845 with SHA-1 9a4eeaea2f is in history

Change-Id: I80ab45b6a34b66f1bed766b3e2fb72926325021e
2020-03-17 23:35:48 +00:00
Automerger Merge Worker
6a2a493c55 [automerger skipped] [SP20] Check signature permission when accessing network stats provider am: f62907d9ca -s ours
am skip reason: Change-Id Idfebd0a1988c3dcfd812d87e30f6a2034d6fbf6b with SHA-1 f2b6d74356 is in history

Change-Id: I41bb8c1d96e494f4e54ab59138f1257cc23f05c7
2020-03-17 23:35:44 +00:00
junyulai
544bc807a4 [SP25] Rename functions that add Entry conditionally
Currently, in NetworkStats, there are many methods to manipulate
the records. However, some methods are similar and ambiguous,
such as addEntry, addValues, setValues, addIfaceValues,
combineValues and combineAllValues.

Thus, properly grouping and renaming methods are necessary.
In this change, for methods that add one record conditionally,
name them addEntry.
  addValues -> addEntry

Test: atest FrameworksNetTests ImsPhoneCallTrackerTest TetheringTests
Fix: 148895143
Change-Id: I9495a198cf247e6c79100f7ac1edcea370b071de
2020-03-17 14:59:59 +00:00
junyulai
02a6340ca0 [SP24] Rename functions that add Entry unconditionally
Currently, in NetworkStats, there are many methods to manipulate
the records. However, some methods are similar and ambiguous,
such as addEntry, addValues, setValues, addIfaceValues,
combineValues and combineAllValues.

Thus, properly grouping and renaming methods are necessary.
In this change, for methods that add one record unconditionally,
name them insertEntry.
  setIfaceValues -> insertEntry
  addEntry -> insertEntry

Test: atest FrameworksNetTests ImsPhoneCallTrackerTest TetheringTests
Test: m doc-comment-check-docs
Bug: 148895143
Change-Id: I801ddc49e283a254b9586700c9b597c0adb0d459
Merged-In: I801ddc49e283a254b9586700c9b597c0adb0d459
(cherry picked from aosp/1256352)
2020-03-17 14:59:31 +00:00
junyulai
ca952de92d [SP23] Address misc API review comment about NetworkStats
This change add several javadoc for NetworkStats and its Entry
class. Also remove IFACE_ALL constant accordlingly.

Test: atest FrameworkNetTests
Test: m doc-comment-check-docs
Bug: 148895143

Change-Id: Id1b8f41be79f847ad73197ff0e18258b6ee8a730
Merged-In: Id1b8f41be79f847ad73197ff0e18258b6ee8a730
(cherry picked from aosp/1256351)
2020-03-17 14:58:59 +00:00
junyulai
27d58bfd96 [SP21] Address comments for API council review about aosp/1172143
Test: atest FrameworksNetTests ImsPhoneCallTrackerTest
Test: atest TetheringTests NetworkStackTests
Test: m doc-comment-check-docs
Fix: 148552904

Change-Id: I141393f229e772d2eb9f7c156849e379bd71b845
Merged-In: I141393f229e772d2eb9f7c156849e379bd71b845
(cherry picked from aosp/1253717)
2020-03-17 14:57:59 +00:00
Automerger Merge Worker
f62907d9ca [SP20] Check signature permission when accessing network stats provider
Currently, registerNetworkStatsProvider requires the
UPDATE_DEVICE_STATS permission. This is a privileged permission
so it can be granted to preinstalled apps. Thus, apps like
GmsCore, or preinstalled apps will be able to update network stats.

This change checks for a new permission that would only allow
signature apps to declare that. Also check
MAINLINE_NETWORK_STACK permission to allow NetworkStack process
to use it.

Test: adb shell dumpsys netstats
Test: atest FrameworksNetTests
Bug: 149652079

Change-Id: Iaecbf10a7610461bd52e315659006c7332c416e6
Merged-In: Iaecbf10a7610461bd52e315659006c7332c416e6
Merged-In: Idfebd0a1988c3dcfd812d87e30f6a2034d6fbf6b
(cherry picked from commit e9e8d8f9ff096c1723eba1d74b17bb7cade7f23b)
2020-03-17 14:53:33 +00:00
Automerger Merge Worker
b72911fca9 [automerger skipped] Merge "Fix typo in aosp/1242602" into rvc-dev am: 984a51c6ee -s ours am: 79606cc385 -s ours
am skip reason: Change-Id Ie023c8371785fc239c54eacbf056141c2e9e3444 with SHA-1 050c7de093 is in history

Change-Id: I574c5bfe597d008a8775978b37fa0f5d1d9dd67d
2020-03-17 14:37:22 +00:00
Automerger Merge Worker
82536c7bb8 [automerger skipped] Merge "Fix typo in aosp/1242602" into rvc-dev am: 984a51c6ee am: eb956a302d -s ours
am skip reason: Change-Id Ie023c8371785fc239c54eacbf056141c2e9e3444 with SHA-1 9d4e21f0be is in history

Change-Id: Ic360dcd155ac43a7131db8a8bcfbfb1d0cbfae5e
2020-03-17 14:37:15 +00:00
Automerger Merge Worker
79606cc385 [automerger skipped] Merge "Fix typo in aosp/1242602" into rvc-dev am: 984a51c6ee -s ours
am skip reason: Change-Id Ie023c8371785fc239c54eacbf056141c2e9e3444 with SHA-1 9d4e21f0be is in history

Change-Id: Ie4565f23be593f4ed5f398ffd320eb8897fd9736
2020-03-17 14:26:58 +00:00
Automerger Merge Worker
7d48064cb3 [automerger skipped] Merge "Add permission check functions to NetworkStatsService" into rvc-dev am: 70731d4348 -s ours am: c884826573 -s ours
am skip reason: Change-Id If70e6e831c0386b604d0151cc0650f68457b6e5f with SHA-1 e953a50e6b is in history

Change-Id: I9523f72516f9160c6c5ec5d07c253c6a4cb1d636
2020-03-17 12:36:36 +00:00
Automerger Merge Worker
c5ebda6cda [automerger skipped] Merge "Add permission check functions to NetworkStatsService" into rvc-dev am: 70731d4348 am: 596960c155 -s ours
am skip reason: Change-Id I837545b54f36c8f21c878cbb1fd028ff23be6cb8 with SHA-1 df2aef7c1d is in history

Change-Id: I5d183da2daa98f4f06ff7e4c046b10ccc7df6070
2020-03-17 12:31:17 +00:00
Automerger Merge Worker
c884826573 [automerger skipped] Merge "Add permission check functions to NetworkStatsService" into rvc-dev am: 70731d4348 -s ours
am skip reason: Change-Id I837545b54f36c8f21c878cbb1fd028ff23be6cb8 with SHA-1 df2aef7c1d is in history

Change-Id: Ie92995d3a60e009aff0913f1e9c039972837fff5
2020-03-17 12:14:30 +00:00
junyulai
050c7de093 Fix typo in aosp/1242602
Test: m -j
Bug: 149652079
Change-Id: Ie023c8371785fc239c54eacbf056141c2e9e3444
Merged-In: Ie023c8371785fc239c54eacbf056141c2e9e3444
(cherry picked from aosp/1259461)
2020-03-17 12:08:59 +00:00
Automerger Merge Worker
e953a50e6b Add permission check functions to NetworkStatsService
This is shameless copied from ConnectivityService and plan to be
used in follow-up change. For long term perspective we should
have a permission util that contains those util in one place.

Test: m -j
Change-Id: If70e6e831c0386b604d0151cc0650f68457b6e5f
Merged-In: If70e6e831c0386b604d0151cc0650f68457b6e5f
Merged-In: I837545b54f36c8f21c878cbb1fd028ff23be6cb8
Bug: 149652079
(cherry picked from commit 4da7af7e7e4a0d3360cd41e98e4d6fa731d21515)
2020-03-17 09:33:11 +00:00
Automerger Merge Worker
20d432d5e2 Merge changes I801ddc49,Id1b8f41b am: 2395cf16b9 am: 14b1bb2401 am: 940f7154cd
Change-Id: Ie5583f070e850f167a0f8fee1c082a998c0ce572
2020-03-16 12:07:38 +00:00
Automerger Merge Worker
940f7154cd Merge changes I801ddc49,Id1b8f41b am: 2395cf16b9 am: 14b1bb2401
Change-Id: Ib25ca9a843f19fb3791afbe23c065a0a7bb3b11f
2020-03-16 11:56:41 +00:00
Automerger Merge Worker
14b1bb2401 Merge changes I801ddc49,Id1b8f41b am: 2395cf16b9
Change-Id: I604bcfab22d7b26b84bf126d02d9be612fcb6d29
2020-03-16 11:41:19 +00:00
Treehugger Robot
2395cf16b9 Merge changes I801ddc49,Id1b8f41b
* changes:
  [SP24] Rename functions that add Entry unconditionally
  [SP23] Address misc API review comment about NetworkStats
2020-03-16 11:38:00 +00:00
Automerger Merge Worker
d41955f113 Merge "Fix typo in aosp/1242602" am: 1ae5516429 am: 934bb9fa9c am: 7730f7fe95
Change-Id: I7c1cbdb05cf0d8a8866b06ac5e25ffd6e06f06cd
2020-03-16 09:04:25 +00:00
Automerger Merge Worker
7730f7fe95 Merge "Fix typo in aosp/1242602" am: 1ae5516429 am: 934bb9fa9c
Change-Id: I3f1078dd2ea942860e43d5421fa44e438c9de21d
2020-03-16 08:52:50 +00:00
Automerger Merge Worker
934bb9fa9c Merge "Fix typo in aosp/1242602" am: 1ae5516429
Change-Id: Ie617874be311e84e04d889f6c2069c77c25150b7
2020-03-16 08:36:03 +00:00
junyulai
9d4e21f0be Fix typo in aosp/1242602
Test: m -j
Bug: 149652079
Change-Id: Ie023c8371785fc239c54eacbf056141c2e9e3444
2020-03-16 15:00:24 +08:00
junyulai
e7c6c25653 [SP24] Rename functions that add Entry unconditionally
Currently, in NetworkStats, there are many methods to manipulate
the records. However, some methods are similar and ambiguous,
such as addEntry, addValues, setValues, addIfaceValues,
combineValues and combineAllValues.

Thus, properly grouping and renaming methods are necessary.
In this change, for methods that add one record unconditionally,
name them insertEntry.
  setIfaceValues -> insertEntry
  addEntry -> insertEntry

Test: atest FrameworksNetTests ImsPhoneCallTrackerTest TetheringTests
Test: m doc-comment-check-docs
Bug: 148895143
Change-Id: I801ddc49e283a254b9586700c9b597c0adb0d459
2020-03-16 14:27:45 +08:00
junyulai
c7e8100faa [SP23] Address misc API review comment about NetworkStats
This change add several javadoc for NetworkStats and its Entry
class. Also remove IFACE_ALL constant accordlingly.

Test: atest FrameworkNetTests
Test: m doc-comment-check-docs
Bug: 148895143
Change-Id: Id1b8f41be79f847ad73197ff0e18258b6ee8a730
2020-03-16 14:27:45 +08:00
Automerger Merge Worker
a8d3800dce [SP21] Address comments for API council review about aosp/1172143 am: 9a4eeaea2f am: 759155a3a3 am: 759f420024
Change-Id: I9c44371665dc09612357a5ef880364bc32824784
2020-03-16 03:39:03 +00:00
Automerger Merge Worker
759f420024 [SP21] Address comments for API council review about aosp/1172143 am: 9a4eeaea2f am: 759155a3a3
Change-Id: I86cf3b57722f64c0989ce606fde71d6173f812bb
2020-03-16 03:14:01 +00:00
Automerger Merge Worker
759155a3a3 [SP21] Address comments for API council review about aosp/1172143 am: 9a4eeaea2f
Change-Id: I8634d6f6ed65ec6b10009a90b147881fe1fc4530
2020-03-16 03:03:51 +00:00
junyulai
9a4eeaea2f [SP21] Address comments for API council review about aosp/1172143
Test: atest FrameworksNetTests ImsPhoneCallTrackerTest
Test: atest TetheringTests NetworkStackTests
Test: m doc-comment-check-docs
Fix: 148552904

Change-Id: I141393f229e772d2eb9f7c156849e379bd71b845
2020-03-12 21:34:17 +08:00
Automerger Merge Worker
052c020ebe Merge changes from topic "sp20-stats-provider-permission" am: 51bbefacf2 am: bf292288b6 am: 386e5150d4
Change-Id: I871191f97745bc5535f906cda4726ab57292aeac
2020-03-12 09:06:05 +00:00
Automerger Merge Worker
a1f0f0ccf3 Add permission check functions to NetworkStatsService am: df2aef7c1d am: ba550c1836 am: 3fd000536c
Change-Id: Iccd3c7a6dc15370460ece475e0655ef993f4577c
2020-03-12 09:06:03 +00:00
Automerger Merge Worker
386e5150d4 Merge changes from topic "sp20-stats-provider-permission" am: 51bbefacf2 am: bf292288b6
Change-Id: Ifb7237d5cfaeed416ad1efb4f0c295fe846ab3b0
2020-03-12 09:00:33 +00:00
Automerger Merge Worker
3fd000536c Add permission check functions to NetworkStatsService am: df2aef7c1d am: ba550c1836
Change-Id: I6aa0be382bb273cc8cdf2308f737ad047463b870
2020-03-12 09:00:23 +00:00
Automerger Merge Worker
bf292288b6 Merge changes from topic "sp20-stats-provider-permission" am: 51bbefacf2
Change-Id: I6111589d27501684b4c43711448a1fa08221a3f5
2020-03-12 08:39:54 +00:00
Automerger Merge Worker
ba550c1836 Add permission check functions to NetworkStatsService am: df2aef7c1d
Change-Id: Id2df1c6d5a5dc77f59f68772f5b46659fb956bc2
2020-03-12 08:39:48 +00:00
Junyu Lai
51bbefacf2 Merge changes from topic "sp20-stats-provider-permission"
* changes:
  [SP20] Check signature permission when accessing network stats provider
  Add permission check functions to NetworkStatsService
2020-03-12 08:19:24 +00:00
Automerger Merge Worker
0c7f62f729 [automerger skipped] Merge "Merge NetworkStatsService handler changes." into rvc-dev am: 48aff64f9b -s ours am: ccabfd0af6 -s ours
am skip reason: Change-Id If256ed4437ddcbcc72a6f766cff2f4cc512ee3f7 with SHA-1 1ff5f65f5b is in history

Change-Id: I9d5b81e4cd85c56db1143c508fe4da314d29d178
2020-03-11 06:55:14 +00:00
Automerger Merge Worker
82a2aa2a0d [automerger skipped] Merge "Merge NetworkStatsService handler changes." into rvc-dev am: 48aff64f9b am: c0864b8ce4 -s ours
am skip reason: Change-Id If256ed4437ddcbcc72a6f766cff2f4cc512ee3f7 with SHA-1 1ff5f65f5b is in history

Change-Id: Ie664fbef5d0e7b6754c400ff73c5a78485ee4a63
2020-03-11 06:55:07 +00:00
Automerger Merge Worker
ccabfd0af6 [automerger skipped] Merge "Merge NetworkStatsService handler changes." into rvc-dev am: 48aff64f9b -s ours
am skip reason: Change-Id If256ed4437ddcbcc72a6f766cff2f4cc512ee3f7 with SHA-1 1ff5f65f5b is in history

Change-Id: Ie58da93cd3a7876d8dc56bbcff90bcfd0a38c9d3
2020-03-11 06:36:38 +00:00
Lorenzo Colitti
48aff64f9b Merge "Merge NetworkStatsService handler changes." into rvc-dev 2020-03-11 06:19:18 +00:00