Loading system/device/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ cc_library_static { name: "libbtdevice", defaults: ["fluoride_defaults"], host_supported: true, local_include_dirs: [ "include", ], Loading system/profile/avrcp/Android.bp +4 −1 Original line number Diff line number Diff line Loading @@ -37,8 +37,11 @@ cc_test { static_libs: [ "libgmock", "lib-bt-packets", "libosi", "avrcp-target-service", "libbtdevice", "libosi", "liblog", "libcutils", ], sanitize: { cfi: false, Loading system/profile/avrcp/connection_handler.cc +22 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,9 @@ // TODO (apanicke): Remove dependency on this header once we cleanup feature // handling. #include "bta/include/bta_av_api.h" #include "device/include/interop.h" #include "osi/include/allocator.h" #include "osi/include/properties.h" namespace bluetooth { namespace avrcp { Loading @@ -41,6 +43,20 @@ ConnectionHandler* ConnectionHandler::Get() { return instance_; } bool IsAbsoluteVolumeEnabled(const RawAddress* bdaddr) { char volume_disabled[PROPERTY_VALUE_MAX] = {0}; osi_property_get("persist.bluetooth.disableabsvol", volume_disabled, "false"); if (strncmp(volume_disabled, "true", 4) == 0) { LOG(INFO) << "Absolute volume disabled by property"; return false; } if (interop_match_addr(INTEROP_DISABLE_ABSOLUTE_VOLUME, bdaddr)) { LOG(INFO) << "Absolute volume disabled by IOP table"; return false; } return true; } bool ConnectionHandler::Initialize(const ConnectionCallback& callback, AvrcpInterface* avrcp, SdpInterface* sdp, VolumeInterface* vol) { Loading Loading @@ -428,8 +444,10 @@ void ConnectionHandler::SdpCb(const RawAddress& bdaddr, SdpCallback cb, if (categories & AVRC_SUPF_CT_CAT2) { LOG(INFO) << __PRETTY_FUNCTION__ << ": Device " << bdaddr.ToString() << " supports advanced control"; if (IsAbsoluteVolumeEnabled(&bdaddr)) { peer_features |= (BTA_AV_FEAT_ADV_CTRL); } } if (categories & AVRC_SUPF_CT_BROWSE) { LOG(INFO) << __PRETTY_FUNCTION__ << ": Device " << bdaddr.ToString() << " supports browsing"; Loading Loading @@ -467,12 +485,14 @@ void ConnectionHandler::SdpCb(const RawAddress& bdaddr, SdpCallback cb, if (categories & AVRC_SUPF_CT_CAT2) { LOG(INFO) << __PRETTY_FUNCTION__ << ": Device " << bdaddr.ToString() << " supports advanced control"; if (IsAbsoluteVolumeEnabled(&bdaddr)) { peer_features |= (BTA_AV_FEAT_ADV_CTRL); } } } } } } osi_free(disc_db); Loading Loading
system/device/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ cc_library_static { name: "libbtdevice", defaults: ["fluoride_defaults"], host_supported: true, local_include_dirs: [ "include", ], Loading
system/profile/avrcp/Android.bp +4 −1 Original line number Diff line number Diff line Loading @@ -37,8 +37,11 @@ cc_test { static_libs: [ "libgmock", "lib-bt-packets", "libosi", "avrcp-target-service", "libbtdevice", "libosi", "liblog", "libcutils", ], sanitize: { cfi: false, Loading
system/profile/avrcp/connection_handler.cc +22 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,9 @@ // TODO (apanicke): Remove dependency on this header once we cleanup feature // handling. #include "bta/include/bta_av_api.h" #include "device/include/interop.h" #include "osi/include/allocator.h" #include "osi/include/properties.h" namespace bluetooth { namespace avrcp { Loading @@ -41,6 +43,20 @@ ConnectionHandler* ConnectionHandler::Get() { return instance_; } bool IsAbsoluteVolumeEnabled(const RawAddress* bdaddr) { char volume_disabled[PROPERTY_VALUE_MAX] = {0}; osi_property_get("persist.bluetooth.disableabsvol", volume_disabled, "false"); if (strncmp(volume_disabled, "true", 4) == 0) { LOG(INFO) << "Absolute volume disabled by property"; return false; } if (interop_match_addr(INTEROP_DISABLE_ABSOLUTE_VOLUME, bdaddr)) { LOG(INFO) << "Absolute volume disabled by IOP table"; return false; } return true; } bool ConnectionHandler::Initialize(const ConnectionCallback& callback, AvrcpInterface* avrcp, SdpInterface* sdp, VolumeInterface* vol) { Loading Loading @@ -428,8 +444,10 @@ void ConnectionHandler::SdpCb(const RawAddress& bdaddr, SdpCallback cb, if (categories & AVRC_SUPF_CT_CAT2) { LOG(INFO) << __PRETTY_FUNCTION__ << ": Device " << bdaddr.ToString() << " supports advanced control"; if (IsAbsoluteVolumeEnabled(&bdaddr)) { peer_features |= (BTA_AV_FEAT_ADV_CTRL); } } if (categories & AVRC_SUPF_CT_BROWSE) { LOG(INFO) << __PRETTY_FUNCTION__ << ": Device " << bdaddr.ToString() << " supports browsing"; Loading Loading @@ -467,12 +485,14 @@ void ConnectionHandler::SdpCb(const RawAddress& bdaddr, SdpCallback cb, if (categories & AVRC_SUPF_CT_CAT2) { LOG(INFO) << __PRETTY_FUNCTION__ << ": Device " << bdaddr.ToString() << " supports advanced control"; if (IsAbsoluteVolumeEnabled(&bdaddr)) { peer_features |= (BTA_AV_FEAT_ADV_CTRL); } } } } } } osi_free(disc_db); Loading