summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2017-04-13 02:51:13 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-04-13 02:51:13 +0000
commit676815948d9ce6adf17b8c28574712b4c382a8ac (patch)
tree006cf919a0e0e76fba033310192f5ede6bd6165f
parent6ac4be51565b2c0de7ee4928104692b19111910c (diff)
parent6abf3c0c866f93ca91c52559283d6ff33abdd295 (diff)
Merge changes Ie40bfecf,I26352317 into oc-dev
am: 6abf3c0c86 Change-Id: Ie020bfb9558f4d234f293121cecc47562a4e8790
-rw-r--r--service/java/com/android/server/wifi/SupplicantStaIfaceHal.java6
-rw-r--r--service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceCallback.java3
-rw-r--r--tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java7
-rw-r--r--tests/wifitests/src/com/android/server/wifi/p2p/SupplicantP2pIfaceCallbackTest.java7
4 files changed, 10 insertions, 13 deletions
diff --git a/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java b/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java
index f21c75490..9c9501b3b 100644
--- a/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java
+++ b/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java
@@ -1841,13 +1841,13 @@ public class SupplicantStaIfaceHal {
WifiSsid wifiSsid =
WifiSsid.createFromByteArray(NativeUtil.byteArrayFromArrayList(ssid));
String bssidStr = NativeUtil.macAddressFromByteArray(bssid);
- mWifiMonitor.broadcastSupplicantStateChangeEvent(
- mIfaceName, mFrameworkNetworkId, wifiSsid, bssidStr, newSupplicantState);
+ mStateIsFourway = (newState == ISupplicantStaIfaceCallback.State.FOURWAY_HANDSHAKE);
if (newSupplicantState == SupplicantState.COMPLETED) {
mWifiMonitor.broadcastNetworkConnectionEvent(
mIfaceName, mFrameworkNetworkId, bssidStr);
}
- mStateIsFourway = (newState == ISupplicantStaIfaceCallback.State.FOURWAY_HANDSHAKE);
+ mWifiMonitor.broadcastSupplicantStateChangeEvent(
+ mIfaceName, mFrameworkNetworkId, wifiSsid, bssidStr, newSupplicantState);
}
}
diff --git a/service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceCallback.java b/service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceCallback.java
index 836898d7f..5f4cb1773 100644
--- a/service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceCallback.java
+++ b/service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceCallback.java
@@ -271,7 +271,8 @@ public class SupplicantP2pIfaceCallback extends ISupplicantP2pIfaceCallback.Stub
group.setInterface(groupIfName);
try {
- group.setNetworkName(NativeUtil.encodeSsid(ssid));
+ String quotedSsid = NativeUtil.encodeSsid(ssid);
+ group.setNetworkName(NativeUtil.removeEnclosingQuotes(quotedSsid));
} catch (Exception e) {
Log.e(TAG, "Could not encode SSID.", e);
return;
diff --git a/tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java b/tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java
index f1897c8b2..74bdfa1c2 100644
--- a/tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java
@@ -898,6 +898,7 @@ public class SupplicantStaIfaceHalTest {
*/
@Test
public void testStateChangeToCompletedCallback() throws Exception {
+ InOrder wifiMonitorInOrder = inOrder(mWifiMonitor);
executeAndValidateInitializationSequence();
int frameworkNetworkId = 6;
executeAndValidateConnectSequence(frameworkNetworkId, false);
@@ -908,11 +909,11 @@ public class SupplicantStaIfaceHalTest {
NativeUtil.macAddressToByteArray(BSSID), SUPPLICANT_NETWORK_ID,
NativeUtil.decodeSsid(SUPPLICANT_SSID));
- verify(mWifiMonitor).broadcastSupplicantStateChangeEvent(
+ wifiMonitorInOrder.verify(mWifiMonitor).broadcastNetworkConnectionEvent(
+ eq(WLAN_IFACE_NAME), eq(frameworkNetworkId), eq(BSSID));
+ wifiMonitorInOrder.verify(mWifiMonitor).broadcastSupplicantStateChangeEvent(
eq(WLAN_IFACE_NAME), eq(frameworkNetworkId),
any(WifiSsid.class), eq(BSSID), eq(SupplicantState.COMPLETED));
- verify(mWifiMonitor).broadcastNetworkConnectionEvent(
- eq(WLAN_IFACE_NAME), eq(frameworkNetworkId), eq(BSSID));
}
/**
diff --git a/tests/wifitests/src/com/android/server/wifi/p2p/SupplicantP2pIfaceCallbackTest.java b/tests/wifitests/src/com/android/server/wifi/p2p/SupplicantP2pIfaceCallbackTest.java
index ff39a203e..ec1d43364 100644
--- a/tests/wifitests/src/com/android/server/wifi/p2p/SupplicantP2pIfaceCallbackTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/p2p/SupplicantP2pIfaceCallbackTest.java
@@ -18,12 +18,10 @@ package com.android.server.wifi.p2p;
import static org.junit.Assert.*;
import static org.mockito.Matchers.*;
import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
import android.app.test.MockAnswerUtil.AnswerWithArguments;
import android.hardware.wifi.supplicant.V1_0.ISupplicantP2pIfaceCallback;
@@ -33,15 +31,12 @@ import android.net.wifi.p2p.WifiP2pConfig;
import android.net.wifi.p2p.WifiP2pDevice;
import android.net.wifi.p2p.WifiP2pGroup;
import android.net.wifi.p2p.WifiP2pProvDiscEvent;
-import android.net.wifi.p2p.WifiP2pWfdInfo;
import org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
-import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import org.mockito.stubbing.Answer;
import java.util.ArrayList;
import java.util.HashSet;
@@ -295,7 +290,7 @@ public class SupplicantP2pIfaceCallbackTest {
add((byte)0x32);
add((byte)0x33);
}};
- String fakeSsidString = "\"0123\"";
+ String fakeSsidString = "0123";
HashSet<String> passwords = new HashSet<String>();
doAnswer(new AnswerWithArguments() {