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

Commit 4dac9e89 authored by Chris Manton's avatar Chris Manton
Browse files

Check if stack down before caching scan result

Bug: 216287845
Tag: #refactor
Test: gd/cert/run

Change-Id: Ia4da605d406e63750f616d745f54e5fe63f5bffd
parent fa3e4cb6
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -494,6 +494,11 @@ bool BleScannerInterfaceImpl::parse_filter_command(
void BleScannerInterfaceImpl::handle_remote_properties(
    RawAddress bd_addr, tBLE_ADDR_TYPE addr_type,
    std::vector<uint8_t> advertising_data) {
  if (!bluetooth::shim::is_gd_stack_started_up()) {
    LOG_WARN("Gd stack is stopped, return");
    return;
  }

  // skip anonymous advertisment
  if (addr_type == BLE_ADDR_ANONYMOUS) {
    return;
@@ -541,11 +546,6 @@ void BleScannerInterfaceImpl::handle_remote_properties(
      }
    }
  }
  if (!bluetooth::shim::is_gd_stack_started_up()) {
    LOG_WARN("Gd stack is stopped, return");
    return;
  }

  auto* storage_module = bluetooth::shim::GetStorage();
  bluetooth::hci::Address address = ToGdAddress(bd_addr);