Support Passpoint frame filters in Android

The conf->hs20 flag is not used in Android, but HS 2.0
configuration is still required when setting up the frame filters
in the WPA driver. Split the is_hs20_network() to two functions,
and moved the conf->hs20() check to a new is_hs20_config function.
Added ANDROID compilation flag in hs20_configure_frame_filters()
to skip the configuration check.
Additionally, trigger a call to hs20_configure_frame_filters()
upon succesful connection when state equals to WPA_COMPLETED.

Bug: 168681498
Test: Verify wpa driver is called with the appropriate frame filter
flags when connecting to Passpoint networks.
Test: Verify wpa driver is not called to filter frames for other
Enterprise networks.

Change-Id: I3afea6018d5ddd2211974ca10a30180c6cc204e7
diff --git a/wpa_supplicant/hs20_supplicant.c b/wpa_supplicant/hs20_supplicant.c
index 8aeb3b0..eaf0803 100644
--- a/wpa_supplicant/hs20_supplicant.c
+++ b/wpa_supplicant/hs20_supplicant.c
@@ -73,7 +73,12 @@
 	const u8 *ext_capa;
 	u32 filter = 0;
 
-	if (!bss || !is_hs20_network(wpa_s, wpa_s->current_ssid, bss)) {
+	if (!bss || !is_hs20_network(wpa_s, wpa_s->current_ssid, bss)
+#ifndef ANDROID
+			// HS 2.0 Configuration is not used in AOSP
+			|| !is_hs20_config(wpa_s)
+#endif
+			) {
 		wpa_printf(MSG_DEBUG,
 			   "Not configuring frame filtering - BSS " MACSTR
 			   " is not a Hotspot 2.0 network", MAC2STR(bssid));
@@ -158,11 +163,15 @@
 	return ((ie[6] >> 4) & 0x0f) + 1;
 }
 
+int is_hs20_config(struct wpa_supplicant *wpa_s)
+{
+	return wpa_s->conf->hs20;
+}
 
 int is_hs20_network(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
 		    struct wpa_bss *bss)
 {
-	if (!wpa_s->conf->hs20 || !ssid)
+	if (!ssid)
 		return 0;
 
 	if (ssid->parent_cred)