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 */
public int getAuthType() {
if (allowedKeyManagement.cardinality() > 1) {
throw new IllegalStateException("More than one auth type set");
if (isValid() == false) {
throw new IllegalStateException("Invalid configuration");
}
if (allowedKeyManagement.get(KeyMgmt.WPA_PSK)) {
return KeyMgmt.WPA_PSK;