[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)
This commit is contained in:
junyulai
2019-12-31 13:40:15 +08:00
committed by Junyu Lai
parent 00d94e3335
commit dddf7d0a9a
2 changed files with 3 additions and 3 deletions

View File

@@ -45,7 +45,7 @@ public class NetworkIdentity implements Comparable<NetworkIdentity> {
* {@link #SUBTYPE_COMBINED}.
*/
// TODO: make this flag configurable through settings. See http://b/146415925
public static final boolean COMBINE_SUBTYPE_ENABLED = true;
public static final boolean COMBINE_SUBTYPE_ENABLED = false;
public static final int SUBTYPE_COMBINED = -1;

View File

@@ -1209,7 +1209,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
final int collapsedRatType = getCollapsedRatType(networkType);
if (collapsedRatType == mLastCollapsedRatType) return;
if (LOGV) {
if (LOGD) {
Log.d(TAG, "subtype changed for mobile: "
+ mLastCollapsedRatType + " -> " + collapsedRatType);
}
@@ -1217,7 +1217,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
mHandler.removeMessages(MSG_UPDATE_IFACES);
mLastCollapsedRatType = collapsedRatType;
mHandler.sendMessageDelayed(
mHandler.obtainMessage(MSG_UPDATE_IFACES), SECOND_IN_MILLIS);
mHandler.obtainMessage(MSG_UPDATE_IFACES), mSettings.getPollDelay());
}
}