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

Commit f48081ae authored by Tom Huang's avatar Tom Huang Committed by Gerrit Code Review
Browse files

Merge "Dynamic AVRCP version"

parents 213409cb c1f88002
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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 {
+3 −0
Original line number Diff line number Diff line
@@ -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;
};

+5 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@

#include <base/bind.h>
#include <base/logging.h>

#include <map>

#include "avrc_defs.h"
@@ -488,6 +489,10 @@ void ConnectionHandler::SdpCb(RawAddress bdaddr, SdpCallback cb,
          }
        }
      }

      if (osi_property_get_bool(AVRC_DYNAMIC_AVRCP_ENABLE_PROPERTY, false)) {
        avrc_->SaveControllerVersion(bdaddr, peer_avrcp_version);
      }
    }
  }

+1 −0
Original line number Diff line number Diff line
@@ -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 {
+33 −0
Original line number Diff line number Diff line
@@ -1218,3 +1218,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