wifi: Change namespace
Move the implementation to "android::hardware::wifi:V1_0::implementation"
namespace.
This is following the style guidelines in NFC HIDL
implementation(go/aog/279421).
While there,
Run checkstyle to correct formatting issues.
Bug:31936700
Test: mmma -j32 hardware/interfaces/wifi/1.0/default
Change-Id: I5600a60a0041b3318ed9289823ec335a8ed8a83d
diff --git a/wifi/1.0/default/wifi.cpp b/wifi/1.0/default/wifi.cpp
index 0e10bfb..aa0fc5b 100644
--- a/wifi/1.0/default/wifi.cpp
+++ b/wifi/1.0/default/wifi.cpp
@@ -22,7 +22,6 @@
#include "failure_reason_util.h"
#include "wifi_chip.h"
-using ::android::hardware::wifi::V1_0::CommandFailureReason;
using RunState = ::android::hardware::wifi::WifiHalState::RunState;
namespace {
@@ -36,6 +35,8 @@
namespace android {
namespace hardware {
namespace wifi {
+namespace V1_0 {
+namespace implementation {
Wifi::Wifi(sp<Looper>& looper) : state_(looper) {
CHECK_EQ(init_wifi_vendor_hal_func_table(&state_.func_table_), WIFI_SUCCESS)
@@ -43,7 +44,7 @@
}
Return<void> Wifi::registerEventCallback(
- const sp<V1_0::IWifiEventCallback>& callback) {
+ const sp<IWifiEventCallback>& callback) {
// TODO(b/31632518): remove the callback when the client is destroyed
callbacks_.insert(callback);
return Void();
@@ -72,8 +73,8 @@
if (status != WIFI_SUCCESS) {
LOG(ERROR) << "Failed to initialize Wifi HAL";
for (auto& callback : callbacks_) {
- callback->onStartFailure(CreateFailureReasonLegacyError(
- status, "Failed to initialize HAL"));
+ callback->onStartFailure(
+ CreateFailureReasonLegacyError(status, "Failed to initialize HAL"));
}
return Void();
}
@@ -95,8 +96,7 @@
return Void();
}
-wifi_interface_handle Wifi::FindInterfaceHandle(
- const std::string& ifname) {
+wifi_interface_handle Wifi::FindInterfaceHandle(const std::string& ifname) {
int num_iface_handles = 0;
wifi_interface_handle* iface_handles = nullptr;
wifi_error ret = state_.func_table_.wifi_get_ifaces(
@@ -124,7 +124,6 @@
return kInterfaceNotFoundHandle;
}
-
void NoopHalCleanupHandler(wifi_handle) {}
Return<void> Wifi::stop() {
@@ -142,7 +141,8 @@
awaiting_hal_event_loop_termination_ = true;
state_.run_state_ = RunState::STOPPING;
- if (chip_.get()) chip_->Invalidate();
+ if (chip_.get())
+ chip_->Invalidate();
chip_.clear();
state_.func_table_.wifi_cleanup(state_.hal_handle_, NoopHalCleanupHandler);
@@ -160,10 +160,10 @@
}
LOG(VERBOSE) << "HAL Event loop terminated";
event_loop_thread_.detach();
- state_.PostTask([this](){
- awaiting_hal_event_loop_termination_ = false;
- FinishHalCleanup();
- });
+ state_.PostTask([this]() {
+ awaiting_hal_event_loop_termination_ = false;
+ FinishHalCleanup();
+ });
}
void Wifi::FinishHalCleanup() {
@@ -176,12 +176,13 @@
}
}
-
Return<void> Wifi::getChip(getChip_cb cb) {
cb(chip_);
return Void();
}
+} // namespace implementation
+} // namespace V1_0
} // namespace wifi
} // namespace hardware
} // namespace android