mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Acquire the global lock when the
dump method is called. This should prevent a race condition between stop() and dump(). stop() already acquires the global lock when it calls validateAndCall(). Bug: 274641043 Test: adb shell dumpsys wifi # validates dump() Change-Id: Ie2df0861308954cd2e399c9604d4ae0dcddf95fb
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include <android-base/logging.h>
|
||||
|
||||
#include "aidl_return_util.h"
|
||||
#include "aidl_sync_util.h"
|
||||
#include "wifi_status_util.h"
|
||||
|
||||
namespace {
|
||||
@@ -32,6 +33,7 @@ namespace hardware {
|
||||
namespace wifi {
|
||||
using aidl_return_util::validateAndCall;
|
||||
using aidl_return_util::validateAndCallWithLock;
|
||||
using aidl_sync_util::acquireGlobalLock;
|
||||
|
||||
Wifi::Wifi(const std::shared_ptr<::android::wifi_system::InterfaceTool> iface_tool,
|
||||
const std::shared_ptr<legacy_hal::WifiLegacyHalFactory> legacy_hal_factory,
|
||||
@@ -78,6 +80,7 @@ ndk::ScopedAStatus Wifi::getChip(int32_t in_chipId, std::shared_ptr<IWifiChip>*
|
||||
}
|
||||
|
||||
binder_status_t Wifi::dump(int fd, const char** args, uint32_t numArgs) {
|
||||
const auto lock = acquireGlobalLock();
|
||||
LOG(INFO) << "-----------Debug was called----------------";
|
||||
if (chips_.size() == 0) {
|
||||
LOG(INFO) << "No chips to display.";
|
||||
|
||||
Reference in New Issue
Block a user