From eaea4b75c2ecfd192d5dcefcf67bb851bf031f5e Mon Sep 17 00:00:00 2001 From: Rebecca Silberstein Date: Tue, 12 Apr 2016 10:42:43 -0700 Subject: WifiConfigStore: read requirePMF config variable When saving a wifi configuration, we set the requirePMF variable from the config, but it is never read back. Add the getNetworkVariable call for pmfVarName and add a call to verify the attempt to read it back in the WifiConfigManagerTest. Additionally fixed a checkstyle issue for unused imports. BUG: 28088226 Change-Id: Ib7b2ba796e31ae57273c34b6845c218419125b72 --- service/java/com/android/server/wifi/WifiConfigStore.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiConfigStore.java b/service/java/com/android/server/wifi/WifiConfigStore.java index d50ddfe47..8b4535ebf 100644 --- a/service/java/com/android/server/wifi/WifiConfigStore.java +++ b/service/java/com/android/server/wifi/WifiConfigStore.java @@ -16,7 +16,6 @@ package com.android.server.wifi; -import android.app.backup.BackupManager; import android.net.IpConfiguration.IpAssignment; import android.net.IpConfiguration.ProxySettings; import android.net.wifi.WifiConfiguration; @@ -27,7 +26,6 @@ import android.net.wifi.WpsInfo; import android.net.wifi.WpsResult; import android.os.FileObserver; import android.os.Process; -import android.os.SystemClock; import android.security.Credentials; import android.security.KeyChain; import android.security.KeyStore; @@ -371,6 +369,15 @@ public class WifiConfigStore { } } + value = mWifiNative.getNetworkVariable(netId, WifiConfiguration.pmfVarName); + config.requirePMF = false; + if (!TextUtils.isEmpty(value)) { + try { + config.requirePMF = Integer.parseInt(value) != 0; + } catch (NumberFormatException ignore) { + } + } + value = mWifiNative.getNetworkVariable(netId, WifiConfiguration.wepTxKeyIdxVarName); config.wepTxKeyIndex = -1; if (!TextUtils.isEmpty(value)) { -- cgit v1.2.3