Merge "HIDL changes to support Stadium Wifi."
diff --git a/hostapd/Android.mk b/hostapd/Android.mk
index 15a4e83..a64ec79 100644
--- a/hostapd/Android.mk
+++ b/hostapd/Android.mk
@@ -26,6 +26,9 @@
 
 L_CFLAGS += -Wall -Werror
 
+# TODO: move off readdir_r upstream, pull fix back (http://b/72326431).
+L_CFLAGS += -Wno-error-deprecated-declarations
+
 # Disable unused parameter warnings
 L_CFLAGS += -Wno-unused-parameter
 
diff --git a/hostapd/hidl/1.0/hostapd.cpp b/hostapd/hidl/1.0/hostapd.cpp
index abd4f3b..04e2840 100644
--- a/hostapd/hidl/1.0/hostapd.cpp
+++ b/hostapd/hidl/1.0/hostapd.cpp
@@ -71,14 +71,15 @@
 		    MSG_ERROR, "Invalid SSID size: %zu", nw_params.ssid.size());
 		return "";
 	}
-	if (nw_params.pskPassphrase.size() <
-		static_cast<uint32_t>(
-		    IHostapd::ParamSizeLimits::
-			WPA2_PSK_PASSPHRASE_MIN_LEN_IN_BYTES) ||
-	    nw_params.pskPassphrase.size() >
-		static_cast<uint32_t>(
-		    IHostapd::ParamSizeLimits::
-			WPA2_PSK_PASSPHRASE_MAX_LEN_IN_BYTES)) {
+	if ((nw_params.encryptionType != IHostapd::EncryptionType::NONE) &&
+	    (nw_params.pskPassphrase.size() <
+		 static_cast<uint32_t>(
+		     IHostapd::ParamSizeLimits::
+			 WPA2_PSK_PASSPHRASE_MIN_LEN_IN_BYTES) ||
+	     nw_params.pskPassphrase.size() >
+		 static_cast<uint32_t>(
+		     IHostapd::ParamSizeLimits::
+			 WPA2_PSK_PASSPHRASE_MAX_LEN_IN_BYTES))) {
 		wpa_printf(
 		    MSG_ERROR, "Invalid psk passphrase size: %zu",
 		    nw_params.pskPassphrase.size());
diff --git a/wpa_supplicant/Android.mk b/wpa_supplicant/Android.mk
index af64d24..33090e7 100644
--- a/wpa_supplicant/Android.mk
+++ b/wpa_supplicant/Android.mk
@@ -37,6 +37,9 @@
 # Disable sign compare warnings
 L_CFLAGS += -Wno-sign-compare
 
+# TODO: move off readdir_r upstream, pull fix back (http://b/72326431).
+L_CFLAGS += -Wno-error-deprecated-declarations
+
 # Disable unused function warnings
 L_CFLAGS += -Wno-unused-function
 
@@ -62,11 +65,11 @@
 endif
 
 # Use Android specific directory for control interface sockets
-L_CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_DIR=\"/data/misc/wifi/sockets\"
-L_CFLAGS += -DCONFIG_CTRL_IFACE_DIR=\"/data/misc/wifi/sockets\"
+L_CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_DIR=\"/data/vendor/wifi/wpa/sockets\"
+L_CFLAGS += -DCONFIG_CTRL_IFACE_DIR=\"/data/vendor/wifi/wpa/sockets\"
 
 # Use Android specific directory for wpa_cli command completion history
-L_CFLAGS += -DCONFIG_WPA_CLI_HISTORY_DIR=\"/data/misc/wifi\"
+L_CFLAGS += -DCONFIG_WPA_CLI_HISTORY_DIR=\"/data/vendor/wifi/wpa\"
 
 # To force sizeof(enum) = 4
 ifeq ($(TARGET_ARCH),arm)