wifi: Restructure wifi legacy HAL implementation
Restructured the existing code to create a new class called
|WifiLegacyHal|. This class will be used as a wrapper to invoke
all the legacy HAL functions and handle the "C" style callbacks.
Bug: 31936700
Test: mmma -j32 hardware/interfaces/wifi/1.0/default
Change-Id: I63e8543f49886f8446101320a97d1e96e30d1035
diff --git a/wifi/1.0/default/service.cpp b/wifi/1.0/default/service.cpp
index 07e6c81..10ce1db 100644
--- a/wifi/1.0/default/service.cpp
+++ b/wifi/1.0/default/service.cpp
@@ -55,13 +55,14 @@
// Setup hwbinder service
android::sp<android::hardware::wifi::V1_0::IWifi> service =
- new android::hardware::wifi::V1_0::implementation::Wifi(looper);
+ new android::hardware::wifi::V1_0::implementation::Wifi();
CHECK_EQ(service->registerAsService("wifi"), android::NO_ERROR)
<< "Failed to register wifi HAL";
// Loop
- while (looper->pollAll(-1) != Looper::POLL_ERROR)
- ;
+ while (looper->pollAll(-1) != Looper::POLL_ERROR) {
+ // Keep polling until failure.
+ }
LOG(INFO) << "wifi_hal_legacy is terminating...";
return 0;