summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Wills <mwills@google.com>2016-03-17 23:09:00 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-03-17 23:09:00 +0000
commit71466f8b3cccbc46abad4f5b2d710fb22ce886cb (patch)
tree1c2b90b3e5d73c158729b39ee9d5b16e2cc0eafa
parenta24cf11dc36674056efef38be297eea40cc5761f (diff)
parent95984d1af44a00183a4b0e0ed61417583096ff90 (diff)
Merge "Merge MultiClientScheduler and WifiScanningScheduler" into nyc-dev
-rw-r--r--service/java/com/android/server/wifi/WifiScanningScheduler.java157
-rw-r--r--service/java/com/android/server/wifi/WifiScanningServiceImpl.java8
-rw-r--r--service/java/com/android/server/wifi/scanner/BackgroundScanScheduler.java (renamed from service/java/com/android/server/wifi/MultiClientScheduler.java)85
-rw-r--r--service/java/com/android/server/wifi/scanner/ScanScheduleUtil.java86
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiScanningServiceTest.java5
-rw-r--r--tests/wifitests/src/com/android/server/wifi/scanner/BackgroundScanSchedulerFilterTest.java (renamed from tests/wifitests/src/com/android/server/wifi/MultiClientSchedulerFilterTest.java)16
-rw-r--r--tests/wifitests/src/com/android/server/wifi/scanner/BackgroundScanSchedulerTest.java (renamed from tests/wifitests/src/com/android/server/wifi/MultiClientSchedulerTest.java)17
7 files changed, 182 insertions, 192 deletions
diff --git a/service/java/com/android/server/wifi/WifiScanningScheduler.java b/service/java/com/android/server/wifi/WifiScanningScheduler.java
index 744afd55c..e69de29bb 100644
--- a/service/java/com/android/server/wifi/WifiScanningScheduler.java
+++ b/service/java/com/android/server/wifi/WifiScanningScheduler.java
@@ -1,157 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-
-package com.android.server.wifi;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.net.wifi.ScanResult;
-import android.net.wifi.WifiScanner;
-
-import java.util.Collection;
-
-/**
- * A class to handle scheduling wifi scan requests into a format for the wifi chipsets.
- */
-public abstract class WifiScanningScheduler {
-
- static final int DEFAULT_MAX_BUCKETS = 8;
- static final int DEFAULT_MAX_CHANNELS = 32;
- // anecdotally, some chipsets will fail without explanation with a higher batch size, and
- // there is apparently no way to retrieve the maximum batch size
- static final int DEFAULT_MAX_SCANS_TO_BATCH = 10;
- static final int DEFAULT_MAX_AP_PER_SCAN = 32;
-
- private int mMaxBuckets = DEFAULT_MAX_BUCKETS;
- private int mMaxChannels = DEFAULT_MAX_CHANNELS;
- private int mMaxBatch = DEFAULT_MAX_SCANS_TO_BATCH;
- private int mMaxApPerScan = DEFAULT_MAX_AP_PER_SCAN;
-
- int getMaxBuckets() {
- return mMaxBuckets;
- }
-
- void setMaxBuckets(int maxBuckets) {
- mMaxBuckets = maxBuckets;
- }
-
- int getMaxChannels() {
- return mMaxChannels;
- }
-
- // TODO: find a way to get max channels
- void setMaxChannels(int maxChannels) {
- mMaxChannels = maxChannels;
- }
-
- int getMaxBatch() {
- return mMaxBatch;
- }
-
- // TODO: find a way to get max batch size
- void setMaxBatch(int maxBatch) {
- mMaxBatch = maxBatch;
- }
-
- int getMaxApPerScan() {
- return mMaxApPerScan;
- }
-
- void setMaxApPerScan(int maxApPerScan) {
- mMaxApPerScan = maxApPerScan;
- }
-
- /**
- * Updates the schedule from the given set of requests.
- */
- public abstract void updateSchedule(@NonNull Collection<WifiScanner.ScanSettings> requests);
-
- /**
- * Retrieves the current scanning schedule.
- */
- public abstract @NonNull WifiNative.ScanSettings getSchedule();
-
- /**
- * Returns true if the given scan result should be reported to a listener with the given
- * settings.
- */
- public abstract boolean shouldReportFullScanResultForSettings(
- @NonNull ScanResult result, @NonNull WifiScanner.ScanSettings settings);
-
- /**
- * Returns a filtered version of the scan results from the chip that represents only the data
- * requested in the settings. Will return null if the result should not be reported.
- */
- public abstract @Nullable WifiScanner.ScanData[] filterResultsForSettings(
- @NonNull WifiScanner.ScanData[] results, @NonNull WifiScanner.ScanSettings settings);
-
- /**
- * Compares two ChannelSettings for equality.
- */
- public static boolean channelEquals(@Nullable WifiNative.ChannelSettings channel1,
- @Nullable WifiNative.ChannelSettings channel2) {
- if (channel1 == null || channel2 == null) return false;
- if (channel1 == channel2) return true;
-
- if (channel1.frequency != channel2.frequency) return false;
- if (channel1.dwell_time_ms != channel2.dwell_time_ms) return false;
- return channel1.passive == channel2.passive;
- }
-
- /**
- * Compares two BucketSettings for equality.
- */
- public static boolean bucketEquals(@Nullable WifiNative.BucketSettings bucket1,
- @Nullable WifiNative.BucketSettings bucket2) {
- if (bucket1 == null || bucket2 == null) return false;
- if (bucket1 == bucket2) return true;
-
- if (bucket1.bucket != bucket2.bucket) return false;
- if (bucket1.band != bucket2.band) return false;
- if (bucket1.period_ms != bucket2.period_ms) return false;
- if (bucket1.report_events != bucket2.report_events) return false;
- if (bucket1.num_channels != bucket2.num_channels) return false;
- for (int c = 0; c < bucket1.num_channels; c++) {
- if (!channelEquals(bucket1.channels[c], bucket2.channels[c])) {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Compares two ScanSettings for equality.
- */
- public static boolean scheduleEquals(@Nullable WifiNative.ScanSettings schedule1,
- @Nullable WifiNative.ScanSettings schedule2) {
- if (schedule1 == null || schedule2 == null) return false;
- if (schedule1 == schedule2) return true;
-
- if (schedule1.base_period_ms != schedule2.base_period_ms) return false;
- if (schedule1.max_ap_per_scan != schedule2.max_ap_per_scan) return false;
- if (schedule1.report_threshold_percent != schedule2.report_threshold_percent) return false;
- if (schedule1.report_threshold_num_scans != schedule2.report_threshold_num_scans) return false;
- if (schedule1.num_buckets != schedule2.num_buckets) return false;
- for (int b = 0; b < schedule1.num_buckets; b++) {
- if (!bucketEquals(schedule1.buckets[b], schedule2.buckets[b])) {
- return false;
- }
- }
-
- return true;
- }
-}
diff --git a/service/java/com/android/server/wifi/WifiScanningServiceImpl.java b/service/java/com/android/server/wifi/WifiScanningServiceImpl.java
index cbfda4ec3..96a07bdb8 100644
--- a/service/java/com/android/server/wifi/WifiScanningServiceImpl.java
+++ b/service/java/com/android/server/wifi/WifiScanningServiceImpl.java
@@ -55,8 +55,10 @@ import com.android.internal.util.State;
import com.android.internal.util.StateMachine;
import com.android.internal.util.WakeupMessage;
+import com.android.server.wifi.scanner.BackgroundScanScheduler;
import com.android.server.wifi.scanner.ChannelHelper;
import com.android.server.wifi.scanner.ChannelHelper.ChannelCollection;
+import com.android.server.wifi.scanner.ScanScheduleUtil;
import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -236,7 +238,7 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub {
private final ArrayMap<Messenger, ClientInfo> mClients;
private ChannelHelper mChannelHelper;
- private WifiScanningScheduler mScheduler;
+ private BackgroundScanScheduler mScheduler;
private WifiNative.ScanSettings mPreviousSchedule;
private WifiBackgroundScanStateMachine mBackgroundScanStateMachine;
@@ -747,7 +749,7 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub {
mChannelHelper = mScannerImpl.getChannelHelper();
}
- mScheduler = new MultiClientScheduler(mChannelHelper);
+ mScheduler = new BackgroundScanScheduler(mChannelHelper);
WifiNative.ScanCapabilities capabilities =
new WifiNative.ScanCapabilities();
@@ -1297,7 +1299,7 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub {
mScheduler.updateSchedule(settings);
WifiNative.ScanSettings schedule = mScheduler.getSchedule();
- if (WifiScanningScheduler.scheduleEquals(mPreviousSchedule, schedule)) {
+ if (ScanScheduleUtil.scheduleEquals(mPreviousSchedule, schedule)) {
if (DBG) Log.d(TAG, "schedule updated with no change");
return true;
}
diff --git a/service/java/com/android/server/wifi/MultiClientScheduler.java b/service/java/com/android/server/wifi/scanner/BackgroundScanScheduler.java
index 31fbf64e4..1a6569fc8 100644
--- a/service/java/com/android/server/wifi/MultiClientScheduler.java
+++ b/service/java/com/android/server/wifi/scanner/BackgroundScanScheduler.java
@@ -11,10 +11,10 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License
+ * limitations under the License.
*/
-package com.android.server.wifi;
+package com.android.server.wifi.scanner;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -25,7 +25,7 @@ import android.net.wifi.WifiScanner.ScanSettings;
import android.util.Rational;
import android.util.Slog;
-import com.android.server.wifi.scanner.ChannelHelper;
+import com.android.server.wifi.WifiNative;
import com.android.server.wifi.scanner.ChannelHelper.ChannelCollection;
import java.util.ArrayList;
@@ -50,11 +50,18 @@ import java.util.List;
*
* <p>This class is not thread safe.</p>
*/
-public class MultiClientScheduler extends WifiScanningScheduler {
+public class BackgroundScanScheduler {
- private static final String TAG = WifiScanningService.TAG;
+ private static final String TAG = "BackgroundScanScheduler";
private static final boolean DBG = false;
+ public static final int DEFAULT_MAX_BUCKETS = 8;
+ public static final int DEFAULT_MAX_CHANNELS = 32;
+ // anecdotally, some chipsets will fail without explanation with a higher batch size, and
+ // there is apparently no way to retrieve the maximum batch size
+ public static final int DEFAULT_MAX_SCANS_TO_BATCH = 10;
+ public static final int DEFAULT_MAX_AP_PER_SCAN = 32;
+
/**
* Value that all scan periods must be an integer multiple of
*/
@@ -113,7 +120,7 @@ public class MultiClientScheduler extends WifiScanningScheduler {
public int period;
public final List<ScanSettings> settings = new ArrayList<>();
- public Bucket(int period) {
+ Bucket(int period) {
this.period = period;
}
@@ -191,7 +198,7 @@ public class MultiClientScheduler extends WifiScanningScheduler {
private final Bucket[] mBuckets;
private int mActiveBucketCount = 0;
- public BucketList() {
+ BucketList() {
mBuckets = new Bucket[PREDEFINED_BUCKET_PERIODS.length];
}
@@ -241,18 +248,59 @@ public class MultiClientScheduler extends WifiScanningScheduler {
}
}
+ private int mMaxBuckets = DEFAULT_MAX_BUCKETS;
+ private int mMaxChannels = DEFAULT_MAX_CHANNELS;
+ private int mMaxBatch = DEFAULT_MAX_SCANS_TO_BATCH;
+ private int mMaxApPerScan = DEFAULT_MAX_AP_PER_SCAN;
+
+ public int getMaxBuckets() {
+ return mMaxBuckets;
+ }
+
+ public void setMaxBuckets(int maxBuckets) {
+ mMaxBuckets = maxBuckets;
+ }
+
+ public int getMaxChannels() {
+ return mMaxChannels;
+ }
+
+ // TODO: find a way to get max channels
+ public void setMaxChannels(int maxChannels) {
+ mMaxChannels = maxChannels;
+ }
+
+ public int getMaxBatch() {
+ return mMaxBatch;
+ }
+
+ // TODO: find a way to get max batch size
+ public void setMaxBatch(int maxBatch) {
+ mMaxBatch = maxBatch;
+ }
+
+ public int getMaxApPerScan() {
+ return mMaxApPerScan;
+ }
+
+ public void setMaxApPerScan(int maxApPerScan) {
+ mMaxApPerScan = maxApPerScan;
+ }
+
private final BucketList mBuckets = new BucketList();
private final ChannelHelper mChannelHelper;
private final ChannelCollection mChannelCollection;
private WifiNative.ScanSettings mSchedule;
- public MultiClientScheduler(ChannelHelper channelHelper) {
+ public BackgroundScanScheduler(ChannelHelper channelHelper) {
mChannelHelper = channelHelper;
mChannelCollection = mChannelHelper.createChannelCollection();
mSchedule = createSchedule(Collections.<ScanSettings>emptyList());
}
- @Override
+ /**
+ * Updates the schedule from the given set of requests.
+ */
public void updateSchedule(@NonNull Collection<ScanSettings> requests) {
// create initial schedule
mBuckets.clearAll();
@@ -265,18 +313,26 @@ public class MultiClientScheduler extends WifiScanningScheduler {
mSchedule = createSchedule(requests);
}
- @Override
+ /**
+ * Retrieves the current scanning schedule.
+ */
public @NonNull WifiNative.ScanSettings getSchedule() {
return mSchedule;
}
- @Override
+ /**
+ * Returns true if the given scan result should be reported to a listener with the given
+ * settings.
+ */
public boolean shouldReportFullScanResultForSettings(@NonNull ScanResult result,
@NonNull ScanSettings settings) {
return mChannelHelper.settingsContainChannel(settings, result.frequency);
}
- @Override
+ /**
+ * Returns a filtered version of the scan results from the chip that represents only the data
+ * requested in the settings. Will return null if the result should not be reported.
+ */
public @Nullable ScanData[] filterResultsForSettings(@NonNull ScanData[] scanDatas,
@NonNull ScanSettings settings) {
ArrayList<ScanData> filteredScanDatas = new ArrayList<>(scanDatas.length);
@@ -379,7 +435,10 @@ public class MultiClientScheduler extends WifiScanningScheduler {
return schedule;
}
- public void addScanToBuckets(ScanSettings settings) {
+ /**
+ * Add a scan to the most appropriate bucket, creating the bucket if necessary.
+ */
+ private void addScanToBuckets(ScanSettings settings) {
int bucketIndex;
if (settings.maxPeriodInMs != 0
diff --git a/service/java/com/android/server/wifi/scanner/ScanScheduleUtil.java b/service/java/com/android/server/wifi/scanner/ScanScheduleUtil.java
new file mode 100644
index 000000000..734a190ef
--- /dev/null
+++ b/service/java/com/android/server/wifi/scanner/ScanScheduleUtil.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.wifi.scanner;
+
+import android.annotation.Nullable;
+
+import com.android.server.wifi.WifiNative;
+
+/**
+ * A class with utilities for dealing with scan schedules.
+ */
+public class ScanScheduleUtil {
+
+ /**
+ * Compares two ChannelSettings for equality.
+ */
+ public static boolean channelEquals(@Nullable WifiNative.ChannelSettings channel1,
+ @Nullable WifiNative.ChannelSettings channel2) {
+ if (channel1 == null || channel2 == null) return false;
+ if (channel1 == channel2) return true;
+
+ if (channel1.frequency != channel2.frequency) return false;
+ if (channel1.dwell_time_ms != channel2.dwell_time_ms) return false;
+ return channel1.passive == channel2.passive;
+ }
+
+ /**
+ * Compares two BucketSettings for equality.
+ */
+ public static boolean bucketEquals(@Nullable WifiNative.BucketSettings bucket1,
+ @Nullable WifiNative.BucketSettings bucket2) {
+ if (bucket1 == null || bucket2 == null) return false;
+ if (bucket1 == bucket2) return true;
+
+ if (bucket1.bucket != bucket2.bucket) return false;
+ if (bucket1.band != bucket2.band) return false;
+ if (bucket1.period_ms != bucket2.period_ms) return false;
+ if (bucket1.report_events != bucket2.report_events) return false;
+ if (bucket1.num_channels != bucket2.num_channels) return false;
+ for (int c = 0; c < bucket1.num_channels; c++) {
+ if (!channelEquals(bucket1.channels[c], bucket2.channels[c])) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Compares two ScanSettings for equality.
+ */
+ public static boolean scheduleEquals(@Nullable WifiNative.ScanSettings schedule1,
+ @Nullable WifiNative.ScanSettings schedule2) {
+ if (schedule1 == null || schedule2 == null) return false;
+ if (schedule1 == schedule2) return true;
+
+ if (schedule1.base_period_ms != schedule2.base_period_ms) return false;
+ if (schedule1.max_ap_per_scan != schedule2.max_ap_per_scan) return false;
+ if (schedule1.report_threshold_percent != schedule2.report_threshold_percent) return false;
+ if (schedule1.report_threshold_num_scans != schedule2.report_threshold_num_scans) {
+ return false;
+ }
+ if (schedule1.num_buckets != schedule2.num_buckets) return false;
+ for (int b = 0; b < schedule1.num_buckets; b++) {
+ if (!bucketEquals(schedule1.buckets[b], schedule2.buckets[b])) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiScanningServiceTest.java b/tests/wifitests/src/com/android/server/wifi/WifiScanningServiceTest.java
index 3d4055a52..7d6982238 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiScanningServiceTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiScanningServiceTest.java
@@ -50,6 +50,7 @@ import android.test.suitebuilder.annotation.SmallTest;
import com.android.internal.app.IBatteryStats;
import com.android.internal.util.Protocol;
import com.android.server.wifi.MockAnswerUtil.AnswerWithArguments;
+import com.android.server.wifi.scanner.BackgroundScanScheduler;
import com.android.server.wifi.scanner.ChannelHelper;
import com.android.server.wifi.scanner.PresetKnownBandsChannelHelper;
@@ -685,7 +686,7 @@ public class WifiScanningServiceTest {
WifiNative.ScanSettings nativeSettings = new NativeScanSettingsBuilder()
.withBasePeriod(20000)
.withMaxApPerScan(MAX_AP_PER_SCAN)
- .withMaxScansToCache(WifiScanningScheduler.DEFAULT_MAX_SCANS_TO_BATCH)
+ .withMaxScansToCache(BackgroundScanScheduler.DEFAULT_MAX_SCANS_TO_BATCH)
.addBucketWithBand(20000, WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN,
WifiScanner.WIFI_BAND_BOTH)
.build();
@@ -702,7 +703,7 @@ public class WifiScanningServiceTest {
WifiNative.ScanSettings nativeSettings = new NativeScanSettingsBuilder()
.withBasePeriod(20000)
.withMaxApPerScan(MAX_AP_PER_SCAN)
- .withMaxScansToCache(WifiScanningScheduler.DEFAULT_MAX_SCANS_TO_BATCH)
+ .withMaxScansToCache(BackgroundScanScheduler.DEFAULT_MAX_SCANS_TO_BATCH)
.addBucketWithChannels(20000, WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN, 5150)
.build();
doSuccessfulBackgroundScan(requestSettings, nativeSettings);
diff --git a/tests/wifitests/src/com/android/server/wifi/MultiClientSchedulerFilterTest.java b/tests/wifitests/src/com/android/server/wifi/scanner/BackgroundScanSchedulerFilterTest.java
index 3c539ed8f..65fe7bd7c 100644
--- a/tests/wifitests/src/com/android/server/wifi/MultiClientSchedulerFilterTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/scanner/BackgroundScanSchedulerFilterTest.java
@@ -11,10 +11,10 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License
+ * limitations under the License.
*/
-package com.android.server.wifi;
+package com.android.server.wifi.scanner;
import static com.android.server.wifi.ScanTestUtil.channelsToSpec;
import static com.android.server.wifi.ScanTestUtil.createRequest;
@@ -33,8 +33,7 @@ import android.net.wifi.WifiScanner.ScanData;
import android.net.wifi.WifiScanner.ScanSettings;
import android.test.suitebuilder.annotation.SmallTest;
-import com.android.server.wifi.scanner.ChannelHelper;
-import com.android.server.wifi.scanner.PresetKnownBandsChannelHelper;
+import com.android.server.wifi.WifiNative;
import org.junit.After;
import org.junit.Before;
@@ -44,17 +43,18 @@ import java.util.Collection;
import java.util.Collections;
/**
- * Unit tests for filtering of scan results in {@link com.android.server.wifi.MultiClientScheduler}.
+ * Unit tests for filtering of scan results in
+ * {@link com.android.server.wifi.scanner.BackgroundScanScheduler}.
*/
@SmallTest
-public class MultiClientSchedulerFilterTest {
+public class BackgroundScanSchedulerFilterTest {
private static final int DEFAULT_MAX_BUCKETS = 8;
private static final int DEFAULT_MAX_CHANNELS = 8;
private static final int DEFAULT_MAX_BATCH = 10;
private WifiNative mWifiNative;
- private MultiClientScheduler mScheduler;
+ private BackgroundScanScheduler mScheduler;
@Before
public void setUp() throws Exception {
@@ -62,7 +62,7 @@ public class MultiClientSchedulerFilterTest {
new int[]{2400, 2450},
new int[]{5150, 5175},
new int[]{5600, 5650});
- mScheduler = new MultiClientScheduler(channelHelper);
+ mScheduler = new BackgroundScanScheduler(channelHelper);
mScheduler.setMaxBuckets(DEFAULT_MAX_BUCKETS);
mScheduler.setMaxChannels(DEFAULT_MAX_CHANNELS);
mScheduler.setMaxBatch(DEFAULT_MAX_BATCH);
diff --git a/tests/wifitests/src/com/android/server/wifi/MultiClientSchedulerTest.java b/tests/wifitests/src/com/android/server/wifi/scanner/BackgroundScanSchedulerTest.java
index 86db34cb6..b3abbafad 100644
--- a/tests/wifitests/src/com/android/server/wifi/MultiClientSchedulerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/scanner/BackgroundScanSchedulerTest.java
@@ -11,10 +11,10 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License
+ * limitations under the License.
*/
-package com.android.server.wifi;
+package com.android.server.wifi.scanner;
import static com.android.server.wifi.ScanTestUtil.NativeScanSettingsBuilder;
import static com.android.server.wifi.ScanTestUtil.assertNativeScanSettingsEquals;
@@ -30,10 +30,9 @@ import android.net.wifi.WifiScanner;
import android.net.wifi.WifiScanner.ScanSettings;
import android.test.suitebuilder.annotation.SmallTest;
+import com.android.server.wifi.WifiNative;
import com.android.server.wifi.WifiNative.BucketSettings;
-import com.android.server.wifi.scanner.KnownBandsChannelHelper;
import com.android.server.wifi.scanner.KnownBandsChannelHelper.KnownBandsChannelCollection;
-import com.android.server.wifi.scanner.PresetKnownBandsChannelHelper;
import org.junit.After;
import org.junit.Before;
@@ -46,10 +45,10 @@ import java.util.Collections;
import java.util.Set;
/**
- * Unit tests for {@link com.android.server.wifi.MultiClientScheduler}.
+ * Unit tests for {@link com.android.server.wifi.scanner.BackgroundScanScheduler}.
*/
@SmallTest
-public class MultiClientSchedulerTest {
+public class BackgroundScanSchedulerTest {
private static final int DEFAULT_MAX_BUCKETS = 9;
private static final int DEFAULT_MAX_CHANNELS = 23;
@@ -57,7 +56,7 @@ public class MultiClientSchedulerTest {
private static final int DEFAULT_MAX_AP_PER_SCAN = 33;
private KnownBandsChannelHelper mChannelHelper;
- private MultiClientScheduler mScheduler;
+ private BackgroundScanScheduler mScheduler;
@Before
public void setUp() throws Exception {
@@ -65,7 +64,7 @@ public class MultiClientSchedulerTest {
new int[]{2400, 2450},
new int[]{5150, 5175},
new int[]{5600, 5650, 5660});
- mScheduler = new MultiClientScheduler(mChannelHelper);
+ mScheduler = new BackgroundScanScheduler(mChannelHelper);
mScheduler.setMaxBuckets(DEFAULT_MAX_BUCKETS);
mScheduler.setMaxChannels(DEFAULT_MAX_CHANNELS);
mScheduler.setMaxBatch(DEFAULT_MAX_BATCH);
@@ -613,7 +612,7 @@ public class MultiClientSchedulerTest {
private static int[] getPredefinedBuckets() {
try {
- Field f = MultiClientScheduler.class.getDeclaredField("PREDEFINED_BUCKET_PERIODS");
+ Field f = BackgroundScanScheduler.class.getDeclaredField("PREDEFINED_BUCKET_PERIODS");
f.setAccessible(true);
return (int[]) f.get(null);
} catch (Exception e) {