Add initial implementation for the mainline
supplicant service.
This provides the initialization and teardown
logic, as well as an implementation of the
current AIDL interface.
Bug: 365585450
Test: Manual test - Retrieve service in the
framework and call the terminate method.
Change-Id: I30e5e4dbaf9cd5c13955045d3dc73fad4f0e3c1b
diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c
index c1258a8..1fb2628 100644
--- a/wpa_supplicant/notify.c
+++ b/wpa_supplicant/notify.c
@@ -28,6 +28,10 @@
#include "notify.h"
#include "aidl/vendor/aidl.h"
+#ifdef MAINLINE_SUPPLICANT
+#include "aidl/mainline/service.h"
+#endif
+
int wpas_notify_supplicant_initialized(struct wpa_global *global)
{
#ifdef CONFIG_CTRL_IFACE_DBUS_NEW
@@ -48,6 +52,12 @@
}
#endif /* CONFIG_AIDL */
+#ifdef MAINLINE_SUPPLICANT
+ global->aidl = mainline_aidl_init(global);
+ if (!global->aidl)
+ return -1;
+#endif /* MAINLINE_SUPPLICANT */
+
return 0;
}
@@ -63,6 +73,12 @@
if (global->aidl)
wpas_aidl_deinit(global->aidl);
#endif /* CONFIG_AIDL */
+
+#ifdef MAINLINE_SUPPLICANT
+ if (global->aidl)
+ mainline_aidl_deinit(global->aidl);
+#endif /* MAINLINE_SUPPLICANT */
+
}