From e2206be29d6da3e18e97c0628c4966606b16f447 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Sun, 10 Jul 2022 10:25:21 +0800 Subject: [PATCH] wifi: HIDL/AIDL register networks when p2p dev interface added persistent groups are not registered to the AIDL network map, hence wifi service gets errors on getting the group information. If p2p uses dedicated interface, register the network whose SSID starts with DIRECT-. Bug: 238529085 Bug: 238601241 Test: create a persistent group, turn off wifi, turn on wifi, check saved group Change-Id: Ib61459774d9afe236c4cc09023b87d718f23b831 --- wpa_supplicant/wpa_supplicant.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index 8ee8ca63..78efba0a 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -7195,11 +7195,15 @@ struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global, return NULL; } - /* Notify the control interfaces about new networks for non p2p mgmt - * ifaces. */ - if (iface->p2p_mgmt == 0) { - for (ssid = wpa_s->conf->ssid; ssid; ssid = ssid->next) + /* Notify the control interfaces about new networks */ + for (ssid = wpa_s->conf->ssid; ssid; ssid = ssid->next) { + if (iface->p2p_mgmt == 0) { wpas_notify_network_added(wpa_s, ssid); + } else if (ssid->ssid_len > P2P_WILDCARD_SSID_LEN + && os_strncmp((const char *) ssid->ssid, + P2P_WILDCARD_SSID, P2P_WILDCARD_SSID_LEN) == 0) { + wpas_notify_persistent_group_added(wpa_s, ssid); + } } wpa_s->next = global->ifaces;