summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorMingguang Xu <mingguangxu@google.com>2019-04-19 12:37:19 -0700
committerMingguang Xu <mingguangxu@google.com>2019-04-22 08:40:38 -0700
commit094ab86334602dd5402f371b0b7e71746df7a476 (patch)
treedb913ebce50c2096d363e75b6e71bf28aa8348b8 /service
parentedea5f52d7ceb19117d8c5ff2a28d1b0657fdae3 (diff)
Wifi usability: Check screen status before adding bad Wifi usability
stats Message of IP_reachability_lost and wifi_firmware_alert may occur while screen goes off and the Wifi usability stats triggered by them are not useful. Add a check to filter out them. Bug: 129282057 Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: I8a9f809879ba46732dbf034785a28da0df287de4 Signed-off-by: Mingguang Xu <mingguangxu@google.com>
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiMetrics.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java
index ffe76afe9..70aaaaf43 100644
--- a/service/java/com/android/server/wifi/WifiMetrics.java
+++ b/service/java/com/android/server/wifi/WifiMetrics.java
@@ -2245,10 +2245,8 @@ public class WifiMetrics {
public void logFirmwareAlert(int errorCode) {
incrementAlertReasonCount(errorCode);
logWifiIsUnusableEvent(WifiIsUnusableEvent.TYPE_FIRMWARE_ALERT, errorCode);
- if (mScreenOn) {
- addToWifiUsabilityStatsList(WifiUsabilityStats.LABEL_BAD,
- WifiUsabilityStats.TYPE_FIRMWARE_ALERT, errorCode);
- }
+ addToWifiUsabilityStatsList(WifiUsabilityStats.LABEL_BAD,
+ WifiUsabilityStats.TYPE_FIRMWARE_ALERT, errorCode);
}
public static final String PROTO_DUMP_ARG = "wifiMetricsProto";
@@ -4456,7 +4454,7 @@ public class WifiMetrics {
*/
public void addToWifiUsabilityStatsList(int label, int triggerType, int firmwareAlertCode) {
synchronized (mLock) {
- if (mWifiUsabilityStatsEntriesList.isEmpty()) {
+ if (mWifiUsabilityStatsEntriesList.isEmpty() || !mScreenOn) {
return;
}
if (label == WifiUsabilityStats.LABEL_GOOD) {