From: Myles Watson Date: Fri, 18 May 2018 18:31:33 +0000 (-0700) Subject: AVRCP: Route CType NOT_IMPLEMENTED as a response X-Git-Tag: android-x86-9.0-r1~76^2^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ff915a9f4d2f7a03f0a3b52b635fc6841a1188e3;p=android-x86%2Fsystem-bt.git AVRCP: Route CType NOT_IMPLEMENTED as a response Fixes: 79698590 Test: net_test_avrcp, Connect to the Anker MP140 Change-Id: Ie88dcea949ecb33bc3d76d86b07ab0396a21500d (cherry picked from commit f74cecf93e648e861363aa312bef08327f19a26a) --- diff --git a/include/hardware/avrcp/avrcp_common.h b/include/hardware/avrcp/avrcp_common.h index 22354f665..be71557fc 100644 --- a/include/hardware/avrcp/avrcp_common.h +++ b/include/hardware/avrcp/avrcp_common.h @@ -31,6 +31,7 @@ enum class CType : uint8_t { CONTROL = 0x0, STATUS = 0x1, NOTIFY = 0x3, + NOT_IMPLEMENTED = 0x8, ACCEPTED = 0x9, REJECTED = 0xa, STABLE = 0xc, diff --git a/profile/avrcp/device.cc b/profile/avrcp/device.cc index 0543f5c21..57469fe44 100644 --- a/profile/avrcp/device.cc +++ b/profile/avrcp/device.cc @@ -52,7 +52,11 @@ void Device::VendorPacketHandler(uint8_t label, CHECK(media_interface_); DEVICE_VLOG(3) << __func__ << ": pdu=" << pkt->GetCommandPdu(); - // All CTypes at and above ACCEPTED are all response types. + // All CTypes at and above NOT_IMPLEMENTED are all response types. + if (pkt->GetCType() == CType::NOT_IMPLEMENTED) { + return; + } + if (pkt->GetCType() >= CType::ACCEPTED) { switch (pkt->GetCommandPdu()) { // VOLUME_CHANGED is the only notification we register for while target.