Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93fbee47 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Wifi: Maintain configKey generation logic same in all APIs"

parents 5b0636fe 1014e9c8
Loading
Loading
Loading
Loading
+9 −10
Original line number Diff line number Diff line
@@ -1399,14 +1399,14 @@ public class WifiConfiguration implements Parcelable {
            key = mCachedConfigKey;
        } else {
            if (allowedKeyManagement.get(KeyMgmt.WPA_PSK)) {
                key = SSID + KeyMgmt.strings[KeyMgmt.WPA_PSK];
                key = SSID + "-" + KeyMgmt.strings[KeyMgmt.WPA_PSK];
            } else if (allowedKeyManagement.get(KeyMgmt.WPA_EAP) ||
                    allowedKeyManagement.get(KeyMgmt.IEEE8021X)) {
                key = SSID + KeyMgmt.strings[KeyMgmt.WPA_EAP];
                key = SSID + "-" + KeyMgmt.strings[KeyMgmt.WPA_EAP];
            } else if (wepKeys[0] != null) {
                key = SSID + "WEP";
                key = SSID + "-WEP";
            } else {
                key = SSID + KeyMgmt.strings[KeyMgmt.NONE];
                key = SSID + "-" + KeyMgmt.strings[KeyMgmt.NONE];
            }
            mCachedConfigKey = key;
        }
@@ -1428,14 +1428,13 @@ public class WifiConfiguration implements Parcelable {

        if (result.capabilities.contains("WEP")) {
            key = key + "-WEP";
        }

        if (result.capabilities.contains("PSK")) {
        } else if (result.capabilities.contains("PSK")) {
            key = key + "-" + KeyMgmt.strings[KeyMgmt.WPA_PSK];
        }

        if (result.capabilities.contains("EAP")) {
        } else if (result.capabilities.contains("EAP") ||
                   result.capabilities.contains("IEEE8021X")) {
            key = key + "-" + KeyMgmt.strings[KeyMgmt.WPA_EAP];
        } else {
            key = key +"-" + KeyMgmt.strings[KeyMgmt.NONE];
        }

        return key;