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

Commit 9a2885cc authored by Alice Kuo's avatar Alice Kuo Committed by Automerger Merge Worker
Browse files

Update CoD LE audio bit based on the feature system properties am: 3f061047...

Update CoD LE audio bit based on the feature system properties am: 3f061047 am: 255addcb am: 3ba82337 am: ae2dd12d

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



Change-Id: I3dfeda4f88d46343766d602a4e7124a8d61045dd
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a7295303 ae2dd12d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -214,6 +214,9 @@ cc_library_static {
    ],
    target: {
        android: {
            whole_static_libs: [
                "libPlatformProperties",
            ],
            srcs: ["src/btif_avrcp_audio_track.cc"],
            shared_libs: ["libaaudio"],
        },
+28 −1
Original line number Diff line number Diff line
@@ -95,6 +95,10 @@
#include "stack_config.h"
#include "types/raw_address.h"

#ifdef OS_ANDROID
#include <android/sysprop/BluetoothProperties.sysprop.h>
#endif

bool btif_get_device_type(const RawAddress& bda, int* p_device_type);

using bluetooth::Uuid;
@@ -2934,8 +2938,31 @@ void btif_dm_get_local_class_of_device(DEV_CLASS device_class) {
    LOG_ERROR("%s: COD malformed, fewer than three numbers", __func__);
  }

  LOG_DEBUG("%s: Using class of device '0x%x, 0x%x, 0x%x'", __func__,
  LOG_DEBUG("Using class of device '0x%x, 0x%x, 0x%x' from CoD system property",
            device_class[0], device_class[1], device_class[2]);

#ifdef OS_ANDROID
  // Per BAP 1.0.1, 8.2.3. Device discovery, the stack needs to set Class of
  // Device (CoD) field Major Service Class bit 14 to 0b1 when Unicast Server,
  // Unicast Client, Broadcast Source, Broadcast Sink, Scan Delegator, or
  // Broadcast Assistant is supported on this device
  if (android::sysprop::BluetoothProperties::isProfileBapUnicastClientEnabled()
          .value_or(false) ||
      android::sysprop::BluetoothProperties::
          isProfileBapBroadcastAssistEnabled()
              .value_or(false) ||
      android::sysprop::BluetoothProperties::
          isProfileBapBroadcastSourceEnabled()
              .value_or(false)) {
    device_class[1] |= 0x01 << 6;
  } else {
    device_class[1] &= ~(0x01 << 6);
  }
  LOG_DEBUG(
      "Check LE audio enabled status, update class of device to '0x%x, 0x%x, "
      "0x%x'",
      device_class[0], device_class[1], device_class[2]);
#endif
}

/*******************************************************************************