wifi: Inform framework HAPD_IFACE_DISABLED when AP iface unavailable
This change adds callback to inform framework AP interface
HAPD_IFACE_DISABLED when driver event INTERFACE_UNAVAILABLE.
Bug: 197292709
Test: Local build & manual test disable/enable Wi-Fi
Change-Id: I8b6bad1a6444737e7cdbaaedb1eb0c85a86eb240
diff --git a/hostapd/aidl/hostapd.cpp b/hostapd/aidl/hostapd.cpp
index 140298a..816ddfc 100644
--- a/hostapd/aidl/hostapd.cpp
+++ b/hostapd/aidl/hostapd.cpp
@@ -893,8 +893,14 @@
for (const auto &callback : callbacks_) {
callback->onApInstanceInfoChanged(info);
}
+ } else if (os_strncmp(txt, AP_EVENT_DISABLED, strlen(AP_EVENT_DISABLED)) == 0) {
+ // Invoke the failure callback on all registered clients.
+ for (const auto& callback : callbacks_) {
+ callback->onFailure(strlen(iface_hapd->conf->bridge) > 0 ?
+ iface_hapd->conf->bridge : iface_hapd->conf->iface);
+ }
}
- };
+ };
// Setup callback
iface_hapd->setup_complete_cb = onAsyncSetupCompleteCb;