Loading system/btif/avrcp/avrcp_service.cc +6 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,12 @@ class AvrcpInterfaceImpl : public AvrcpInterface { BT_HDR* p_pkt) override { return AVRC_MsgReq(handle, label, ctype, p_pkt); } void SaveControllerVersion(const RawAddress& bdaddr, uint16_t version) override { AVRC_SaveControllerVersion(bdaddr, version); } } avrcp_interface_; class SdpInterfaceImpl : public SdpInterface { Loading system/profile/avrcp/avrcp_internal.h +3 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,9 @@ class AvrcpInterface { virtual uint16_t MsgReq(uint8_t handle, uint8_t label, uint8_t ctype, BT_HDR* p_pkt) = 0; virtual void SaveControllerVersion(const RawAddress& bdaddr, uint16_t version) = 0; virtual ~AvrcpInterface() = default; }; Loading system/profile/avrcp/connection_handler.cc +5 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <base/bind.h> #include <base/logging.h> #include <map> #include "avrc_defs.h" Loading Loading @@ -488,6 +489,10 @@ void ConnectionHandler::SdpCb(RawAddress bdaddr, SdpCallback cb, } } } if (osi_property_get_bool(AVRC_DYNAMIC_AVRCP_ENABLE_PROPERTY, true)) { avrc_->SaveControllerVersion(bdaddr, peer_avrcp_version); } } } Loading system/profile/avrcp/tests/avrcp_test_helper.h +1 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ class MockAvrcpInterface : public AvrcpInterface { MOCK_METHOD1(Close, uint16_t(uint8_t)); MOCK_METHOD1(CloseBrowse, uint16_t(uint8_t)); MOCK_METHOD4(MsgReq, uint16_t(uint8_t, uint8_t, uint8_t, BT_HDR*)); MOCK_METHOD2(SaveControllerVersion, void(const RawAddress&, uint16_t)); }; class MockA2dpInterface : public A2dpInterface { Loading system/stack/Android.bp +33 −0 Original line number Diff line number Diff line Loading @@ -1265,3 +1265,36 @@ cc_test { }, }, } // Bluetooth stack connection multiplexing cc_test { name: "net_test_stack_sdp", defaults: ["fluoride_defaults"], local_include_dirs: [ "include", "test/common", ], include_dirs: [ "packages/modules/Bluetooth/system", "packages/modules/Bluetooth/system/device/include/", "packages/modules/Bluetooth/system/gd", "packages/modules/Bluetooth/system/internal_include", "packages/modules/Bluetooth/system/utils/include", ], srcs: [ ":TestCommonMockFunctions", "sdp/sdp_main.cc", "sdp/sdp_utils.cc", "test/common/mock_btif_config.cc", "test/stack_sdp_utils_test.cc", ], shared_libs: [ "libcutils", ], static_libs: [ "libbt-common", "libbluetooth-types", "liblog", "libgmock", ], } Loading
system/btif/avrcp/avrcp_service.cc +6 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,12 @@ class AvrcpInterfaceImpl : public AvrcpInterface { BT_HDR* p_pkt) override { return AVRC_MsgReq(handle, label, ctype, p_pkt); } void SaveControllerVersion(const RawAddress& bdaddr, uint16_t version) override { AVRC_SaveControllerVersion(bdaddr, version); } } avrcp_interface_; class SdpInterfaceImpl : public SdpInterface { Loading
system/profile/avrcp/avrcp_internal.h +3 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,9 @@ class AvrcpInterface { virtual uint16_t MsgReq(uint8_t handle, uint8_t label, uint8_t ctype, BT_HDR* p_pkt) = 0; virtual void SaveControllerVersion(const RawAddress& bdaddr, uint16_t version) = 0; virtual ~AvrcpInterface() = default; }; Loading
system/profile/avrcp/connection_handler.cc +5 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #include <base/bind.h> #include <base/logging.h> #include <map> #include "avrc_defs.h" Loading Loading @@ -488,6 +489,10 @@ void ConnectionHandler::SdpCb(RawAddress bdaddr, SdpCallback cb, } } } if (osi_property_get_bool(AVRC_DYNAMIC_AVRCP_ENABLE_PROPERTY, true)) { avrc_->SaveControllerVersion(bdaddr, peer_avrcp_version); } } } Loading
system/profile/avrcp/tests/avrcp_test_helper.h +1 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ class MockAvrcpInterface : public AvrcpInterface { MOCK_METHOD1(Close, uint16_t(uint8_t)); MOCK_METHOD1(CloseBrowse, uint16_t(uint8_t)); MOCK_METHOD4(MsgReq, uint16_t(uint8_t, uint8_t, uint8_t, BT_HDR*)); MOCK_METHOD2(SaveControllerVersion, void(const RawAddress&, uint16_t)); }; class MockA2dpInterface : public A2dpInterface { Loading
system/stack/Android.bp +33 −0 Original line number Diff line number Diff line Loading @@ -1265,3 +1265,36 @@ cc_test { }, }, } // Bluetooth stack connection multiplexing cc_test { name: "net_test_stack_sdp", defaults: ["fluoride_defaults"], local_include_dirs: [ "include", "test/common", ], include_dirs: [ "packages/modules/Bluetooth/system", "packages/modules/Bluetooth/system/device/include/", "packages/modules/Bluetooth/system/gd", "packages/modules/Bluetooth/system/internal_include", "packages/modules/Bluetooth/system/utils/include", ], srcs: [ ":TestCommonMockFunctions", "sdp/sdp_main.cc", "sdp/sdp_utils.cc", "test/common/mock_btif_config.cc", "test/stack_sdp_utils_test.cc", ], shared_libs: [ "libcutils", ], static_libs: [ "libbt-common", "libbluetooth-types", "liblog", "libgmock", ], }