wifi: Add listen AP_EVENT_ENABLED event
The WPA_EVENT_CHANNEL_SWITCH only request to send it when channel
switch. It may not receive this event when hotspot started(It depends on
driver's design). Add listen AP_EVENT_ENABLED to handle if driver
doesn't support WPA_EVENT_CHANNEL_SWITCH when hotspot enabled.
Bug: 172536837
Test: Manual test to check behavior in log.
Change-Id: I8d97477da6b96bcd1ec3dbb9d5c560dc54f47bad
diff --git a/hostapd/hidl/1.3/hostapd.cpp b/hostapd/hidl/1.3/hostapd.cpp
index 274a079..ce20cea 100644
--- a/hostapd/hidl/1.3/hostapd.cpp
+++ b/hostapd/hidl/1.3/hostapd.cpp
@@ -841,7 +841,9 @@
enum wpa_msg_type type, const char *txt,
size_t len) {
wpa_printf(MSG_DEBUG, "Receive wpa msg : %s", txt);
- if (os_strncmp(txt, WPA_EVENT_CHANNEL_SWITCH,
+ if (os_strncmp(txt, AP_EVENT_ENABLED,
+ strlen(AP_EVENT_ENABLED)) == 0 ||
+ os_strncmp(txt, WPA_EVENT_CHANNEL_SWITCH,
strlen(WPA_EVENT_CHANNEL_SWITCH)) == 0) {
for (const auto &callback : callbacks_) {
callback->onApInstanceInfoChanged(