summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2017-03-21 21:36:45 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-03-21 21:36:46 +0000
commit168fba718720b54cf0a88cfad7f96948925fb1e3 (patch)
tree0d80f9127c3c8ef5e0700859ec30692b6c58b452 /service
parent8e048dfa149e15cd7e0baf0d10ff4358e79e0dca (diff)
parent35c9c7f7a2f83d81b8d61da834b3960f5b9ffe19 (diff)
Merge "SupplicantStaIfaceHal: Broadcast bssid change event"
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/SupplicantStaIfaceHal.java19
-rw-r--r--service/java/com/android/server/wifi/WifiMonitor.java14
2 files changed, 28 insertions, 5 deletions
diff --git a/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java b/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java
index 8308b4c0d..0fdcebe7e 100644
--- a/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java
+++ b/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java
@@ -32,6 +32,7 @@ import android.hardware.wifi.supplicant.V1_0.ISupplicantIface;
import android.hardware.wifi.supplicant.V1_0.ISupplicantNetwork;
import android.hardware.wifi.supplicant.V1_0.ISupplicantStaIface;
import android.hardware.wifi.supplicant.V1_0.ISupplicantStaIfaceCallback;
+import android.hardware.wifi.supplicant.V1_0.ISupplicantStaIfaceCallback.BssidChangeReason;
import android.hardware.wifi.supplicant.V1_0.ISupplicantStaNetwork;
import android.hardware.wifi.supplicant.V1_0.IfaceType;
import android.hardware.wifi.supplicant.V1_0.SupplicantStatus;
@@ -1753,9 +1754,7 @@ public class SupplicantStaIfaceHal {
String bssidStr = NativeUtil.macAddressFromByteArray(bssid);
mWifiMonitor.broadcastSupplicantStateChangeEvent(
mIfaceName, mFrameworkNetworkId, wifiSsid, bssidStr, newSupplicantState);
- if (newSupplicantState == SupplicantState.ASSOCIATED) {
- mWifiMonitor.broadcastAssociationSuccesfulEvent(mIfaceName, bssidStr);
- } else if (newSupplicantState == SupplicantState.COMPLETED) {
+ if (newSupplicantState == SupplicantState.COMPLETED) {
mWifiMonitor.broadcastNetworkConnectionEvent(
mIfaceName, mFrameworkNetworkId, bssidStr);
}
@@ -1859,6 +1858,20 @@ public class SupplicantStaIfaceHal {
}
@Override
+ public void onBssidChanged(byte reason, byte[/* 6 */] bssid) {
+ logCallback("onBssidChanged");
+ synchronized (mLock) {
+ if (reason == BssidChangeReason.ASSOC_START) {
+ mWifiMonitor.broadcastTargetBssidEvent(
+ mIfaceName, NativeUtil.macAddressFromByteArray(bssid));
+ } else if (reason == BssidChangeReason.ASSOC_COMPLETE) {
+ mWifiMonitor.broadcastAssociatedBssidEvent(
+ mIfaceName, NativeUtil.macAddressFromByteArray(bssid));
+ }
+ }
+ }
+
+ @Override
public void onEapFailure() {
logCallback("onEapFailure");
synchronized (mLock) {
diff --git a/service/java/com/android/server/wifi/WifiMonitor.java b/service/java/com/android/server/wifi/WifiMonitor.java
index 317d3991c..15ec8fd77 100644
--- a/service/java/com/android/server/wifi/WifiMonitor.java
+++ b/service/java/com/android/server/wifi/WifiMonitor.java
@@ -499,13 +499,23 @@ public class WifiMonitor {
* Broadcast the association success event to all the handlers registered for this event.
*
* @param iface Name of iface on which this occurred.
- * @param bssid BSSID of the access point from which we received the reject.
+ * @param bssid BSSID of the access point.
*/
- public void broadcastAssociationSuccesfulEvent(String iface, String bssid) {
+ public void broadcastAssociatedBssidEvent(String iface, String bssid) {
sendMessage(iface, WifiStateMachine.CMD_ASSOCIATED_BSSID, 0, 0, bssid);
}
/**
+ * Broadcast the start of association event to all the handlers registered for this event.
+ *
+ * @param iface Name of iface on which this occurred.
+ * @param bssid BSSID of the access point.
+ */
+ public void broadcastTargetBssidEvent(String iface, String bssid) {
+ sendMessage(iface, WifiStateMachine.CMD_TARGET_BSSID, 0, 0, bssid);
+ }
+
+ /**
* Broadcast the network connection event to all the handlers registered for this event.
*
* @param iface Name of iface on which this occurred.