Loading system/btif/avrcp/avrcp_service.cc +2 −2 Original line number Diff line number Diff line Loading @@ -115,9 +115,9 @@ class MediaInterfaceWrapper : public MediaInterface { public: MediaInterfaceWrapper(MediaInterface* cb) : wrapped_(cb){}; void SendKeyEvent(uint8_t key, uint8_t status) override { void SendKeyEvent(uint8_t key, KeyState state) override { do_in_jni_thread(base::Bind(&MediaInterface::SendKeyEvent, base::Unretained(wrapped_), key, status)); base::Unretained(wrapped_), key, state)); } void GetSongInfo(SongInfoCallback info_cb) override { Loading system/include/hardware/avrcp/avrcp.h +1 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ class MediaCallbacks { // behavior in case the threading model changes on either side. class MediaInterface { public: virtual void SendKeyEvent(uint8_t key, uint8_t status) = 0; virtual void SendKeyEvent(uint8_t key, KeyState state) = 0; using SongInfoCallback = base::Callback<void(SongInfo)>; virtual void GetSongInfo(SongInfoCallback info_cb) = 0; Loading system/include/hardware/avrcp/avrcp_common.h +5 −0 Original line number Diff line number Diff line Loading @@ -137,6 +137,11 @@ enum class Direction : uint8_t { DOWN = 0x01, }; enum class KeyState : uint8_t { PUSHED = 0x00, RELEASED = 0x01, }; class AttributeEntry { public: AttributeEntry(const Attribute& attribute, const std::string& value) Loading system/include/hardware/avrcp/avrcp_logging_helper.h +13 −0 Original line number Diff line number Diff line Loading @@ -226,5 +226,18 @@ inline std::ostream& operator<<(std::ostream& os, const Direction& dir) { return os << DirectionText(dir); } inline std::string KeyStateText(const KeyState& state) { switch (state) { CASE_RETURN_TEXT(KeyState::PUSHED); CASE_RETURN_TEXT(KeyState::RELEASED); default: return "Unknown KeyState: " + loghex((uint8_t)state); } } inline std::ostream& operator<<(std::ostream& os, const KeyState& dir) { return os << KeyStateText(dir); } } // namespace avrcp } // namespace bluetooth system/packet/avrcp/pass_through_packet.cc +4 −3 Original line number Diff line number Diff line Loading @@ -46,8 +46,9 @@ bool PassThroughPacketBuilder::Serialize( return true; } bool PassThroughPacket::GetPushed() const { return (*(begin() + Packet::kMinSize()) & 0b10000000) == 0; KeyState PassThroughPacket::GetKeyState() const { auto it = begin() + Packet::kMinSize(); return static_cast<KeyState>(((*it) & 0b10000000) >> 7); } uint8_t PassThroughPacket::GetOperationId() const { Loading @@ -63,7 +64,7 @@ std::string PassThroughPacket::ToString() const { ss << " └ Subunit Type = " << loghex(GetSubunitType()) << std::endl; ss << " └ Subunit ID = " << loghex(GetSubunitId()) << std::endl; ss << " └ OpCode = " << GetOpcode() << std::endl; ss << " └ Pushed = " << GetPushed() << std::endl; ss << " └ Pushed = " << GetKeyState() << std::endl; ss << " └ Opperation ID = " << loghex(GetOperationId()) << std::endl; return ss.str(); Loading Loading
system/btif/avrcp/avrcp_service.cc +2 −2 Original line number Diff line number Diff line Loading @@ -115,9 +115,9 @@ class MediaInterfaceWrapper : public MediaInterface { public: MediaInterfaceWrapper(MediaInterface* cb) : wrapped_(cb){}; void SendKeyEvent(uint8_t key, uint8_t status) override { void SendKeyEvent(uint8_t key, KeyState state) override { do_in_jni_thread(base::Bind(&MediaInterface::SendKeyEvent, base::Unretained(wrapped_), key, status)); base::Unretained(wrapped_), key, state)); } void GetSongInfo(SongInfoCallback info_cb) override { Loading
system/include/hardware/avrcp/avrcp.h +1 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ class MediaCallbacks { // behavior in case the threading model changes on either side. class MediaInterface { public: virtual void SendKeyEvent(uint8_t key, uint8_t status) = 0; virtual void SendKeyEvent(uint8_t key, KeyState state) = 0; using SongInfoCallback = base::Callback<void(SongInfo)>; virtual void GetSongInfo(SongInfoCallback info_cb) = 0; Loading
system/include/hardware/avrcp/avrcp_common.h +5 −0 Original line number Diff line number Diff line Loading @@ -137,6 +137,11 @@ enum class Direction : uint8_t { DOWN = 0x01, }; enum class KeyState : uint8_t { PUSHED = 0x00, RELEASED = 0x01, }; class AttributeEntry { public: AttributeEntry(const Attribute& attribute, const std::string& value) Loading
system/include/hardware/avrcp/avrcp_logging_helper.h +13 −0 Original line number Diff line number Diff line Loading @@ -226,5 +226,18 @@ inline std::ostream& operator<<(std::ostream& os, const Direction& dir) { return os << DirectionText(dir); } inline std::string KeyStateText(const KeyState& state) { switch (state) { CASE_RETURN_TEXT(KeyState::PUSHED); CASE_RETURN_TEXT(KeyState::RELEASED); default: return "Unknown KeyState: " + loghex((uint8_t)state); } } inline std::ostream& operator<<(std::ostream& os, const KeyState& dir) { return os << KeyStateText(dir); } } // namespace avrcp } // namespace bluetooth
system/packet/avrcp/pass_through_packet.cc +4 −3 Original line number Diff line number Diff line Loading @@ -46,8 +46,9 @@ bool PassThroughPacketBuilder::Serialize( return true; } bool PassThroughPacket::GetPushed() const { return (*(begin() + Packet::kMinSize()) & 0b10000000) == 0; KeyState PassThroughPacket::GetKeyState() const { auto it = begin() + Packet::kMinSize(); return static_cast<KeyState>(((*it) & 0b10000000) >> 7); } uint8_t PassThroughPacket::GetOperationId() const { Loading @@ -63,7 +64,7 @@ std::string PassThroughPacket::ToString() const { ss << " └ Subunit Type = " << loghex(GetSubunitType()) << std::endl; ss << " └ Subunit ID = " << loghex(GetSubunitId()) << std::endl; ss << " └ OpCode = " << GetOpcode() << std::endl; ss << " └ Pushed = " << GetPushed() << std::endl; ss << " └ Pushed = " << GetKeyState() << std::endl; ss << " └ Opperation ID = " << loghex(GetOperationId()) << std::endl; return ss.str(); Loading