Commit Graph

2138 Commits

Author SHA1 Message Date
junyulai
75b9985b7b [automerger skipped] [SM05] Enable record mobile network stats by collapsed rat type am: 0a59b1e599 am: ab08ed986a -s ours am: a534cbb409 -s ours
am skip reason: Change-Id If330e85330a4ff713dd420c98d42fa741eabd90a with SHA-1 dddf7d0a9a is in history

Change-Id: Iaa2fc4829906ed688c8ce98c1d7b6cae092abe74
2020-03-19 10:01:29 +00:00
junyulai
1b7096ae27 [automerger skipped] [SM04] Support fetching data with NetworkTemplate with subType am: 97ea6b222d am: 2f3c57ee95 -s ours am: 4eb7ef04cb -s ours
am skip reason: Change-Id Ie2d229be0b6bd239f799989c070475c73a096d71 with SHA-1 00d94e3335 is in history

Change-Id: I5a872bb77589bee31d219be1161e78cf7cef1858
2020-03-19 10:01:26 +00:00
junyulai
b56c78c25d [automerger skipped] [SM02] Support record mobile network stats by collapsed rat type am: 383c8e8556 am: 3968b6ddb8 -s ours am: e4a78f7f73 -s ours
am skip reason: Change-Id Ic6b2f10f2c8b082820e0662eb9cee70d70d28cd6 with SHA-1 825f0828ac is in history

Change-Id: I5eb9f9c3513eebd2a26bca53a943d0e25b0c3557
2020-03-19 10:01:23 +00:00
junyulai
a534cbb409 [automerger skipped] [SM05] Enable record mobile network stats by collapsed rat type am: 0a59b1e599 am: ab08ed986a -s ours
am skip reason: Change-Id If330e85330a4ff713dd420c98d42fa741eabd90a with SHA-1 dddf7d0a9a is in history

Change-Id: I5f7e58d16e30eae69c45a505ea2ee9e4a9802d91
2020-03-19 09:39:55 +00:00
junyulai
4eb7ef04cb [automerger skipped] [SM04] Support fetching data with NetworkTemplate with subType am: 97ea6b222d am: 2f3c57ee95 -s ours
am skip reason: Change-Id Ie2d229be0b6bd239f799989c070475c73a096d71 with SHA-1 00d94e3335 is in history

Change-Id: Ibdeeda75e0bd4f641b349b145b0c849bf2cb94c1
2020-03-19 09:39:51 +00:00
junyulai
e4a78f7f73 [automerger skipped] [SM02] Support record mobile network stats by collapsed rat type am: 383c8e8556 am: 3968b6ddb8 -s ours
am skip reason: Change-Id Ic6b2f10f2c8b082820e0662eb9cee70d70d28cd6 with SHA-1 825f0828ac is in history

Change-Id: Idf27a0112486d2e0c5b3be419c01228820d8835e
2020-03-19 09:39:49 +00:00
junyulai
ab08ed986a [SM05] Enable record mobile network stats by collapsed rat type am: 0a59b1e599
Change-Id: If4bcfaefd2244be67449066ef54a6bdc0c00eb86
2020-03-19 09:31:00 +00:00
junyulai
2f3c57ee95 [SM04] Support fetching data with NetworkTemplate with subType am: 97ea6b222d
Change-Id: I3927277c41ba4b0cb5dc3a0309a5d4ca8f4d1dbc
2020-03-19 09:30:56 +00:00
junyulai
3968b6ddb8 [SM02] Support record mobile network stats by collapsed rat type am: 383c8e8556
Change-Id: Ia7dd0ae44fe951c00e365b94ac3b8a93230c96ab
2020-03-19 09:30:51 +00:00
junyulai
8270ea0a34 [SM07] Make combine subtype configurable from Settings am: 1e30781571 am: 28255c9992
Change-Id: I138ae4305d68b78323c2af9bfc081f42e661cdd9
2020-03-19 06:53:43 +00:00
junyulai
0488bfb9c0 [SM05] Enable record mobile network stats by collapsed rat type am: dddf7d0a9a am: f09a3e232f
Change-Id: I4e700b60a23665e7e50261b6392392c67ea9c49d
2020-03-19 06:53:40 +00:00
junyulai
180663d4d4 [SM04] Support fetching data with NetworkTemplate with subType am: 00d94e3335 am: 5341a72f55
Change-Id: I2f0f04c34faf58bc15572bc41f80b9c411db0242
2020-03-19 06:53:37 +00:00
junyulai
e00a0fdcbc [SM02] Support record mobile network stats by collapsed rat type am: 825f0828ac am: ad8e8bddfe
Change-Id: I10acd170e902344b1b9063fe2a4da60c5d037e5d
2020-03-19 06:53:35 +00:00
junyulai
28255c9992 [SM07] Make combine subtype configurable from Settings am: 1e30781571
Change-Id: Ic8426ae36b5aaadfdd3292a3b70fc9b290443d5c
2020-03-19 06:37:59 +00:00
junyulai
f09a3e232f [SM05] Enable record mobile network stats by collapsed rat type am: dddf7d0a9a
Change-Id: I492dd32dc6b6af061da02a450c8c6abff0e8bf5e
2020-03-19 06:37:56 +00:00
junyulai
5341a72f55 [SM04] Support fetching data with NetworkTemplate with subType am: 00d94e3335
Change-Id: Ie22a2255f1d32b6c0b21a4c33bd6778255e4cbb5
2020-03-19 06:37:51 +00:00
junyulai
ad8e8bddfe [SM02] Support record mobile network stats by collapsed rat type am: 825f0828ac
Change-Id: Ie512faaa0799b3f352c3d646e30bd92e525d9d2c
2020-03-19 06:37:48 +00:00
junyulai
0a59b1e599 [SM05] Enable record mobile network stats by collapsed rat type
Switch on the recording in device side. Metrics will be
collected in follow-up patches which can be independently
enabled/disabled.

