From 6b983b4e0c5a1e4073983e0fda3d3d6a57e9f6a2 Mon Sep 17 00:00:00 2001 From: xshu Date: Tue, 21 Jul 2020 19:01:53 -0700 Subject: Ringbuffer stops logging after wifi toggle Fix ringbuffer not updating after wifi is toggled when "Wi-Fi scanning" is turned on. Bug: 161307741 Test: atest com.android.server.wifi Test: manual test Change-Id: I6b6d3d1b11aaaa407f1cbda4a45c3349805fe43d Merged-In: I6b6d3d1b11aaaa407f1cbda4a45c3349805fe43d (cherry picked from commit e05ba2e7cc29ba5c084401a2961a7a4aa93099e8) --- service/java/com/android/server/wifi/WifiDiagnostics.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiDiagnostics.java b/service/java/com/android/server/wifi/WifiDiagnostics.java index 6fc75c6ea..38045625e 100644 --- a/service/java/com/android/server/wifi/WifiDiagnostics.java +++ b/service/java/com/android/server/wifi/WifiDiagnostics.java @@ -226,6 +226,10 @@ class WifiDiagnostics extends BaseWifiDiagnostics { if (!mActiveInterfaces.isEmpty()) { return; } + if (mLogLevel != VERBOSE_NO_LOG) { + stopLoggingAllBuffers(); + mRingBuffers = null; + } if (mIsLoggingEventHandlerRegistered) { if (!mWifiNative.resetLogHandler()) { mLog.wC("Fail to reset log handler"); @@ -236,10 +240,6 @@ class WifiDiagnostics extends BaseWifiDiagnostics { // the log handler is in an indeterminate state. mIsLoggingEventHandlerRegistered = false; } - if (mLogLevel != VERBOSE_NO_LOG) { - stopLoggingAllBuffers(); - mRingBuffers = null; - } } @Override -- cgit v1.2.3