diff options
author | Ningyuan Wang <nywang@google.com> | 2017-09-11 15:07:48 -0700 |
---|---|---|
committer | Ningyuan Wang <nywang@google.com> | 2017-09-11 15:57:55 -0700 |
commit | ee66ce102f8cf140394f71baea332eebb47ff4ae (patch) | |
tree | dbe0b3e4b5e9ce7af7b520daa6d9257e87183d92 /service | |
parent | bad0137ff3af9bb082382e57f0e2a4b5fbda6dbd (diff) |
capture BR on wificond or HAL crashes
This allows us to save the most recent kernel logs
when wificond or hal crashes.
This saved log could help us debug underlying driver/kernel
issues.
Bug: 65550505
Bug: 64934608
Test: compile
Test: run frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: manually kill wificond and take bugreport
Find if there is a "Bug dump" section with "reason = 8"
Change-Id: Id9311cee34b3fc25400e804bd96795c7f28f537a
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiDiagnostics.java | 2 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/WifiStateMachine.java | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiDiagnostics.java b/service/java/com/android/server/wifi/WifiDiagnostics.java index 42078ef58..921faa306 100644 --- a/service/java/com/android/server/wifi/WifiDiagnostics.java +++ b/service/java/com/android/server/wifi/WifiDiagnostics.java @@ -77,6 +77,8 @@ class WifiDiagnostics extends BaseWifiDiagnostics { public static final int REPORT_REASON_UNEXPECTED_DISCONNECT = 5; public static final int REPORT_REASON_SCAN_FAILURE = 6; public static final int REPORT_REASON_USER_ACTION = 7; + public static final int REPORT_REASON_WIFICOND_CRASH = 8; + public static final int REPORT_REASON_HAL_CRASH = 9; /** number of bug reports to hold */ public static final int MAX_BUG_REPORTS = 4; diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index 41a599451..faad0e2d1 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -4118,11 +4118,14 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss case CMD_CLIENT_INTERFACE_BINDER_DEATH: Log.e(TAG, "wificond died unexpectedly. Triggering recovery"); mWifiMetrics.incrementNumWificondCrashes(); + mWifiDiagnostics.captureBugReportData( + WifiDiagnostics.REPORT_REASON_WIFICOND_CRASH); mWifiInjector.getSelfRecovery().trigger(SelfRecovery.REASON_WIFICOND_CRASH); break; case CMD_VENDOR_HAL_HWBINDER_DEATH: Log.e(TAG, "Vendor HAL died unexpectedly. Triggering recovery"); mWifiMetrics.incrementNumHalCrashes(); + mWifiDiagnostics.captureBugReportData(WifiDiagnostics.REPORT_REASON_HAL_CRASH); mWifiInjector.getSelfRecovery().trigger(SelfRecovery.REASON_HAL_CRASH); break; case CMD_DIAGS_CONNECT_TIMEOUT: |