Improve passpoint configuration validation
Change-Id: I717242b2f8b2e7d0f84c3a7c74c4672289387151
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java
index 872eb6f..943af10 100644
--- a/wifi/java/android/net/wifi/WifiConfiguration.java
+++ b/wifi/java/android/net/wifi/WifiConfiguration.java
@@ -926,13 +926,18 @@
}
}
- if (FQDN != null) {
- /* must have a providerFriendlyName */
- if (providerFriendlyName == null) {
+ if (TextUtils.isEmpty(FQDN) == false) {
+ /* this is passpoint configuration; it must not have an SSID */
+ if (TextUtils.isEmpty(SSID) == false) {
+ return false;
+ }
+ /* this is passpoint configuration; it must have a providerFriendlyName */
+ if (TextUtils.isEmpty(providerFriendlyName)) {
return false;
}
/* this is passpoint configuration; it must have enterprise config */
- if (enterpriseConfig == null) {
+ if (enterpriseConfig == null
+ || enterpriseConfig.getEapMethod() == WifiEnterpriseConfig.Eap.NONE ) {
return false;
}
}