summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2017-03-17 16:35:39 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-03-17 16:35:39 +0000
commitb71c71a50b7e1b578fb34749cb514bc481cd53ea (patch)
tree55e24f4ca1511bfe7914ede1d8229ada329e7e5f
parent0c953680838dddc8c4890a73511bcca44dbd4ad9 (diff)
parent9c0f86104b3aca6a5759bdf9fb0f6c36f3228d07 (diff)
Merge "SupplicantStaIfaceHal: Stop wpa_supplicant auto connect" am: 8923f3bd35
am: 9c0f86104b Change-Id: I601e777938276a45d1298dd2b97b6c9ed79efb63
-rw-r--r--service/java/com/android/server/wifi/SupplicantStaIfaceHal.java15
-rw-r--r--service/java/com/android/server/wifi/WifiNative.java10
-rw-r--r--service/java/com/android/server/wifi/WifiStateMachine.java3
3 files changed, 28 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java b/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java
index 9d063d247..8f141e6a2 100644
--- a/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java
+++ b/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java
@@ -1446,6 +1446,21 @@ public class SupplicantStaIfaceHal {
}
}
+ /** See ISupplicant.hal for documentation */
+ public boolean enableAutoReconnect(boolean enable) {
+ synchronized (mLock) {
+ final String methodStr = "enableAutoReconnect";
+ if (!checkSupplicantAndLogFailure(methodStr)) return false;
+ try {
+ SupplicantStatus status = mISupplicantStaIface.enableAutoReconnect(enable);
+ return checkStatusAndLogFailure(status, methodStr);
+ } catch (RemoteException e) {
+ handleRemoteException(e, methodStr);
+ return false;
+ }
+ }
+ }
+
public static final int LOG_LEVEL_EXCESSIVE = ISupplicant.DebugLevel.EXCESSIVE;
public static final int LOG_LEVEL_MSGDUMP = ISupplicant.DebugLevel.MSGDUMP;
public static final int LOG_LEVEL_DEBUG = ISupplicant.DebugLevel.DEBUG;
diff --git a/service/java/com/android/server/wifi/WifiNative.java b/service/java/com/android/server/wifi/WifiNative.java
index d8df0da72..87ace7839 100644
--- a/service/java/com/android/server/wifi/WifiNative.java
+++ b/service/java/com/android/server/wifi/WifiNative.java
@@ -671,6 +671,16 @@ public class WifiNative {
}
/**
+ * Enable/Disable auto reconnect functionality in wpa_supplicant.
+ *
+ * @param enable true to enable auto reconnecting, false to disable.
+ * @return true if request is sent successfully, false otherwise.
+ */
+ public boolean enableStaAutoReconnect(boolean enable) {
+ return mSupplicantStaIfaceHal.enableAutoReconnect(enable);
+ }
+
+ /**
* Migrate all the configured networks from wpa_supplicant.
*
* @param configs Map of configuration key to configuration objects corresponding to all
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java
index 2f86743f2..58b4ff639 100644
--- a/service/java/com/android/server/wifi/WifiStateMachine.java
+++ b/service/java/com/android/server/wifi/WifiStateMachine.java
@@ -4204,6 +4204,9 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss
// Enable link layer stats gathering
mWifiNative.setWifiLinkLayerStats("wlan0", 1);
+
+ // Disable wpa_supplicant from auto reconnecting.
+ mWifiNative.enableStaAutoReconnect(false);
}
@Override