diff options
author | Stan Rokita <srok@google.com> | 2020-06-09 05:28:42 -0700 |
---|---|---|
committer | Stan Rokita <srok@google.com> | 2020-06-09 05:28:42 -0700 |
commit | 138f1fff30eae4212d66ba7b1e85ec7c44164aae (patch) | |
tree | 7d0bfd09c6fb3083eef0781c7feb3da55511e3a9 | |
parent | 43db5c3525835bbe7a6e4961dc52fb8b38ce564e (diff) | |
download | chre-138f1fff30eae4212d66ba7b1e85ec7c44164aae.tar.gz |
missing break statements in handleEvent switch-case
This was causing async result events to be passed to handl scan result
method and all event were triggering unrecognized event log. The handle
scan result call that was passed the async result struct was
interpreting the resultTotal field to be = to 0 before. So now that that
is removed the logic handling that error can also be removed.
Bug: 154271547
Test: Run wifi cross val chqts test
Change-Id: I27b0efed852328d2731e240a2cd034416f219e8e
-rw-r--r-- | apps/test/common/chre_cross_validator_wifi/src/chre_cross_validator_wifi_manager.cc | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/apps/test/common/chre_cross_validator_wifi/src/chre_cross_validator_wifi_manager.cc b/apps/test/common/chre_cross_validator_wifi/src/chre_cross_validator_wifi_manager.cc index 60d6cccb..a57768d0 100644 --- a/apps/test/common/chre_cross_validator_wifi/src/chre_cross_validator_wifi_manager.cc +++ b/apps/test/common/chre_cross_validator_wifi/src/chre_cross_validator_wifi_manager.cc @@ -45,8 +45,10 @@ void Manager::handleEvent(uint32_t senderInstanceId, uint16_t eventType, break; case CHRE_EVENT_WIFI_ASYNC_RESULT: handleWifiAsyncResult(static_cast<const chreAsyncResult *>(eventData)); + break; case CHRE_EVENT_WIFI_SCAN_RESULT: handleWifiScanResult(static_cast<const chreWifiScanEvent *>(eventData)); + break; default: LOGE("Unknown message type %" PRIu16 "received when handling event", eventType); @@ -134,20 +136,15 @@ void Manager::handleDataMessage(const chreMessageFromHostData *hostData) { } void Manager::handleWifiScanResult(const chreWifiScanEvent *event) { - if (event->resultTotal == 0) { - // TODO: Find out why this happens and how to deal with it. - LOGD("event->resultTotal was 0. Ignoring this event."); - } else { - for (uint8_t i = 0; i < event->resultCount; i++) { - mChreScanResults[mChreScanResultsI++] = WifiScanResult(event->results[i]); - } - mNumResultsProcessed += event->resultCount; - if (mNumResultsProcessed >= event->resultTotal) { - mChreScanResultsSize = mChreScanResultsI; - mChreDataCollectionDone = true; - if (mApDataCollectionDone) { - compareAndSendResultToHost(); - } + for (uint8_t i = 0; i < event->resultCount; i++) { + mChreScanResults[mChreScanResultsI++] = WifiScanResult(event->results[i]); + } + mNumResultsProcessed += event->resultCount; + if (mNumResultsProcessed >= event->resultTotal) { + mChreScanResultsSize = mChreScanResultsI; + mChreDataCollectionDone = true; + if (mApDataCollectionDone) { + compareAndSendResultToHost(); } } } |