summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorNingyuan Wang <nywang@google.com>2017-03-02 13:33:12 -0800
committerNingyuan Wang <nywang@google.com>2017-03-12 05:19:22 +0000
commit05d51a2d8eb67ea2eaf4cae43280d1cf9fe92645 (patch)
treed8d06f612edf392df57beafbe8ddf14352b98852 /service
parent5a9f890485371054fb52dc7e17478d074ee2e856 (diff)
Rename SupplicantWifiScannerImpl to WificondScannerImpl
This also fixes a few formatting issues. Bug: 35707137 Test: compile, unit tests, integration test Change-Id: I1b6642b723c5676620d65136cc6c773b49e28559
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/scanner/HalWifiScannerImpl.java22
-rw-r--r--service/java/com/android/server/wifi/scanner/WifiScannerImpl.java2
-rw-r--r--service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java4
-rw-r--r--service/java/com/android/server/wifi/scanner/WificondScannerImpl.java (renamed from service/java/com/android/server/wifi/scanner/SupplicantWifiScannerImpl.java)33
4 files changed, 30 insertions, 31 deletions
diff --git a/service/java/com/android/server/wifi/scanner/HalWifiScannerImpl.java b/service/java/com/android/server/wifi/scanner/HalWifiScannerImpl.java
index 97c69382e..95528e252 100644
--- a/service/java/com/android/server/wifi/scanner/HalWifiScannerImpl.java
+++ b/service/java/com/android/server/wifi/scanner/HalWifiScannerImpl.java
@@ -29,7 +29,7 @@ import com.android.server.wifi.WifiNative;
/**
* WifiScanner implementation that takes advantage of the gscan HAL API
- * The gscan API is used to perform background scans and wpa_supplicant is used for onehot scans.
+ * The gscan API is used to perform background scans and wificond is used for oneshot scans.
* @see com.android.server.wifi.scanner.WifiScannerImpl for more details on each method.
*/
public class HalWifiScannerImpl extends WifiScannerImpl implements Handler.Callback {
@@ -38,15 +38,15 @@ public class HalWifiScannerImpl extends WifiScannerImpl implements Handler.Callb
private final WifiNative mWifiNative;
private final ChannelHelper mChannelHelper;
- private final SupplicantWifiScannerImpl mSupplicantScannerDelegate;
+ private final WificondScannerImpl mWificondScannerDelegate;
private final boolean mHalBasedPnoSupported;
public HalWifiScannerImpl(Context context, WifiNative wifiNative, WifiMonitor wifiMonitor,
Looper looper, Clock clock) {
mWifiNative = wifiNative;
mChannelHelper = new HalChannelHelper(wifiNative);
- mSupplicantScannerDelegate =
- new SupplicantWifiScannerImpl(context, wifiNative, wifiMonitor, mChannelHelper,
+ mWificondScannerDelegate =
+ new WificondScannerImpl(context, wifiNative, wifiMonitor, mChannelHelper,
looper, clock);
// We are not going to support HAL ePNO currently.
@@ -61,7 +61,7 @@ public class HalWifiScannerImpl extends WifiScannerImpl implements Handler.Callb
@Override
public void cleanup() {
- mSupplicantScannerDelegate.cleanup();
+ mWificondScannerDelegate.cleanup();
}
@Override
@@ -76,12 +76,12 @@ public class HalWifiScannerImpl extends WifiScannerImpl implements Handler.Callb
public boolean startSingleScan(WifiNative.ScanSettings settings,
WifiNative.ScanEventHandler eventHandler) {
- return mSupplicantScannerDelegate.startSingleScan(settings, eventHandler);
+ return mWificondScannerDelegate.startSingleScan(settings, eventHandler);
}
@Override
public WifiScanner.ScanData getLatestSingleScanResults() {
- return mSupplicantScannerDelegate.getLatestSingleScanResults();
+ return mWificondScannerDelegate.getLatestSingleScanResults();
}
@Override
@@ -121,7 +121,7 @@ public class HalWifiScannerImpl extends WifiScannerImpl implements Handler.Callb
if (mHalBasedPnoSupported) {
return mWifiNative.setPnoList(settings, eventHandler);
} else {
- return mSupplicantScannerDelegate.setHwPnoList(settings, eventHandler);
+ return mWificondScannerDelegate.setHwPnoList(settings, eventHandler);
}
}
@@ -130,7 +130,7 @@ public class HalWifiScannerImpl extends WifiScannerImpl implements Handler.Callb
if (mHalBasedPnoSupported) {
return mWifiNative.resetPnoList();
} else {
- return mSupplicantScannerDelegate.resetHwPnoList();
+ return mWificondScannerDelegate.resetHwPnoList();
}
}
@@ -139,7 +139,7 @@ public class HalWifiScannerImpl extends WifiScannerImpl implements Handler.Callb
if (mHalBasedPnoSupported) {
return true;
} else {
- return mSupplicantScannerDelegate.isHwPnoSupported(isConnectedPno);
+ return mWificondScannerDelegate.isHwPnoSupported(isConnectedPno);
}
}
@@ -148,7 +148,7 @@ public class HalWifiScannerImpl extends WifiScannerImpl implements Handler.Callb
if (mHalBasedPnoSupported) {
return true;
} else {
- return mSupplicantScannerDelegate.shouldScheduleBackgroundScanForHwPno();
+ return mWificondScannerDelegate.shouldScheduleBackgroundScanForHwPno();
}
}
diff --git a/service/java/com/android/server/wifi/scanner/WifiScannerImpl.java b/service/java/com/android/server/wifi/scanner/WifiScannerImpl.java
index e476f5a76..98e87902a 100644
--- a/service/java/com/android/server/wifi/scanner/WifiScannerImpl.java
+++ b/service/java/com/android/server/wifi/scanner/WifiScannerImpl.java
@@ -51,7 +51,7 @@ public abstract class WifiScannerImpl {
if (wifiNative.getScanCapabilities(new WifiNative.ScanCapabilities())) {
return new HalWifiScannerImpl(context, wifiNative, wifiMonitor, looper, clock);
} else {
- return new SupplicantWifiScannerImpl(context, wifiNative, wifiMonitor, looper,
+ return new WificondScannerImpl(context, wifiNative, wifiMonitor, looper,
clock);
}
}
diff --git a/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java b/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
index 7da5857f7..a9f4b49ba 100644
--- a/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
+++ b/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
@@ -1473,14 +1473,14 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub {
* 2. Move to |Started State| when we get the |WIFI_SCAN_AVAILABLE| broadcast from WifiManager.
* 3. When a new PNO scan request comes in:
* a.1. Switch to |Hw Pno Scan state| when the device supports HW PNO
- * (This could either be HAL based ePNO or supplicant based PNO).
+ * (This could either be HAL based ePNO or wificond based PNO).
* a.2. In |Hw Pno Scan state| when PNO scan results are received, check if the result
* contains IE (information elements). If yes, send the results to the client, else
* switch to |Single Scan state| and send the result to the client when the scan result
* is obtained.
* b.1. Switch to |Sw Pno Scan state| when the device does not supports HW PNO
* (This is for older devices which do not support HW PNO and for connected PNO on
- * devices which support supplicant based PNO)
+ * devices which support wificond based PNO)
* b.2. In |Sw Pno Scan state| send the result to the client when the background scan result
* is obtained
*
diff --git a/service/java/com/android/server/wifi/scanner/SupplicantWifiScannerImpl.java b/service/java/com/android/server/wifi/scanner/WificondScannerImpl.java
index 2f136fe42..3fd5be85e 100644
--- a/service/java/com/android/server/wifi/scanner/SupplicantWifiScannerImpl.java
+++ b/service/java/com/android/server/wifi/scanner/WificondScannerImpl.java
@@ -41,25 +41,22 @@ import java.util.List;
import java.util.Set;
/**
- * Implementation of the WifiScanner HAL API that uses wpa_supplicant to perform all scans
+ * Implementation of the WifiScanner HAL API that uses wificond to perform all scans
* @see com.android.server.wifi.scanner.WifiScannerImpl for more details on each method.
*/
-public class SupplicantWifiScannerImpl extends WifiScannerImpl implements Handler.Callback {
- private static final String TAG = "SupplicantWifiScannerImpl";
+public class WificondScannerImpl extends WifiScannerImpl implements Handler.Callback {
+ private static final String TAG = "WificondScannerImpl";
private static final boolean DBG = false;
public static final String BACKGROUND_PERIOD_ALARM_TAG = TAG + " Background Scan Period";
public static final String TIMEOUT_ALARM_TAG = TAG + " Scan Timeout";
- // Max number of networks that can be specified to wpa_supplicant per scan request
+ // Max number of networks that can be specified to wificond per scan request
public static final int MAX_HIDDEN_NETWORK_IDS_PER_SCAN = 16;
private static final int SCAN_BUFFER_CAPACITY = 10;
private static final int MAX_APS_PER_SCAN = 32;
private static final int MAX_SCAN_BUCKETS = 16;
- private static final String ACTION_SCAN_PERIOD =
- "com.android.server.util.SupplicantWifiScannerImpl.action.SCAN_PERIOD";
-
private final Context mContext;
private final WifiNative mWifiNative;
private final AlarmManager mAlarmManager;
@@ -130,7 +127,7 @@ public class SupplicantWifiScannerImpl extends WifiScannerImpl implements Handle
}
};
- public SupplicantWifiScannerImpl(Context context, WifiNative wifiNative,
+ public WificondScannerImpl(Context context, WifiNative wifiNative,
WifiMonitor wifiMonitor, ChannelHelper channelHelper,
Looper looper, Clock clock) {
mContext = context;
@@ -151,7 +148,7 @@ public class SupplicantWifiScannerImpl extends WifiScannerImpl implements Handle
WifiMonitor.SCAN_RESULTS_EVENT, mEventHandler);
}
- public SupplicantWifiScannerImpl(Context context, WifiNative wifiNative,
+ public WificondScannerImpl(Context context, WifiNative wifiNative,
WifiMonitor wifiMonitor, Looper looper, Clock clock) {
// TODO figure out how to get channel information from supplicant
this(context, wifiNative, wifiMonitor, new NoBandChannelHelper(), looper, clock);
@@ -249,7 +246,7 @@ public class SupplicantWifiScannerImpl extends WifiScannerImpl implements Handle
stopBatchedScan();
if (DBG) {
Log.d(TAG, "Starting scan num_buckets=" + settings.num_buckets + ", base_period="
- + settings.base_period_ms + " ms");
+ + settings.base_period_ms + " ms");
}
mPendingBackgroundScanSettings = settings;
mPendingBackgroundScanEventHandler = eventHandler;
@@ -324,7 +321,7 @@ public class SupplicantWifiScannerImpl extends WifiScannerImpl implements Handle
}
private void handleScanTimeout() {
- Log.e(TAG, "Timed out waiting for scan result from supplicant");
+ Log.e(TAG, "Timed out waiting for scan result from wificond");
reportScanFailure();
processPendingScans();
}
@@ -392,7 +389,8 @@ public class SupplicantWifiScannerImpl extends WifiScannerImpl implements Handle
mNextBackgroundScanPeriod++;
mBackgroundScanPeriodPending = false;
mAlarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,
- mClock.getElapsedSinceBootMillis() + mBackgroundScanSettings.base_period_ms,
+ mClock.getElapsedSinceBootMillis()
+ + mBackgroundScanSettings.base_period_ms,
BACKGROUND_PERIOD_ALARM_TAG, mScanPeriodListener, mEventHandler);
}
}
@@ -707,7 +705,7 @@ public class SupplicantWifiScannerImpl extends WifiScannerImpl implements Handle
}
mPnoEventHandler = eventHandler;
mPnoSettings = settings;
- // For supplicant based PNO, we start the scan immediately when we set pno list.
+ // For wificond based PNO, we start the scan immediately when we set pno list.
processPendingScans();
return true;
}
@@ -722,7 +720,7 @@ public class SupplicantWifiScannerImpl extends WifiScannerImpl implements Handle
}
mPnoEventHandler = null;
mPnoSettings = null;
- // For supplicant based PNO, we stop the scan immediately when we reset pno list.
+ // For wificond based PNO, we stop the scan immediately when we reset pno list.
stopHwPnoScan();
return true;
}
@@ -775,7 +773,7 @@ public class SupplicantWifiScannerImpl extends WifiScannerImpl implements Handle
private static class LastScanSettings {
public long startTime;
- public LastScanSettings(long startTime) {
+ LastScanSettings(long startTime) {
this.startTime = startTime;
}
@@ -830,7 +828,7 @@ public class SupplicantWifiScannerImpl extends WifiScannerImpl implements Handle
private final ArrayDeque<WifiScanner.ScanData> mBuffer;
private int mCapacity;
- public ScanBuffer(int capacity) {
+ ScanBuffer(int capacity) {
mCapacity = capacity;
mBuffer = new ArrayDeque<>(mCapacity);
}
@@ -1113,7 +1111,8 @@ public class SupplicantWifiScannerImpl extends WifiScannerImpl implements Handle
long alarmTimeout = MINIMUM_PNO_GAP_MS - timeDifference;
Log.d(TAG, "Start PNO timer with delay " + alarmTimeout);
mAlarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,
- mClock.getElapsedSinceBootMillis() + alarmTimeout, PNO_DEBOUNCER_ALARM_TAG,
+ mClock.getElapsedSinceBootMillis() + alarmTimeout,
+ PNO_DEBOUNCER_ALARM_TAG,
mAlarmListener, mEventHandler);
mWaitForTimer = true;
}