summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorJan Nordqvist <jannq@google.com>2015-06-01 16:14:55 -0700
committerVinit Deshpande <vinitd@google.com>2015-06-03 05:18:12 +0000
commitd49288352908e8cbc9a001e13df2eb35e78deb1a (patch)
treec33b029bdefc61f493b3bfb7f02af808ea53f550 /wifi
parent597492c963725366b320678786d241e7f654e347 (diff)
downloadframeworks_base-d49288352908e8cbc9a001e13df2eb35e78deb1a.zip
frameworks_base-d49288352908e8cbc9a001e13df2eb35e78deb1a.tar.gz
frameworks_base-d49288352908e8cbc9a001e13df2eb35e78deb1a.tar.bz2
Cleaned out "isValid" from WifiConfig.
Change-Id: I028615e55700aa92889670297f1130397eba650f (cherry picked from commit c50315e014efded84b8f1981602951011816360b)
Diffstat (limited to 'wifi')
-rw-r--r--wifi/java/android/net/wifi/WifiConfiguration.java58
1 files changed, 2 insertions, 56 deletions
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java
index 2184c01..a1d5dd5 100644
--- a/wifi/java/android/net/wifi/WifiConfiguration.java
+++ b/wifi/java/android/net/wifi/WifiConfiguration.java
@@ -919,60 +919,6 @@ public class WifiConfiguration implements Parcelable {
}
/**
- * indicates whether the configuration is valid
- * @return true if valid, false otherwise
- * @hide
- */
- public boolean isValid() {
- String reason = strIsValid();
- if (reason != null) {
- Log.e(TAG, "WiFi Config not valid: " + reason);
- return false;
- }
- else {
- return true;
- }
- }
-
- private String strIsValid() {
-
- if (allowedKeyManagement == null)
- return "allowed kmgmt";
-
- if (allowedKeyManagement.cardinality() > 1) {
- if (allowedKeyManagement.cardinality() != 2) {
- return "cardinality != 2";
- }
- if (!allowedKeyManagement.get(KeyMgmt.WPA_EAP)) {
- return "not WPA_EAP";
- }
- if ((!allowedKeyManagement.get(KeyMgmt.IEEE8021X))
- && (!allowedKeyManagement.get(KeyMgmt.WPA_PSK))) {
- return "not PSK or 8021X";
- }
- }
-
- if (!TextUtils.isEmpty(FQDN)) {
- /* this is passpoint configuration; it must not have an SSID */
- if (!TextUtils.isEmpty(SSID)) {
- return "SSID not expected for Passpoint: '" + SSID + "'";
- }
- /* this is passpoint configuration; it must have a providerFriendlyName */
- if (TextUtils.isEmpty(providerFriendlyName)) {
- return "no provider friendly name";
- }
- /* this is passpoint configuration; it must have enterprise config */
- if (enterpriseConfig == null
- || enterpriseConfig.getEapMethod() == WifiEnterpriseConfig.Eap.NONE ) {
- return "no enterprise config";
- }
- }
-
- // TODO: Add more checks
- return null;
- }
-
- /**
* Identify if this configuration represents a passpoint network
*/
public boolean isPasspoint() {
@@ -1327,8 +1273,8 @@ public class WifiConfiguration implements Parcelable {
/** @hide */
public int getAuthType() {
- if (isValid() == false) {
- throw new IllegalStateException("Invalid configuration");
+ if (allowedKeyManagement.cardinality() > 1) {
+ throw new IllegalStateException("More than one auth type set");
}
if (allowedKeyManagement.get(KeyMgmt.WPA_PSK)) {
return KeyMgmt.WPA_PSK;