diff options
author | Mingguang Xu <mingguangxu@google.com> | 2020-03-14 02:15:48 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-03-14 02:15:48 +0000 |
commit | 0d94dc6f2e4a680e3306c4b236f9d9d6ee51c2d7 (patch) | |
tree | d56c92618e1a7e8d46fe0ca4047db41d58c36659 | |
parent | 5c99f2f1d4c31c81ea0fd4d5928ad47cc15a467e (diff) | |
parent | 0d2ced5e4112e15bb2fa123e691f4a4943417875 (diff) |
Merge "Add metric to indicate whether external scorer from OEM module is on" into rvc-dev
4 files changed, 27 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java index 141da8a3d..d2d6c251e 100644 --- a/service/java/com/android/server/wifi/WifiMetrics.java +++ b/service/java/com/android/server/wifi/WifiMetrics.java @@ -3141,6 +3141,8 @@ public class WifiMetrics { + mWifiLogProto.numIpRenewalFailure); pw.println("mWifiLogProto.connectionDurationStats=" + mConnectionDurationStats.toString()); + pw.println("mWifiLogProto.isExternalWifiScorerOn=" + + mWifiLogProto.isExternalWifiScorerOn); } } } @@ -3906,6 +3908,7 @@ public class WifiMetrics { mNumProvisionSuccess = 0; mBssidBlocklistStats = new BssidBlocklistStats(); mConnectionDurationStats.clear(); + mWifiLogProto.isExternalWifiScorerOn = false; } } @@ -5490,4 +5493,13 @@ public class WifiMetrics { isThroughputSufficient, isCellularDataAvailable); } } + + /** + * Sets the status to indicate whether external WiFi connected network scorer is present or not. + */ + public void setIsExternalWifiScorerOn(boolean value) { + synchronized (mLock) { + mWifiLogProto.isExternalWifiScorerOn = value; + } + } } diff --git a/service/java/com/android/server/wifi/WifiScoreReport.java b/service/java/com/android/server/wifi/WifiScoreReport.java index a4226e5fc..3e8a1d9c4 100644 --- a/service/java/com/android/server/wifi/WifiScoreReport.java +++ b/service/java/com/android/server/wifi/WifiScoreReport.java @@ -540,6 +540,7 @@ public class WifiScoreReport { } // Disable AOSP scorer mVelocityBasedConnectedScore = null; + mWifiMetrics.setIsExternalWifiScorerOn(true); return true; } @@ -629,5 +630,6 @@ public class WifiScoreReport { // Create AOSP scorer and null external Wifi connected network scorer mVelocityBasedConnectedScore = new VelocityBasedConnectedScore(mScoringParams, mClock); mWifiConnectedNetworkScorerHolder = null; + mWifiMetrics.setIsExternalWifiScorerOn(false); } } diff --git a/service/proto/src/metrics.proto b/service/proto/src/metrics.proto index c3d88bb0f..7dd953b90 100644 --- a/service/proto/src/metrics.proto +++ b/service/proto/src/metrics.proto @@ -597,6 +597,9 @@ message WifiLog { // Total number of scan results for WAPI-Enterprise networks optional int32 num_wapi_enterprise_network_scan_results = 164; + + // Is the external WiFi connected network scorer from OEM extension module turned on + optional bool is_external_wifi_scorer_on = 165 [default = false]; } // Information that gets logged for every WiFi connection. diff --git a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java index 7dfe4c030..7b640b53e 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java @@ -4351,4 +4351,14 @@ public class WifiMetricsTest extends WifiBaseTest { assertEquals(3000, mDecodedProto.connectionDurationStats.totalTimeCellularDataOffMs); } + + /** + * Test the logging of isExternalWifiScorerOn + */ + @Test + public void testIsExternalWifiScorerOn() throws Exception { + mWifiMetrics.setIsExternalWifiScorerOn(true); + dumpProtoAndDeserialize(); + assertEquals(true, mDecodedProto.isExternalWifiScorerOn); + } } |