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

Commit b51fc4c1 authored by Rongxuan Liu's avatar Rongxuan Liu Committed by Gerrit Code Review
Browse files

Merge "Remove unused btif_ble_advertiser file" into main

parents e7fde5e5 4eca7644
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -176,7 +176,6 @@ cc_library_static {
        "co/bta_gatts_co.cc",
        // BTIF implementation
        "src/btif_activity_attribution.cc",
        "src/btif_ble_advertiser.cc",
        "src/btif_ble_scanner.cc",
        "src/btif_bqr.cc",
        "src/btif_config.cc",
+0 −1
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@ static_library("btif") {
    # TODO(abps) - Move this abstraction elsewhere
    # "src/btif_avrcp_audio_track.cc",
    "src/btif_avrcp_audio_track_linux.cc",
    "src/btif_ble_advertiser.cc",
    "src/btif_ble_scanner.cc",
    "src/btif_bqr.cc",
    "src/btif_csis_client.cc",
+0 −1
Original line number Diff line number Diff line
@@ -32,6 +32,5 @@
extern const btgatt_client_interface_t btgattClientInterface;
extern const btgatt_server_interface_t btgattServerInterface;

BleAdvertiserInterface* get_ble_advertiser_instance();
BleScannerInterface* get_ble_scanner_instance();
#endif
+0 −28
Original line number Diff line number Diff line
/******************************************************************************
 *
 *  Copyright 2016 Google Inc.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 ******************************************************************************/

#define LOG_TAG "bt_btif_ble_advertiser"

#include <base/logging.h>

#include "main/shim/le_advertising_manager.h"

BleAdvertiserInterface* get_ble_advertiser_instance() {
  LOG(INFO) << __func__ << " use gd le advertiser";
  return bluetooth::shim::get_ble_advertiser_instance();
}
+6 −5
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@
#include "gd/common/lru_cache.h"
#include "internal_include/stack_config.h"
#include "main/shim/dumpsys.h"
#include "main/shim/le_advertising_manager.h"
#include "main/shim/shim.h"
#include "osi/include/allocator.h"
#include "osi/include/log.h"
@@ -3143,7 +3144,7 @@ static std::optional<uint8_t> oob_advertiser_id_;
static void stop_oob_advertiser() {
  // For chasing an advertising bug b/237023051
  LOG_DEBUG("oob_advertiser_id: %d", oob_advertiser_id_.value());
  auto advertiser = get_ble_advertiser_instance();
  auto advertiser = bluetooth::shim::get_ble_advertiser_instance();
  advertiser->Unregister(oob_advertiser_id_.value());
  oob_advertiser_id_ = {};
}
@@ -3207,7 +3208,7 @@ static void start_advertising_callback(uint8_t id, tBT_TRANSPORT transport,
    return;
  }
  LOG_DEBUG("OOB advertiser with id %hhd", id);
  auto advertiser = get_ble_advertiser_instance();
  auto advertiser = bluetooth::shim::get_ble_advertiser_instance();
  advertiser->GetOwnAddress(
      id, base::Bind(&get_address_callback, transport, is_valid, c, r));
}
@@ -3215,7 +3216,7 @@ static void start_advertising_callback(uint8_t id, tBT_TRANSPORT transport,
static void timeout_cb(uint8_t id, tBTM_STATUS status) {
  LOG_INFO("OOB advertiser with id %hhd timed out with status %hhd", id,
           status);
  auto advertiser = get_ble_advertiser_instance();
  auto advertiser = bluetooth::shim::get_ble_advertiser_instance();
  advertiser->Unregister(id);
  SMP_ClearLocScOobData();
  waiting_on_oob_advertiser_start = false;
@@ -3239,7 +3240,7 @@ static void id_status_callback(tBT_TRANSPORT transport, bool is_valid,
  oob_advertiser_id_ = id;
  LOG_INFO("oob_advertiser_id: %d", id);

  auto advertiser = get_ble_advertiser_instance();
  auto advertiser = bluetooth::shim::get_ble_advertiser_instance();
  AdvertiseParameters parameters{};
  parameters.advertising_event_properties =
      0x0045 /* connectable, discoverable, tx power */;
@@ -3266,7 +3267,7 @@ static void id_status_callback(tBT_TRANSPORT transport, bool is_valid,
// Step One: Start the advertiser
static void start_oob_advertiser(tBT_TRANSPORT transport, bool is_valid,
                                 const Octet16& c, const Octet16& r) {
  auto advertiser = get_ble_advertiser_instance();
  auto advertiser = bluetooth::shim::get_ble_advertiser_instance();
  advertiser->RegisterAdvertiser(
      base::Bind(&id_status_callback, transport, is_valid, c, r));
}
Loading