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

Commit c27243d5 authored by Myles Watson's avatar Myles Watson Committed by Automerger Merge Worker
Browse files

Merge "LE Audio: Improve LE Audio device detection." into main am: e9675a4d

parents 1175b9e1 e9675a4d
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@
#include <optional>

#include "advertise_data_parser.h"
#include "android_bluetooth_flags.h"
#include "bta/dm/bta_dm_disc.h"
#include "bta/include/bta_api.h"
#include "btif/include/stack_manager_t.h"
@@ -748,6 +749,18 @@ bool is_device_le_audio_capable(const RawAddress bd_addr) {
    return false;
  }

  /* First try reading device type from BTIF - it persists over multiple
   * inquiry sessions */
  int dev_type = 0;
  if (IS_FLAG_ENABLED(le_audio_dev_type_detection_fix) &&
      (btif_get_device_type(bd_addr, &dev_type) &&
       (dev_type & BT_DEVICE_TYPE_BLE) == BT_DEVICE_TYPE_BLE)) {
    /* LE Audio capable device is discoverable over both LE and Classic using
     * same address. Prefer to use LE transport, as we don't know if it can do
     * CTKD from Classic to LE */
    return true;
  }

  tBT_DEVICE_TYPE tmp_dev_type;
  tBLE_ADDR_TYPE addr_type = BLE_ADDR_PUBLIC;
  BTM_ReadDevInfo(bd_addr, &tmp_dev_type, &addr_type);