binder: Notify iface add/remove to binder
Notify |BinderManager| about any new iface addition/removal from
|wpa_supplicant| core.
|Iface| objects are stateless in the sense that they only
hold the name of the iface it controls. Every RPC call through the iface object
will first invoke |wpa_supplicant_get_iface| to ensure that the iface still
exists in the wpa_supplicant core.
While there,
1. Add some debug logs in binder.cpp.
2. Change C style comments to c++ style.
3. Add @utf8incpp annotation at the interface level in all the aidl files.
BUG: 29998764
TEST: Tested using the |gTest| integration tests. Will upload these under
|wificond|
Change-Id: If69bfaece7a6f69640fe8cbf90d1006a88aef8af
Signed-off-by: Roshan Pius <rpius@google.com>
diff --git a/wpa_supplicant/binder/binder.cpp b/wpa_supplicant/binder/binder.cpp
index 750e878..eb6006c 100644
--- a/wpa_supplicant/binder/binder.cpp
+++ b/wpa_supplicant/binder/binder.cpp
@@ -41,12 +41,16 @@
return NULL;
priv->global = global;
+ wpa_printf(MSG_DEBUG, "Initing binder control");
+
android::ProcessState::self()->setThreadPoolMaxThreadCount(0);
android::IPCThreadState::self()->disableBackgroundScheduling(true);
android::IPCThreadState::self()->setupPolling(&priv->binder_fd);
- wpa_printf(MSG_INFO, "Process binder events on FD %d", priv->binder_fd);
if (priv->binder_fd < 0)
goto err;
+
+ wpa_printf(
+ MSG_INFO, "Processing binder events on FD %d", priv->binder_fd);
/* Look for read events from the binder socket in the eloop. */
if (eloop_register_read_sock(
priv->binder_fd, wpas_binder_sock_handler, global, priv) < 0)
@@ -72,6 +76,8 @@
if (!priv)
return;
+ wpa_printf(MSG_DEBUG, "Deiniting binder control");
+
wpa_supplicant_binder::BinderManager::destroyInstance();
eloop_unregister_read_sock(priv->binder_fd);
android::IPCThreadState::shutdown();
@@ -82,6 +88,10 @@
if (!wpa_s->global->binder)
return 1;
+ wpa_printf(
+ MSG_DEBUG, "Registering interface to binder control: %s",
+ wpa_s->ifname);
+
wpa_supplicant_binder::BinderManager *binder_manager =
wpa_supplicant_binder::BinderManager::getInstance();
if (!binder_manager)
@@ -95,6 +105,10 @@
if (!wpa_s->global->binder)
return 1;
+ wpa_printf(
+ MSG_DEBUG, "Deregistering interface from binder control: %s",
+ wpa_s->ifname);
+
wpa_supplicant_binder::BinderManager *binder_manager =
wpa_supplicant_binder::BinderManager::getInstance();
if (!binder_manager)