Merge "Fix incorrect exception being thrown from WifiConfiguration" into klp-dev

This commit is contained in:
Vinit Deshapnde
2013-09-20 19:30:26 +00:00
committed by Android (Google) Code Review

View File

@@ -554,8 +554,8 @@ public class WifiConfiguration implements Parcelable {
/** @hide */ /** @hide */
public int getAuthType() { public int getAuthType() {
if (allowedKeyManagement.cardinality() > 1) { if (isValid() == false) {
throw new IllegalStateException("More than one auth type set"); throw new IllegalStateException("Invalid configuration");
} }
if (allowedKeyManagement.get(KeyMgmt.WPA_PSK)) { if (allowedKeyManagement.get(KeyMgmt.WPA_PSK)) {
return KeyMgmt.WPA_PSK; return KeyMgmt.WPA_PSK;