return Status::ok();
}
+Status ScannerImpl::abortScan() {
+ if (!CheckIsValid()) {
+ return Status::ok();
+ }
+
+ if (!scan_started_) {
+ LOG(WARNING) << "Scan is not started. Ignore abort request";
+ return Status::ok();
+ }
+ if (!scan_utils_->AbortScan(interface_index_)) {
+ LOG(WARNING) << "Abort scan failed";
+ }
+ return Status::ok();
+}
+
Status ScannerImpl::subscribeScanEvents(const sp<IScanEvent>& handler) {
if (!CheckIsValid()) {
return Status::ok();
bool aborted,
vector<vector<uint8_t>>& ssids,
vector<uint32_t>& frequencies) {
- LOG(INFO) << "Received scan result notification from kernel.";
+ if (!scan_started_) {
+ LOG(INFO) << "Received external scan result notification from kernel.";
+ }
scan_started_ = false;
if (scan_event_handler_ != nullptr) {
// TODO: Pass other parameters back once we find framework needs them.
if (aborted) {
LOG(WARNING) << "Scan aborted";
- // TODO(b/36231150): Only plumb through scan aborted event when
- // we make sure WificondScanner.java won't cause a tight loop.
- // scan_event_handler_->OnScanFailed();
+ scan_event_handler_->OnScanFailed();
} else {
scan_event_handler_->OnScanResultReady();
}
bool scan_stopped) {
if (pno_scan_event_handler_ != nullptr) {
if (scan_stopped) {
- LOG(INFO) << "Pno scan stopped event";
// If |pno_scan_started_| is false.
// This stop notification might result from our own request.
// See the document for NL80211_CMD_SCHED_SCAN_STOPPED in nl80211.h.
if (pno_scan_started_) {
+ LOG(WARNING) << "Unexpected pno scan stopped event";
pno_scan_event_handler_->OnPnoScanFailed();
}
pno_scan_started_ = false;