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

Commit 5b6a5e41 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Initialize ras only if the controller support channel soudning." into...

Merge "Initialize ras only if the controller support channel soudning." into main am: 785876e4 am: cf2a2cb1

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



Change-Id: I967b346fe86c48406a53055e14ee22cb5046a789
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents baa7ff47 cf2a2cb1
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@
#include "bta/include/bta_gatt_api.h"
#include "bta/include/bta_ras_api.h"
#include "bta/ras/ras_types.h"
#include "gd/hci/controller_interface.h"
#include "main/shim/entry.h"
#include "os/logging/log_adapter.h"
#include "stack/include/bt_types.h"
#include "stack/include/btm_ble_addr.h"
@@ -100,6 +102,11 @@ public:
  };

  void Initialize() override {
    auto controller = bluetooth::shim::GetController();
    if (controller && !controller->SupportsBleChannelSounding()) {
      log::info("controller does not support channel sounding.");
      return;
    }
    BTA_GATTC_AppRegister(
            [](tBTA_GATTC_EVT event, tBTA_GATTC* p_data) {
              if (instance && p_data) {
+8 −2
Original line number Diff line number Diff line
@@ -23,8 +23,10 @@
#include "bta/include/bta_gatt_api.h"
#include "bta/include/bta_ras_api.h"
#include "bta/ras/ras_types.h"
#include "gd/hci/controller_interface.h"
#include "gd/hci/uuid.h"
#include "gd/os/rand.h"
#include "main/shim/entry.h"
#include "os/logging/log_adapter.h"
#include "stack/include/bt_types.h"
#include "stack/include/btm_ble_addr.h"
@@ -74,11 +76,15 @@ public:
    uint16_t last_overwritten_procedure_ = 0;
  };

  void Initialize() {
  void Initialize() override {
    auto controller = bluetooth::shim::GetController();
    if (controller && !controller->SupportsBleChannelSounding()) {
      log::info("controller does not support channel sounding.");
      return;
    }
    Uuid uuid = Uuid::From128BitBE(bluetooth::os::GenerateRandom<Uuid::kNumBytes128>());
    app_uuid_ = uuid;
    log::info("Register server with uuid:{}", app_uuid_.ToString());

    BTA_GATTS_AppRegister(
            app_uuid_,
            [](tBTA_GATTS_EVT event, tBTA_GATTS* p_data) {