aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Biren <gbiren@google.com>2023-06-02 20:11:28 +0000
committerGabriel Biren <gbiren@google.com>2023-06-02 20:19:17 +0000
commit7a30e7f7a43d55f8e5de3edbe61d63575f7c738a (patch)
treefa1481af9e762033995ab4d4d6eff61863f1f5e9
parent87a03d5c72b2e005021ea212d024ccacf706428c (diff)
downloadwpa_supplicant_8-7a30e7f7a43d55f8e5de3edbe61d63575f7c738a.tar.gz
Restore early AIDL initialization if the
-B daemonize option is not being used. AIDL initialization was moved in ag/22511957, but this causes issues if interfaces are added before the delayed AIDL initialization. Bug: 285101633 Test: Manual test - enable and disable the -B daemonize option. Check that AIDL is initialized at the right time for each case. Change-Id: I6ba6dc0e6ae3d4ba7b42a0998fe9b0f3f72f82d7
-rw-r--r--wpa_supplicant/notify.c19
-rw-r--r--wpa_supplicant/wpa_supplicant.c9
2 files changed, 21 insertions, 7 deletions
diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c
index 943897df..89a0389e 100644
--- a/wpa_supplicant/notify.c
+++ b/wpa_supplicant/notify.c
@@ -37,6 +37,16 @@ int wpas_notify_supplicant_initialized(struct wpa_global *global)
}
#endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
+#ifdef CONFIG_AIDL
+ // Initialize AIDL here if daemonize is disabled.
+ // Otherwise initialize it later.
+ if (!global->params.daemonize) {
+ global->aidl = wpas_aidl_init(global);
+ if (!global->aidl)
+ return -1;
+ }
+#endif /* CONFIG_AIDL */
+
return 0;
}
@@ -63,13 +73,14 @@ int wpas_notify_iface_added(struct wpa_supplicant *wpa_s)
}
#ifdef CONFIG_AIDL
- /* AIDL initialization may not be complete at this point.
+ /*
+ * AIDL initialization may not be complete here if daemonize is enabled.
* Initialization is done after daemonizing in order to avoid
* issues with the file descriptor.
*/
- if (!wpa_s || !wpa_s->global->aidl)
+ if (!wpa_s->global->aidl)
return 0;
- /* HIDL interface wants to keep track of the P2P mgmt iface. */
+ /* AIDL interface wants to keep track of the P2P mgmt iface. */
if (wpas_aidl_register_interface(wpa_s))
return -1;
#endif
@@ -85,7 +96,7 @@ void wpas_notify_iface_removed(struct wpa_supplicant *wpa_s)
wpas_dbus_unregister_interface(wpa_s);
}
- /* HIDL interface wants to keep track of the P2P mgmt iface. */
+ /* AIDL interface wants to keep track of the P2P mgmt iface. */
wpas_aidl_unregister_interface(wpa_s);
}
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 99ecef8d..287bc9e6 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -7920,9 +7920,12 @@ int wpa_supplicant_run(struct wpa_global *global)
}
#ifdef CONFIG_AIDL
- global->aidl = wpas_aidl_init(global);
- if (!global->aidl)
- return -1;
+ // If daemonize is enabled, initialize AIDL here.
+ if (global->params.daemonize) {
+ global->aidl = wpas_aidl_init(global);
+ if (!global->aidl)
+ return -1;
+ }
#endif /* CONFIG_AIDL */
eloop_register_signal_terminate(wpa_supplicant_terminate, global);