binder: Use ifname as key in BinderManager |IIface| map
Since ifname is unique, its probably a better key to lookup the
corresponding |IIface| binder object than using raw pointer.
This deprecates the usage |binder_object_key| added in |wpa_supplicant|
struct.
While there,
1. Change all comments in |BinderManager| to c++ style.
2. Add braces for all one line if statements.
BUG: 29998764
Change-Id: Ie0b571204b8363ac49c5db7666249b9a39006f31
TEST: Ran the integration tests under |wificond|.
Signed-off-by: Roshan Pius <rpius@google.com>
diff --git a/wpa_supplicant/binder/binder.cpp b/wpa_supplicant/binder/binder.cpp
index eb6006c..9fee001 100644
--- a/wpa_supplicant/binder/binder.cpp
+++ b/wpa_supplicant/binder/binder.cpp
@@ -85,7 +85,7 @@
int wpas_binder_register_interface(struct wpa_supplicant *wpa_s)
{
- if (!wpa_s->global->binder)
+ if (!wpa_s->global->binder || !wpa_s)
return 1;
wpa_printf(
@@ -102,7 +102,7 @@
int wpas_binder_unregister_interface(struct wpa_supplicant *wpa_s)
{
- if (!wpa_s->global->binder)
+ if (!wpa_s->global->binder || !wpa_s)
return 1;
wpa_printf(