Restore STA reconnection behavior

Have the customized retry behavior only for P2P & do group failure indication
beyond 5 retries

Bug: b/6674338, b/6910598
Change-Id: I58cba356ebdb7fc4eaa9bedfa417b7d5d35bb306

Conflicts:

	wpa_supplicant/events.c
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index c4b3862..451bfd4 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -2383,8 +2383,8 @@
 		if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME)
 			sme_event_assoc_reject(wpa_s, data);
 #ifdef ANDROID_P2P
-		else {
-
+#ifdef CONFIG_P2P
+		else if (wpa_s->p2p_group_interface != NOT_P2P_GROUP_INTERFACE) {
 			if(!wpa_s->current_ssid) {
 				wpa_printf(MSG_ERROR, "current_ssid == NULL");
 				break;
@@ -2410,13 +2410,12 @@
 			 	 */
 				wpa_printf(MSG_ERROR, "Assoc retry threshold reached. "
 				"Disabling the network");
+				wpa_s->current_ssid->assoc_retry = 0;
 				wpa_supplicant_disable_network(wpa_s, wpa_s->current_ssid);
-#ifdef CONFIG_P2P
-				if(wpa_s->p2p_group_interface != NOT_P2P_GROUP_INTERFACE)
-					wpas_p2p_group_remove(wpa_s, wpa_s->ifname);
-#endif
+				wpas_p2p_group_remove(wpa_s, wpa_s->ifname);
 			}
 		}
+#endif
 #endif /* ANDROID_P2P */
 		break;
 	case EVENT_AUTH_TIMED_OUT: