summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2018-05-01 13:59:06 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-05-01 13:59:06 -0700
commit22a9c74b0652ae31131a69bb96dab6a321a4d9fc (patch)
tree90868ae7310dccfafac1fe4354562ba43ceec5b1 /tests
parented094e0de54afdfae423ddf63d653c5af2f385ae (diff)
parentd47fd3791387eded068f6554c0dfdaa0ee5ceef2 (diff)
WifiServiceImpl: Additional permission checks for startScan
am: d47fd37913 Change-Id: I91774f7a8d0c9899a160e88200e38c88943f6b4f
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
index f64ce59e5..46b29a46b 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
@@ -1038,6 +1038,18 @@ public class WifiServiceImplTest {
}
/**
+ * Ensure that we handle scan access permission check failure when handling scan request.
+ */
+ @Test
+ public void testStartScanFailureInCanAccessScanResultsPermission() {
+ setupWifiStateMachineHandlerForRunWithScissors();
+ doThrow(new SecurityException()).when(mWifiPermissionsUtil)
+ .enforceCanAccessScanResults(SCAN_PACKAGE_NAME, Process.myUid());
+ assertFalse(mWifiServiceImpl.startScan(SCAN_PACKAGE_NAME));
+ verify(mScanRequestProxy, never()).startScan(Process.myUid(), SCAN_PACKAGE_NAME);
+ }
+
+ /**
* Ensure that we handle scan request failure when posting the runnable to handler fails.
*/
@Ignore