summaryrefslogtreecommitdiffstats
path: root/service/java/com/android/server/wifi/WifiMonitor.java
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2017-03-02 16:43:42 -0800
committerRoshan Pius <rpius@google.com>2017-03-03 19:32:48 +0000
commitfdffec5da789c47a99dccdde29cbc6740e015f0b (patch)
tree54a1a47247742b8eeb6e5463ad32263fdf3d87f6 /service/java/com/android/server/wifi/WifiMonitor.java
parent8db1eb8b2a062d749116e7aba6c018c594f27a23 (diff)
downloadandroid_frameworks_opt_net_wifi-fdffec5da789c47a99dccdde29cbc6740e015f0b.tar.gz
android_frameworks_opt_net_wifi-fdffec5da789c47a99dccdde29cbc6740e015f0b.tar.bz2
android_frameworks_opt_net_wifi-fdffec5da789c47a99dccdde29cbc6740e015f0b.zip
WifiNative: Separate connect to supplicant
Since we have separate interfaces for P2P & STA operations to supplicant in the HIDL world, separate out these initialization sequence. PS: This new flag (isStaIface) is currently unused in the legacy socket interface. Bug: 35915447 Test: Wifi comes up and able to connect to networks. Change-Id: Idf1df650670e9b329c11443223c9e177fd6b3b32
Diffstat (limited to 'service/java/com/android/server/wifi/WifiMonitor.java')
-rw-r--r--service/java/com/android/server/wifi/WifiMonitor.java21
1 files changed, 17 insertions, 4 deletions
diff --git a/service/java/com/android/server/wifi/WifiMonitor.java b/service/java/com/android/server/wifi/WifiMonitor.java
index 65083b768..23249a7b6 100644
--- a/service/java/com/android/server/wifi/WifiMonitor.java
+++ b/service/java/com/android/server/wifi/WifiMonitor.java
@@ -591,7 +591,13 @@ public class WifiMonitor {
}
- private boolean ensureConnectedLocked() {
+ /**
+ * Wait for wpa_supplicant's control interface to be ready.
+ *
+ * @param isStaIface Whether STA or P2P iface.
+ * TODO: Add unit tests for these once we remove the legacy code.
+ */
+ private boolean ensureConnectedLocked(boolean isStaIface) {
if (mConnected) {
return true;
}
@@ -599,7 +605,7 @@ public class WifiMonitor {
if (mVerboseLoggingEnabled) Log.d(TAG, "connecting to supplicant");
int connectTries = 0;
while (true) {
- if (mWifiNative.connectToSupplicant()) {
+ if (mWifiNative.connectToSupplicant(isStaIface)) {
mConnected = true;
if (!WifiNative.HIDL_SUP_ENABLE) {
new MonitorThread(mWifiNative.getLocalLog()).start();
@@ -617,10 +623,17 @@ public class WifiMonitor {
}
}
- public synchronized void startMonitoring(String iface) {
+ /**
+ * Start Monitoring for wpa_supplicant events.
+ *
+ * @param iface Name of iface.
+ * @param isStaIface Whether STA or P2P iface.
+ * TODO: Add unit tests for these once we remove the legacy code.
+ */
+ public synchronized void startMonitoring(String iface, boolean isStaIface) {
Log.d(TAG, "startMonitoring(" + iface + ") with mConnected = " + mConnected);
- if (ensureConnectedLocked()) {
+ if (ensureConnectedLocked(isStaIface)) {
setMonitoring(iface, true);
broadcastSupplicantConnectionEvent(iface);
}