wifi: Support interface disable event in hostapd
Fork from ag/17725527. There is a case which the frameworks would
remove interface in the bridged mode. The hostapd should monitor
interface status and report to the framework for aligning the status.
Bug: 207055799
Test: manual test via "adb shell cmd wifi remove-softap-instance"
Change-Id: Id29648abbb5219464ea6c5f3b19ca9360a1531cd
diff --git a/hostapd/aidl/hostapd.cpp b/hostapd/aidl/hostapd.cpp
index d973dae..e4e0a88 100644
--- a/hostapd/aidl/hostapd.cpp
+++ b/hostapd/aidl/hostapd.cpp
@@ -1013,7 +1013,9 @@
for (const auto &callback : callbacks_) {
callback->onApInstanceInfoChanged(info);
}
- } else if (os_strncmp(txt, AP_EVENT_DISABLED, strlen(AP_EVENT_DISABLED)) == 0) {
+ } else if (os_strncmp(txt, AP_EVENT_DISABLED, strlen(AP_EVENT_DISABLED)) == 0
+ || os_strncmp(txt, INTERFACE_DISABLED, strlen(INTERFACE_DISABLED)) == 0)
+ {
// Invoke the failure callback on all registered clients.
for (const auto& callback : callbacks_) {
callback->onFailure(strlen(iface_hapd->conf->bridge) > 0 ?