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/iface.cpp b/wpa_supplicant/binder/iface.cpp
index c61b3b0..4faa147 100644
--- a/wpa_supplicant/binder/iface.cpp
+++ b/wpa_supplicant/binder/iface.cpp
@@ -11,6 +11,36 @@
 
 namespace wpa_supplicant_binder {
 
-Iface::Iface(struct wpa_supplicant *wpa_s) : wpa_s_(wpa_s) {}
+Iface::Iface(struct wpa_global *wpa_global, const char ifname[])
+    : wpa_global_(wpa_global), ifname_(ifname)
+{
+}
 
-} /* namespace wpa_supplicant_binder */
+android::binder::Status Iface::GetName(std::string *iface_name_out)
+{
+	// We could directly return the name we hold, but let's verify
+	// if the underlying iface still exists.
+	struct wpa_supplicant *wpa_s = retrieveIfacePtr();
+	if (!wpa_s) {
+		return android::binder::Status::fromServiceSpecificError(
+		    ERROR_IFACE_UNKNOWN,
+		    "wpa_supplicant does not control this interface.");
+	}
+
+	*iface_name_out = ifname_;
+	return android::binder::Status::ok();
+}
+
+/**
+ * Retrieve the underlying |wpa_supplicant| struct pointer for
+ * this iface.
+ * If the underlying iface is removed, then all RPC method calls
+ * on this object will return failure.
+ */
+wpa_supplicant *Iface::retrieveIfacePtr()
+{
+	return wpa_supplicant_get_iface(
+	    (struct wpa_global *)wpa_global_, ifname_.c_str());
+}
+
+} // namespace wpa_supplicant_binder