Merge "Enable support of Automatic Channel Selection"
diff --git a/wpa_supplicant/Android.mk b/wpa_supplicant/Android.mk
index 241e793..af64d24 100644
--- a/wpa_supplicant/Android.mk
+++ b/wpa_supplicant/Android.mk
@@ -1786,7 +1786,6 @@
     android.hardware.wifi.supplicant@1.1 \
     libhidlbase \
     libhidltransport \
-    libhwbinder \
     libutils \
     liblog
 LOCAL_EXPORT_C_INCLUDE_DIRS := \
diff --git a/wpa_supplicant/hidl/1.0/hidl.cpp b/wpa_supplicant/hidl/1.0/hidl.cpp
index ca914b4..ce8a459 100644
--- a/wpa_supplicant/hidl/1.0/hidl.cpp
+++ b/wpa_supplicant/hidl/1.0/hidl.cpp
@@ -21,13 +21,14 @@
 }
 
 using android::hardware::configureRpcThreadpool;
-using android::hardware::IPCThreadState;
+using android::hardware::setupTransportPolling;
+using android::hardware::handleTransportPoll;
 using android::hardware::wifi::supplicant::V1_0::implementation::HidlManager;
 
 void wpas_hidl_sock_handler(
-    int /* sock */, void * /* eloop_ctx */, void * /* sock_ctx */)
+    int sock, void * /* eloop_ctx */, void * /* sock_ctx */)
 {
-	IPCThreadState::self()->handlePolledCommands();
+	handleTransportPoll(sock);
 }
 
 struct wpas_hidl_priv *wpas_hidl_init(struct wpa_global *global)
@@ -43,8 +44,7 @@
 	wpa_printf(MSG_DEBUG, "Initing hidl control");
 
 	configureRpcThreadpool(1, true /* callerWillJoin */);
-	IPCThreadState::self()->disableBackgroundScheduling(true);
-	IPCThreadState::self()->setupPolling(&priv->hidl_fd);
+	priv->hidl_fd = setupTransportPolling();
 	if (priv->hidl_fd < 0)
 		goto err;
 
@@ -77,7 +77,6 @@
 
 	HidlManager::destroyInstance();
 	eloop_unregister_read_sock(priv->hidl_fd);
-	IPCThreadState::shutdown();
 	os_free(priv);
 }
 
diff --git a/wpa_supplicant/hidl/1.1/hidl.cpp b/wpa_supplicant/hidl/1.1/hidl.cpp
index a0102f5..10fc36c 100644
--- a/wpa_supplicant/hidl/1.1/hidl.cpp
+++ b/wpa_supplicant/hidl/1.1/hidl.cpp
@@ -21,13 +21,14 @@
 }
 
 using android::hardware::configureRpcThreadpool;
-using android::hardware::IPCThreadState;
+using android::hardware::setupTransportPolling;
+using android::hardware::handleTransportPoll;
 using android::hardware::wifi::supplicant::V1_1::implementation::HidlManager;
 
 void wpas_hidl_sock_handler(
-    int /* sock */, void * /* eloop_ctx */, void * /* sock_ctx */)
+    int sock, void * /* eloop_ctx */, void * /* sock_ctx */)
 {
-	IPCThreadState::self()->handlePolledCommands();
+	handleTransportPoll(sock);
 }
 
 struct wpas_hidl_priv *wpas_hidl_init(struct wpa_global *global)
@@ -43,8 +44,7 @@
 	wpa_printf(MSG_DEBUG, "Initing hidl control");
 
 	configureRpcThreadpool(1, true /* callerWillJoin */);
-	IPCThreadState::self()->disableBackgroundScheduling(true);
-	IPCThreadState::self()->setupPolling(&priv->hidl_fd);
+	priv->hidl_fd = setupTransportPolling();
 	if (priv->hidl_fd < 0)
 		goto err;
 
@@ -77,7 +77,6 @@
 
 	HidlManager::destroyInstance();
 	eloop_unregister_read_sock(priv->hidl_fd);
-	IPCThreadState::shutdown();
 	os_free(priv);
 }