Loading system/main/shim/le_scanning_manager.cc +7 −2 Original line number Diff line number Diff line Loading @@ -162,14 +162,15 @@ void BleScannerInterfaceImpl::Unregister(int scanner_id) { void BleScannerInterfaceImpl::Scan(bool start) { LOG(INFO) << __func__ << " in shim layer " << ((start) ? "started" : "stopped"); bluetooth::shim::GetScanning()->Scan(start); if (start) { if (start && !btm_cb.ble_ctr_cb.is_ble_observe_active()) { btm_cb.neighbor.le_scan = { .start_time_ms = timestamper_in_milliseconds.GetTimestamp(), .results = 0, }; BTM_LogHistory(kBtmLogTag, RawAddress::kEmpty, "Le scan started"); btm_cb.ble_ctr_cb.set_ble_observe_active(); } else { // stopped } else if (!start && btm_cb.ble_ctr_cb.is_ble_observe_active()) { // stopped const unsigned long long duration_timestamp = timestamper_in_milliseconds.GetTimestamp() - btm_cb.neighbor.le_scan.start_time_ms; Loading @@ -179,6 +180,10 @@ void BleScannerInterfaceImpl::Scan(bool start) { btm_cb.neighbor.le_scan.results)); btm_cb.ble_ctr_cb.reset_ble_observe(); btm_cb.neighbor.le_scan = {}; } else { LOG_WARN("Invalid state: start:%d, current scan state: %d", start, btm_cb.ble_ctr_cb.is_ble_observe_active()); return; } do_in_jni_thread(FROM_HERE, Loading Loading
system/main/shim/le_scanning_manager.cc +7 −2 Original line number Diff line number Diff line Loading @@ -162,14 +162,15 @@ void BleScannerInterfaceImpl::Unregister(int scanner_id) { void BleScannerInterfaceImpl::Scan(bool start) { LOG(INFO) << __func__ << " in shim layer " << ((start) ? "started" : "stopped"); bluetooth::shim::GetScanning()->Scan(start); if (start) { if (start && !btm_cb.ble_ctr_cb.is_ble_observe_active()) { btm_cb.neighbor.le_scan = { .start_time_ms = timestamper_in_milliseconds.GetTimestamp(), .results = 0, }; BTM_LogHistory(kBtmLogTag, RawAddress::kEmpty, "Le scan started"); btm_cb.ble_ctr_cb.set_ble_observe_active(); } else { // stopped } else if (!start && btm_cb.ble_ctr_cb.is_ble_observe_active()) { // stopped const unsigned long long duration_timestamp = timestamper_in_milliseconds.GetTimestamp() - btm_cb.neighbor.le_scan.start_time_ms; Loading @@ -179,6 +180,10 @@ void BleScannerInterfaceImpl::Scan(bool start) { btm_cb.neighbor.le_scan.results)); btm_cb.ble_ctr_cb.reset_ble_observe(); btm_cb.neighbor.le_scan = {}; } else { LOG_WARN("Invalid state: start:%d, current scan state: %d", start, btm_cb.ble_ctr_cb.is_ble_observe_active()); return; } do_in_jni_thread(FROM_HERE, Loading