From 2a0ad34fff0956b85afa702617a3322ca85c3dca Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Tue, 16 May 2017 13:31:35 -0700 Subject: WifiMetrics: Add methods to increment new hal/cond metrics Bug: 36586897 Test: Unit tests Change-Id: Ic3bca30e59111923f6c7b65e8955b4d37046b2e0 (cherry picked from commit bd2cff58fca2f3d9a0cd6df8526b23f48d9d44ec) --- .../java/com/android/server/wifi/WifiMetrics.java | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiMetrics.java b/service/java/com/android/server/wifi/WifiMetrics.java index bea806484..92a6fd645 100644 --- a/service/java/com/android/server/wifi/WifiMetrics.java +++ b/service/java/com/android/server/wifi/WifiMetrics.java @@ -986,6 +986,43 @@ public class WifiMetrics { } } + /** + * Increment number of times the HAL crashed. + */ + public void incrementNumHalCrashes() { + synchronized (mLock) { + mWifiLogProto.numHalCrashes++; + } + } + + /** + * Increment number of times the Wificond crashed. + */ + public void incrementNumWificondCrashes() { + synchronized (mLock) { + mWifiLogProto.numWificondCrashes++; + } + } + + /** + * Increment number of times the wifi on failed due to an error in HAL. + */ + public void incrementNumWifiOnFailureDueToHal() { + synchronized (mLock) { + mWifiLogProto.numWifiOnFailureDueToHal++; + } + } + + /** + * Increment number of times the wifi on failed due to an error in wificond. + */ + public void incrementNumWifiOnFailureDueToWificond() { + synchronized (mLock) { + mWifiLogProto.numWifiOnFailureDueToWificond++; + } + } + + public static final String PROTO_DUMP_ARG = "wifiMetricsProto"; public static final String CLEAN_DUMP_ARG = "clean"; @@ -1175,6 +1212,14 @@ public class WifiMetrics { pw.println(" FAILED_NO_CHANNEL: " + mSoftApManagerReturnCodeCounts.get( WifiMetricsProto.SoftApReturnCodeCount.SOFT_AP_FAILED_NO_CHANNEL)); pw.print("\n"); + pw.println("mWifiLogProto.numHalCrashes=" + + mWifiLogProto.numHalCrashes); + pw.println("mWifiLogProto.numWificondCrashes=" + + mWifiLogProto.numWificondCrashes); + pw.println("mWifiLogProto.numWifiOnFailureDueToHal=" + + mWifiLogProto.numWifiOnFailureDueToHal); + pw.println("mWifiLogProto.numWifiOnFailureDueToWificond=" + + mWifiLogProto.numWifiOnFailureDueToWificond); pw.println("StaEventList:"); for (StaEvent event : mStaEventList) { pw.println(staEventToString(event)); -- cgit v1.2.3