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

Commit 90cf86b8 authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

btm_history: Log start and stop le advertising am: a8020441

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1890296

Change-Id: I3a08af3985d029d0c0efc95d3526e485d0975948
parents 58a731d6 a8020441
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@

#include "le_advertising_manager.h"

#include <base/logging.h>
#include <hardware/bluetooth.h>
#include <hardware/bt_gatt.h>

@@ -34,10 +35,9 @@
#include "main/shim/helpers.h"
#include "stack/include/ble_advertiser.h"
#include "stack/include/btm_api.h"
#include "stack/include/btm_log_history.h"
#include "types/raw_address.h"

#include <base/logging.h>

using bluetooth::hci::Address;
using bluetooth::hci::AddressType;
using bluetooth::hci::ErrorCode;
@@ -45,6 +45,10 @@ using bluetooth::hci::GapData;
using bluetooth::hci::OwnAddressType;
using std::vector;

namespace {
constexpr char kBtmLogTag[] = "ADV";
}

class BleAdvertiserInterfaceImpl : public BleAdvertiserInterface,
                                   public bluetooth::hci::AdvertisingCallback {
 public:
@@ -63,6 +67,8 @@ class BleAdvertiserInterfaceImpl : public BleAdvertiserInterface,
  void Unregister(uint8_t advertiser_id) override {
    LOG(INFO) << __func__ << " in shim layer";
    bluetooth::shim::GetAdvertising()->RemoveAdvertiser(advertiser_id);
    BTM_LogHistory(kBtmLogTag, RawAddress::kEmpty, "Le advert stopped",
                   base::StringPrintf("advert_id:%d", advertiser_id));
  }

  void GetOwnAddress(uint8_t advertiser_id, GetAddressCallback cb) override {
@@ -187,6 +193,9 @@ class BleAdvertiserInterfaceImpl : public BleAdvertiserInterface,

    LOG(INFO) << "create advertising set, reg_id:" << reg_id
              << ", id:" << (uint16_t)id;

    BTM_LogHistory(kBtmLogTag, RawAddress::kEmpty, "Le advert started",
                   base::StringPrintf("advert_id:%d", reg_id));
  }

  void SetPeriodicAdvertisingParameters(