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

Commit 70918513 authored by Nalla Kartheek's avatar Nalla Kartheek Committed by Linux Build Service Account
Browse files

Wifi: Maintain configKey generation logic same in backup agent

AutoJoinController uses configKey to distinguish networks. It compares
configKeys of saved network with recent ScanResult. WifiConfiguration
has two different APIs to generate configKey based on input variables.
Framework should use same logic to generate configkey even though input
differs. This fix ensures the parity in backup agent.

Change-Id: I6ee57efe1d346e50a434bce90ec8224f5203712c
parent 4224b21c
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -255,13 +255,13 @@ public class SettingsBackupAgent extends BackupAgentHelper {
            // Now build the canonical config key paralleling the WifiConfiguration semantics
            final String key;
            if (types.get(KeyMgmt.WPA_PSK)) {
                key = bareSsid + KeyMgmt.strings[KeyMgmt.WPA_PSK];
                key = bareSsid + "-" + KeyMgmt.strings[KeyMgmt.WPA_PSK];
            } else if (types.get(KeyMgmt.WPA_EAP) || types.get(KeyMgmt.IEEE8021X)) {
                key = bareSsid + KeyMgmt.strings[KeyMgmt.WPA_EAP];
                key = bareSsid + "-" + KeyMgmt.strings[KeyMgmt.WPA_EAP];
            } else if (hasWepKey) {
                key = bareSsid + "WEP";  // hardcoded this way in WifiConfiguration
                key = bareSsid + "-WEP";  // hardcoded this way in WifiConfiguration
            } else {
                key = bareSsid + KeyMgmt.strings[KeyMgmt.NONE];
                key = bareSsid + "-" + KeyMgmt.strings[KeyMgmt.NONE];
            }
            return key;
        }