Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 02de23fb authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

BTM: Properly merge LE scan from BTIF and CSIS

If CSIS scan is added while BTIF is scanning, we would return error code
that shuts down both scans in BTA layer.
This code would instead keep both scans running. We would ingore the
duration CSIS passes, assuming whoever started the scan, will not shut
it down instantly.

Bug: 273958309
Test: connect to CSIS device while some app in Java is doing scan
Change-Id: Ibb22e2722d558be49523a9b159267114b8971d47
parent 800ea4b4
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -536,11 +536,16 @@ tBTM_STATUS BTM_BleObserve(bool start, uint8_t duration,
      if (duration == 0) {
        if (alarm_is_scheduled(btm_cb.ble_ctr_cb.observer_timer)) {
          alarm_cancel(btm_cb.ble_ctr_cb.observer_timer);
          return BTM_CMD_STARTED;
        } else {
          BTM_TRACE_ERROR("%s Scan with no duration started twice!", __func__);
        }
      } else {
        if (alarm_is_scheduled(btm_cb.ble_ctr_cb.observer_timer)) {
          BTM_TRACE_ERROR("%s Scan with duration started twice!", __func__);
        }
      BTM_TRACE_ERROR("%s Observe Already Active", __func__);
      return status;
      }
      BTM_TRACE_WARNING("%s Observer was already active", __func__);
      return BTM_CMD_STARTED;
    }

    btm_cb.ble_ctr_cb.p_obs_results_cb = p_results_cb;