summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2017-08-03 00:22:42 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-08-03 00:22:42 +0000
commit6ff9b60d474d928e6258a8c54b92c56321e6b74e (patch)
tree0134b6455c4bd04d122d0e6b400d68b095a7d6e9 /tests
parentcdd37192567ccf51d78dd13ffd72ab1c19363869 (diff)
parenta49af7fd6bf5d51ef7c34fbf2d71ee10c0f7d1dd (diff)
Merge "WifiStateMachine: Always return a copy of WifiInfo" into oc-mr1-dev
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
index 631ec3f4c..7d9f6e655 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
@@ -1791,20 +1791,30 @@ public class WifiStateMachineTest {
}
/**
- * Test that the process uid has full wifiInfo access
+ * Test that the process uid has full wifiInfo access.
+ * Also tests that {@link WifiStateMachine#syncRequestConnectionInfo()} always
+ * returns a copy of WifiInfo.
*/
@Test
public void testConnectedIdsAreVisibleFromOwnUid() throws Exception {
assertEquals(Process.myUid(), Binder.getCallingUid());
WifiInfo wifiInfo = mWsm.getWifiInfo();
+ wifiInfo.setBSSID(sBSSID);
+ wifiInfo.setSSID(WifiSsid.createFromAsciiEncoded(sSSID));
+
connect();
WifiInfo connectionInfo = mWsm.syncRequestConnectionInfo();
- assertEquals(wifiInfo, connectionInfo);
+
+ assertNotEquals(wifiInfo, connectionInfo);
+ assertEquals(wifiInfo.getSSID(), connectionInfo.getSSID());
+ assertEquals(wifiInfo.getBSSID(), connectionInfo.getBSSID());
}
/**
* Test that connected SSID and BSSID are not exposed to an app that does not have the
* appropriate permissions.
+ * Also tests that {@link WifiStateMachine#syncRequestConnectionInfo()} always
+ * returns a copy of WifiInfo.
*/
@Test
public void testConnectedIdsAreHiddenFromRandomApp() throws Exception {
@@ -1836,6 +1846,8 @@ public class WifiStateMachineTest {
/**
* Test that connected SSID and BSSID are not exposed to an app that does not have the
* appropriate permissions, when canAccessScanResults raises a SecurityException.
+ * Also tests that {@link WifiStateMachine#syncRequestConnectionInfo()} always
+ * returns a copy of WifiInfo.
*/
@Test
public void testConnectedIdsAreHiddenOnSecurityException() throws Exception {