diff options
author | xshu <xshu@google.com> | 2020-02-13 16:33:35 -0800 |
---|---|---|
committer | xshu <xshu@google.com> | 2020-03-03 15:00:54 -0800 |
commit | 379ec441d42cb6ea1f57f6b1ea656bf52e460f32 (patch) | |
tree | 2e9ece3624def9c05cb1b738881d339a4c99b739 /service | |
parent | 464ed4cf4a481e2e18bdd1809ffa8e55322d0362 (diff) |
BssidBlocklistStats - high movement metrics
Cherry picked from 5b16559b3f7ba8b49a026447c7abe90025ba8227
Bug: 149229812
Test: com.android.server.wifi
Change-Id: Ibf051ae5ee19f6ca66e2896a8f9e64c43a2a47e4
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiConnectivityManager.java | 3 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/WifiMetrics.java | 26 | ||||
-rw-r--r-- | service/proto/src/metrics.proto | 12 |
3 files changed, 41 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiConnectivityManager.java b/service/java/com/android/server/wifi/WifiConnectivityManager.java index 86cf26698..e04897f92 100644 --- a/service/java/com/android/server/wifi/WifiConnectivityManager.java +++ b/service/java/com/android/server/wifi/WifiConnectivityManager.java @@ -345,6 +345,7 @@ public class WifiConnectivityManager { // cached candidates are too recent, wait for next scan if (mClock.getElapsedSinceBootMillis() - mCachedWifiCandidates.timeSinceBootMs < minimumTimeBetweenScansMs) { + mWifiMetrics.incrementNumHighMovementConnectionSkipped(); return null; } @@ -362,6 +363,7 @@ public class WifiConnectivityManager { new CachedWifiCandidates(mClock.getElapsedSinceBootMillis(), candidates); } + mWifiMetrics.incrementNumHighMovementConnectionStarted(); return filteredCandidates; } } @@ -375,6 +377,7 @@ public class WifiConnectivityManager { + "Re-doing scan to confirm network quality."); scheduleDelayedPartialScan(minimumTimeBetweenScansMs); } + mWifiMetrics.incrementNumHighMovementConnectionSkipped(); return null; } diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java index aebd1da52..e4a99377e 100644 --- a/service/java/com/android/server/wifi/WifiMetrics.java +++ b/service/java/com/android/server/wifi/WifiMetrics.java @@ -516,10 +516,16 @@ public class WifiMetrics { class BssidBlocklistStats { public IntCounter networkSelectionFilteredBssidCount = new IntCounter(); + public int numHighMovementConnectionSkipped = 0; + public int numHighMovementConnectionStarted = 0; public WifiMetricsProto.BssidBlocklistStats toProto() { WifiMetricsProto.BssidBlocklistStats proto = new WifiMetricsProto.BssidBlocklistStats(); proto.networkSelectionFilteredBssidCount = networkSelectionFilteredBssidCount.toProto(); + proto.highMovementMultipleScansFeatureEnabled = mContext.getResources().getBoolean( + R.bool.config_wifiHighMovementNetworkSelectionOptimizationEnabled); + proto.numHighMovementConnectionSkipped = numHighMovementConnectionSkipped; + proto.numHighMovementConnectionStarted = numHighMovementConnectionStarted; return proto; } @@ -527,6 +533,11 @@ public class WifiMetrics { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("networkSelectionFilteredBssidCount=" + networkSelectionFilteredBssidCount); + sb.append(", highMovementMultipleScansFeatureEnabled=" + + mContext.getResources().getBoolean( + R.bool.config_wifiHighMovementNetworkSelectionOptimizationEnabled)); + sb.append(", numHighMovementConnectionSkipped=" + numHighMovementConnectionSkipped); + sb.append(", numHighMovementConnectionStarted=" + numHighMovementConnectionStarted); return sb.toString(); } } @@ -5265,6 +5276,21 @@ public class WifiMetrics { } /** + * Increment the number of network connections skipped due to the high movement feature. + */ + public void incrementNumHighMovementConnectionSkipped() { + mBssidBlocklistStats.numHighMovementConnectionSkipped++; + } + + /** + * Increment the number of network connections initiated while under the high movement + * feature. + */ + public void incrementNumHighMovementConnectionStarted() { + mBssidBlocklistStats.numHighMovementConnectionStarted++; + } + + /** * Increment number of passpoint provision success */ public void incrementPasspointProvisionSuccess() { diff --git a/service/proto/src/metrics.proto b/service/proto/src/metrics.proto index 5bad0a048..145a3b2bc 100644 --- a/service/proto/src/metrics.proto +++ b/service/proto/src/metrics.proto @@ -1956,6 +1956,18 @@ message ExperimentValues { message BssidBlocklistStats { // Distributions of number of blocked BSSIDs filtered out from network selection. repeated Int32Count network_selection_filtered_bssid_count = 1; + + // If this is enabled, then network connections in high movement state will be skipped unless + // we find a candidate BSSID with similar RSSI in 2 scans sufficiently far apart. + optional bool high_movement_multiple_scans_feature_enabled = 2; + + // Number of times connection is skipped in the high movement state + // only relevant if high_movement_multiple_scans_feature_enabled=true + optional int32 num_high_movement_connection_skipped = 3; + + // Number of times connection is initiated in the high movement state + // only relevant if high_movement_multiple_scans_feature_enabled=true + optional int32 num_high_movement_connection_started = 4; } message WifiIsUnusableEvent { |