diff options
author | Oscar Shu <xshu@google.com> | 2020-08-06 16:59:26 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-08-06 16:59:26 +0000 |
commit | 7a0bc12dd5efcfa51da7d808bac1668849951854 (patch) | |
tree | c34e424f7f6d7f85235528243cd8c2475cdaac10 /wifi/1.4 | |
parent | 375ea0d2663ae11283a1d17874808f0c1994026a (diff) | |
parent | cb07b80c3c42db10520208ba54410e2bce1a6379 (diff) | |
download | platform_hardware_interfaces-7a0bc12dd5efcfa51da7d808bac1668849951854.tar.gz platform_hardware_interfaces-7a0bc12dd5efcfa51da7d808bac1668849951854.tar.bz2 platform_hardware_interfaces-7a0bc12dd5efcfa51da7d808bac1668849951854.zip |
Merge "Ringbuffer stops logging after wifi toggle" into rvc-qpr-dev am: cb07b80c3c
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/12257415
Change-Id: I01871d3967f95e0baf10941162bf3b2a9f7a5204
Diffstat (limited to 'wifi/1.4')
-rw-r--r-- | wifi/1.4/default/wifi_chip.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/wifi/1.4/default/wifi_chip.cpp b/wifi/1.4/default/wifi_chip.cpp index 8747e61992..8cba464757 100644 --- a/wifi/1.4/default/wifi_chip.cpp +++ b/wifi/1.4/default/wifi_chip.cpp @@ -624,6 +624,15 @@ Return<void> WifiChip::getCapabilities_1_3(getCapabilities_cb hidl_status_cb) { Return<void> WifiChip::debug(const hidl_handle& handle, const hidl_vec<hidl_string>&) { if (handle != nullptr && handle->numFds >= 1) { + { + std::unique_lock<std::mutex> lk(lock_t); + for (const auto& item : ringbuffer_map_) { + forceDumpToDebugRingBufferInternal(item.first); + } + // unique_lock unlocked here + } + usleep(100 * 1000); // sleep for 100 milliseconds to wait for + // ringbuffer updates. int fd = handle->data[0]; if (!writeRingbufferFilesInternal()) { LOG(ERROR) << "Error writing files to flash"; @@ -1120,6 +1129,9 @@ WifiStatus WifiChip::stopLoggingToDebugRingBufferInternal() { legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->deregisterRingBufferCallbackHandler( getFirstActiveWlanIfaceName()); + if (legacy_status == legacy_hal::WIFI_SUCCESS) { + debug_ring_buffer_cb_registered_ = false; + } return createWifiStatusFromLegacyError(legacy_status); } @@ -1335,7 +1347,7 @@ WifiStatus WifiChip::registerDebugRingBufferCallback() { LOG(ERROR) << "Ringname " << name << " not found"; return; } - // unlock + // unique_lock unlocked here } }; legacy_hal::wifi_error legacy_status = @@ -1637,7 +1649,7 @@ bool WifiChip::writeRingbufferFilesInternal() { } } } - // unlock + // unique_lock unlocked here } return true; } |