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
This commit is contained in:
Jimmy Chen
2022-07-10 10:25:21 +08:00
parent d6df6240bf
commit e2206be29d

View File

@@ -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;