From 81ad2179f41a9592ff7ec330c93d3ab21e63725d Mon Sep 17 00:00:00 2001 From: Sravanthi Palakonda Date: Tue, 13 Jan 2015 16:50:55 +0530 Subject: wifi: Do not update conf file with the default sim_num value When Wi-Fi is turned On with saved profile, the framework will over write the existing sim_num value with the default value. Due to which, the supplicant will always try to authenticate with the default sim_num value (i.e., 1). To mitigate this, update the conf file only if sim_num has non zero values. Change-Id: I2c17944d44f5937974593c91ef27ed0dc39ece38 CRs-Fixed: 780903 --- .../java/com/android/server/wifi/WifiConfigStore.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'service/java/com/android/server/wifi/WifiConfigStore.java') diff --git a/service/java/com/android/server/wifi/WifiConfigStore.java b/service/java/com/android/server/wifi/WifiConfigStore.java index ffcb5c4a0..53b501ca0 100755 --- a/service/java/com/android/server/wifi/WifiConfigStore.java +++ b/service/java/com/android/server/wifi/WifiConfigStore.java @@ -2653,13 +2653,15 @@ public class WifiConfigStore extends IpConfigStore { } } - if (!mWifiNative.setNetworkVariable( - netId, - WifiConfiguration.SIMNumVarName, - Integer.toString(config.SIMNum))) { - loge(config.SIMNum + ": failed to set sim no: " - +config.SIMNum); - break setVariables; + if (config.SIMNum != 0) { + if (!mWifiNative.setNetworkVariable( + netId, + WifiConfiguration.SIMNumVarName, + Integer.toString(config.SIMNum))) { + loge(config.SIMNum + ": failed to set sim no: " + +config.SIMNum); + break setVariables; + } } String allowedKeyManagementString = -- cgit v1.2.3