summaryrefslogtreecommitdiffstats
path: root/tests/wifitests/src/com/android/server/wifi/scanner
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2018-01-03 13:48:46 +0000
committerNarayan Kamath <narayan@google.com>2018-01-04 14:45:05 +0000
commitad76b6bd7bc84504b71da1f85ffa640fecf89630 (patch)
tree139823a8ce807572fbe60cbc5116fe5e357918b5 /tests/wifitests/src/com/android/server/wifi/scanner
parentfd828776e37a5a8405a9ce0d4175d7971efbedcd (diff)
downloadandroid_frameworks_opt_net_wifi-ad76b6bd7bc84504b71da1f85ffa640fecf89630.tar.gz
android_frameworks_opt_net_wifi-ad76b6bd7bc84504b71da1f85ffa640fecf89630.tar.bz2
android_frameworks_opt_net_wifi-ad76b6bd7bc84504b71da1f85ffa640fecf89630.zip
WifiScanningServiceImpl: Simplify and fix computeWorkSource.
Use WorkSource.isEmpty instead of WorkSource.size to account for chained work sources. Also fix a bogus UID check and simplify the logic for rejecting invalid WorkSources. Also add a smoke test to the unit test to make sure chained worksources are handled correctly. Test: WifiScanningServiceTest Bug: 62390666 Change-Id: I236f9ed5b0863ab45bb04cbf6c79137688257453
Diffstat (limited to 'tests/wifitests/src/com/android/server/wifi/scanner')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java b/tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java
index b151af14d..9cb2992c9 100644
--- a/tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java
@@ -1099,7 +1099,10 @@ public class WifiScanningServiceTest {
WifiScanner.ScanSettings requestSettings3 = createRequest(channelsToSpec(5150), 0,
0, 20, WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN);
int requestId3 = 15;
- WorkSource workSource3 = new WorkSource(2292);
+ // Let one of the WorkSources be a chained workSource.
+ WorkSource workSource3 = new WorkSource();
+ workSource3.createWorkChain()
+ .addNode(2292, "tag1");
ScanResults results3 = ScanResults.create(0, false, 5150, 5150, 5150, 5150);
WifiNative.ScanSettings nativeSettings2and3 = createSingleScanNativeSettingsForChannels(