This change also fix the fail in NetworkStatsCollectionTest
which caused by enabling this feature, where the rounding
problem happened when records are distributed into smaller
buckets and categorized into more NetworkIdentity.

Test: atest FrameworksNetTests
Bug: 129082217
Change-Id: If330e85330a4ff713dd420c98d42fa741eabd90a
Merged-In: If330e85330a4ff713dd420c98d42fa741eabd90a
(cherry picked from commit ff1d70e364)
2020-03-19 10:10:07 +08:00
junyulai
97ea6b222d [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
Merged-In: Ie2d229be0b6bd239f799989c070475c73a096d71
(cherry picked from commit ec1c5fe86c)
2020-03-19 10:10:07 +08:00
junyulai
383c8e8556 [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
Merged-In: Ic6b2f10f2c8b082820e0662eb9cee70d70d28cd6
(cherry picked from commit 20f4805aad)
2020-03-19 10:10:07 +08:00
junyulai
1e30781571 [SM07] Make combine subtype configurable from Settings
Note that enabling/disabling would not take effect until device
reboot. This will be addressed in follow-up patch.

Test: 1. atest NetworkStatsServieTest SettingsBackupTest
      2. adb shell settings put global netstats_combine_subtype_enabled 1|0
Bug: 146415925

Change-Id: Ic94da540afa479ed18f1b6fbda4ae3216c37476b
Merged-In: Ic94da540afa479ed18f1b6fbda4ae3216c37476b
(cherry picked from commit c4f77ac90bf2e48a655ad19b162fe74a23bf3fb0)
2020-03-19 01:40:55 +00:00
junyulai
dddf7d0a9a [SM05] Enable record mobile network stats by collapsed rat type
Switch on the recording in device side. Metrics will be
collected in follow-up patches which can be independently
enabled/disabled.

This change also fix the fail in NetworkStatsCollectionTest
which caused by enabling this feature, where the rounding
problem happened when records are distributed into smaller
buckets and categorized into more NetworkIdentity.

Test: atest FrameworksNetTests
Bug: 129082217
Change-Id: If330e85330a4ff713dd420c98d42fa741eabd90a
Merged-In: If330e85330a4ff713dd420c98d42fa741eabd90a
(cherry picked from commit 2d4fa2c0fae8c2d79a25093d9f732a33c2f91dd4)
2020-03-18 08:08:01 +00:00
junyulai
00d94e3335 [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
Merged-In: Ie2d229be0b6bd239f799989c070475c73a096d71
(cherry picked from commit e19045cc4ab1f2cd133ce5dc0c3a38e3275417ad)
2020-03-18 08:07:12 +00:00
junyulai
825f0828ac [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
Merged-In: Ic6b2f10f2c8b082820e0662eb9cee70d70d28cd6
(cherry picked from commit 15ab452e7e3f00289fbedbdb86c512ad560dda7e)
2020-03-18 07:59:44 +00:00
Junyu Lai
65fdfae54a [automerger skipped] Merge "[SP25] Rename functions that add Entry conditionally" am: 338e4c0608 am: f17247045d -s ours am: 1e2d51797a -s ours
am skip reason: Change-Id I9495a198cf247e6c79100f7ac1edcea370b071de with SHA-1 544bc807a4 is in history

Change-Id: I214ca8cb07535dbe33be18aa9a49d31811451ff5
2020-03-18 04:16:40 +00:00
Junyu Lai
1e2d51797a [automerger skipped] Merge "[SP25] Rename functions that add Entry conditionally" am: 338e4c0608 am: f17247045d -s ours
am skip reason: Change-Id I9495a198cf247e6c79100f7ac1edcea370b071de with SHA-1 544bc807a4 is in history

Change-Id: I19399123661123386472ff3f39d268d85917cbe1
2020-03-18 04:02:05 +00:00
Junyu Lai
f17247045d Merge "[SP25] Rename functions that add Entry conditionally" am: 338e4c0608
Change-Id: I7e0698f0e60d4c26864ceb728b74a265351a8506
2020-03-18 03:45:41 +00:00
Junyu Lai
338e4c0608 Merge "[SP25] Rename functions that add Entry conditionally" 2020-03-18 03:16:41 +00:00
junyulai
a79dab9229 [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
Merged-In: I9495a198cf247e6c79100f7ac1edcea370b071de
(cherry picked from ag/10700816)
2020-03-18 00:29:15 +00: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