OSDN Git Service

AVRCP: Route CType NOT_IMPLEMENTED as a response
authorMyles Watson <mylesgw@google.com>
Fri, 18 May 2018 18:31:33 +0000 (11:31 -0700)
committerMyles Watson <mylesgw@google.com>
Fri, 18 May 2018 21:05:29 +0000 (14:05 -0700)
Fixes: 79698590
Test: net_test_avrcp, Connect to the Anker MP140
Change-Id: Ie88dcea949ecb33bc3d76d86b07ab0396a21500d
(cherry picked from commit f74cecf93e648e861363aa312bef08327f19a26a)

include/hardware/avrcp/avrcp_common.h
profile/avrcp/device.cc

index 22354f6..be71557 100644 (file)
@@ -31,6 +31,7 @@ enum class CType : uint8_t {
   CONTROL = 0x0,
   STATUS = 0x1,
   NOTIFY = 0x3,
+  NOT_IMPLEMENTED = 0x8,
   ACCEPTED = 0x9,
   REJECTED = 0xa,
   STABLE = 0xc,
index 0543f5c..57469fe 100644 (file)
@@ -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.