Loading system/device/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -3,6 +3,7 @@ cc_library_static { cc_library_static { name: "libbtdevice", name: "libbtdevice", defaults: ["fluoride_defaults"], defaults: ["fluoride_defaults"], host_supported: true, local_include_dirs: [ local_include_dirs: [ "include", "include", ], ], Loading system/profile/avrcp/Android.bp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -38,6 +38,9 @@ cc_test { "libgmock", "libgmock", "lib-bt-packets", "lib-bt-packets", "libosi", "libosi", "liblog", "libcutils", "libbtdevice", "avrcp-target-service", "avrcp-target-service", ], ], sanitize: { sanitize: { Loading system/profile/avrcp/connection_handler.cc +22 −2 Original line number Original line Diff line number Diff line Loading @@ -28,7 +28,9 @@ // TODO (apanicke): Remove dependency on this header once we cleanup feature // TODO (apanicke): Remove dependency on this header once we cleanup feature // handling. // handling. #include "bta/include/bta_av_api.h" #include "bta/include/bta_av_api.h" #include "device/include/interop.h" #include "osi/include/allocator.h" #include "osi/include/allocator.h" #include "osi/include/properties.h" namespace bluetooth { namespace bluetooth { namespace avrcp { namespace avrcp { Loading @@ -41,6 +43,20 @@ ConnectionHandler* ConnectionHandler::Get() { return instance_; 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, bool ConnectionHandler::Initialize(const ConnectionCallback& callback, AvrcpInterface* avrcp, SdpInterface* sdp, AvrcpInterface* avrcp, SdpInterface* sdp, VolumeInterface* vol) { VolumeInterface* vol) { Loading Loading @@ -429,8 +445,10 @@ void ConnectionHandler::SdpCb(const RawAddress& bdaddr, SdpCallback cb, if (categories & AVRC_SUPF_CT_CAT2) { if (categories & AVRC_SUPF_CT_CAT2) { LOG(INFO) << __PRETTY_FUNCTION__ << ": Device " << bdaddr.ToString() LOG(INFO) << __PRETTY_FUNCTION__ << ": Device " << bdaddr.ToString() << " supports advanced control"; << " supports advanced control"; if (IsAbsoluteVolumeEnabled(&bdaddr)) { peer_features |= (BTA_AV_FEAT_ADV_CTRL); peer_features |= (BTA_AV_FEAT_ADV_CTRL); } } } if (categories & AVRC_SUPF_CT_BROWSE) { if (categories & AVRC_SUPF_CT_BROWSE) { LOG(INFO) << __PRETTY_FUNCTION__ << ": Device " << bdaddr.ToString() LOG(INFO) << __PRETTY_FUNCTION__ << ": Device " << bdaddr.ToString() << " supports browsing"; << " supports browsing"; Loading Loading @@ -468,12 +486,14 @@ void ConnectionHandler::SdpCb(const RawAddress& bdaddr, SdpCallback cb, if (categories & AVRC_SUPF_CT_CAT2) { if (categories & AVRC_SUPF_CT_CAT2) { LOG(INFO) << __PRETTY_FUNCTION__ << ": Device " << bdaddr.ToString() LOG(INFO) << __PRETTY_FUNCTION__ << ": Device " << bdaddr.ToString() << " supports advanced control"; << " supports advanced control"; if (IsAbsoluteVolumeEnabled(&bdaddr)) { peer_features |= (BTA_AV_FEAT_ADV_CTRL); peer_features |= (BTA_AV_FEAT_ADV_CTRL); } } } } } } } } } } } osi_free(disc_db); osi_free(disc_db); Loading Loading
system/device/Android.bp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -3,6 +3,7 @@ cc_library_static { cc_library_static { name: "libbtdevice", name: "libbtdevice", defaults: ["fluoride_defaults"], defaults: ["fluoride_defaults"], host_supported: true, local_include_dirs: [ local_include_dirs: [ "include", "include", ], ], Loading
system/profile/avrcp/Android.bp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -38,6 +38,9 @@ cc_test { "libgmock", "libgmock", "lib-bt-packets", "lib-bt-packets", "libosi", "libosi", "liblog", "libcutils", "libbtdevice", "avrcp-target-service", "avrcp-target-service", ], ], sanitize: { sanitize: { Loading
system/profile/avrcp/connection_handler.cc +22 −2 Original line number Original line Diff line number Diff line Loading @@ -28,7 +28,9 @@ // TODO (apanicke): Remove dependency on this header once we cleanup feature // TODO (apanicke): Remove dependency on this header once we cleanup feature // handling. // handling. #include "bta/include/bta_av_api.h" #include "bta/include/bta_av_api.h" #include "device/include/interop.h" #include "osi/include/allocator.h" #include "osi/include/allocator.h" #include "osi/include/properties.h" namespace bluetooth { namespace bluetooth { namespace avrcp { namespace avrcp { Loading @@ -41,6 +43,20 @@ ConnectionHandler* ConnectionHandler::Get() { return instance_; 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, bool ConnectionHandler::Initialize(const ConnectionCallback& callback, AvrcpInterface* avrcp, SdpInterface* sdp, AvrcpInterface* avrcp, SdpInterface* sdp, VolumeInterface* vol) { VolumeInterface* vol) { Loading Loading @@ -429,8 +445,10 @@ void ConnectionHandler::SdpCb(const RawAddress& bdaddr, SdpCallback cb, if (categories & AVRC_SUPF_CT_CAT2) { if (categories & AVRC_SUPF_CT_CAT2) { LOG(INFO) << __PRETTY_FUNCTION__ << ": Device " << bdaddr.ToString() LOG(INFO) << __PRETTY_FUNCTION__ << ": Device " << bdaddr.ToString() << " supports advanced control"; << " supports advanced control"; if (IsAbsoluteVolumeEnabled(&bdaddr)) { peer_features |= (BTA_AV_FEAT_ADV_CTRL); peer_features |= (BTA_AV_FEAT_ADV_CTRL); } } } if (categories & AVRC_SUPF_CT_BROWSE) { if (categories & AVRC_SUPF_CT_BROWSE) { LOG(INFO) << __PRETTY_FUNCTION__ << ": Device " << bdaddr.ToString() LOG(INFO) << __PRETTY_FUNCTION__ << ": Device " << bdaddr.ToString() << " supports browsing"; << " supports browsing"; Loading Loading @@ -468,12 +486,14 @@ void ConnectionHandler::SdpCb(const RawAddress& bdaddr, SdpCallback cb, if (categories & AVRC_SUPF_CT_CAT2) { if (categories & AVRC_SUPF_CT_CAT2) { LOG(INFO) << __PRETTY_FUNCTION__ << ": Device " << bdaddr.ToString() LOG(INFO) << __PRETTY_FUNCTION__ << ": Device " << bdaddr.ToString() << " supports advanced control"; << " supports advanced control"; if (IsAbsoluteVolumeEnabled(&bdaddr)) { peer_features |= (BTA_AV_FEAT_ADV_CTRL); peer_features |= (BTA_AV_FEAT_ADV_CTRL); } } } } } } } } } } } osi_free(disc_db); osi_free(disc_db); Loading