Loading system/profile/avrcp/connection_handler.cc +18 −4 Original line number Diff line number Diff line Loading @@ -273,13 +273,20 @@ void ConnectionHandler::InitiatorControlCb(uint8_t handle, uint8_t event, device_map_.erase(handle); } break; case AVRC_BROWSE_OPEN_IND_EVT: case AVRC_BROWSE_OPEN_IND_EVT: { LOG(INFO) << __PRETTY_FUNCTION__ << ": Browse Open Event"; // NOTE (apanicke): We don't need to explicitly handle this message // since the AVCTP Layer will still send us browsing messages // regardless. It would be useful to note this though for future // compatibility issues. break; if (device_map_.find(handle) == device_map_.end()) { LOG(WARNING) << "Browse Opened received from device that doesn't exist"; return; } auto browse_mtu = avrc_->GetBrowseMtu(handle) - AVCT_HDR_LEN; device_map_[handle]->SetBrowseMtu(browse_mtu); } break; case AVRC_BROWSE_CLOSE_IND_EVT: LOG(INFO) << __PRETTY_FUNCTION__ << ": Browse Close Event"; break; Loading Loading @@ -357,13 +364,20 @@ void ConnectionHandler::AcceptorControlCb(uint8_t handle, uint8_t event, device_map_.erase(handle); } break; case AVRC_BROWSE_OPEN_IND_EVT: case AVRC_BROWSE_OPEN_IND_EVT: { LOG(INFO) << __PRETTY_FUNCTION__ << ": Browse Open Event"; // NOTE (apanicke): We don't need to explicitly handle this message // since the AVCTP Layer will still send us browsing messages // regardless. It would be useful to note this though for future // compatibility issues. break; if (device_map_.find(handle) == device_map_.end()) { LOG(WARNING) << "Browse Opened received from device that doesn't exist"; return; } auto browse_mtu = avrc_->GetBrowseMtu(handle) - AVCT_HDR_LEN; device_map_[handle]->SetBrowseMtu(browse_mtu); } break; case AVRC_BROWSE_CLOSE_IND_EVT: LOG(INFO) << __PRETTY_FUNCTION__ << ": Browse Close Event"; break; Loading system/profile/avrcp/device.cc +5 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,11 @@ void Device::RegisterInterfaces(MediaInterface* media_interface, volume_interface_ = volume_interface; } void Device::SetBrowseMtu(uint16_t browse_mtu) { DEVICE_LOG(INFO) << __PRETTY_FUNCTION__ << ": browse_mtu = " << browse_mtu; browse_mtu_ = browse_mtu; } bool Device::IsActive() const { return address_ == a2dp_interface_->active_peer(); } Loading system/profile/avrcp/device.h +6 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,12 @@ class Device { A2dpInterface* a2dp_interface, VolumeInterface* volume_interface); /** * Set the maximum size of a AVRCP Browsing Packet. This is done after the * connection of the Browsing channel. */ void SetBrowseMtu(uint16_t browse_mtu); /** * Notify the device that metadata, play_status, and/or queue have updated * via a boolean. Each boolean represents whether its respective content has Loading Loading
system/profile/avrcp/connection_handler.cc +18 −4 Original line number Diff line number Diff line Loading @@ -273,13 +273,20 @@ void ConnectionHandler::InitiatorControlCb(uint8_t handle, uint8_t event, device_map_.erase(handle); } break; case AVRC_BROWSE_OPEN_IND_EVT: case AVRC_BROWSE_OPEN_IND_EVT: { LOG(INFO) << __PRETTY_FUNCTION__ << ": Browse Open Event"; // NOTE (apanicke): We don't need to explicitly handle this message // since the AVCTP Layer will still send us browsing messages // regardless. It would be useful to note this though for future // compatibility issues. break; if (device_map_.find(handle) == device_map_.end()) { LOG(WARNING) << "Browse Opened received from device that doesn't exist"; return; } auto browse_mtu = avrc_->GetBrowseMtu(handle) - AVCT_HDR_LEN; device_map_[handle]->SetBrowseMtu(browse_mtu); } break; case AVRC_BROWSE_CLOSE_IND_EVT: LOG(INFO) << __PRETTY_FUNCTION__ << ": Browse Close Event"; break; Loading Loading @@ -357,13 +364,20 @@ void ConnectionHandler::AcceptorControlCb(uint8_t handle, uint8_t event, device_map_.erase(handle); } break; case AVRC_BROWSE_OPEN_IND_EVT: case AVRC_BROWSE_OPEN_IND_EVT: { LOG(INFO) << __PRETTY_FUNCTION__ << ": Browse Open Event"; // NOTE (apanicke): We don't need to explicitly handle this message // since the AVCTP Layer will still send us browsing messages // regardless. It would be useful to note this though for future // compatibility issues. break; if (device_map_.find(handle) == device_map_.end()) { LOG(WARNING) << "Browse Opened received from device that doesn't exist"; return; } auto browse_mtu = avrc_->GetBrowseMtu(handle) - AVCT_HDR_LEN; device_map_[handle]->SetBrowseMtu(browse_mtu); } break; case AVRC_BROWSE_CLOSE_IND_EVT: LOG(INFO) << __PRETTY_FUNCTION__ << ": Browse Close Event"; break; Loading
system/profile/avrcp/device.cc +5 −0 Original line number Diff line number Diff line Loading @@ -59,6 +59,11 @@ void Device::RegisterInterfaces(MediaInterface* media_interface, volume_interface_ = volume_interface; } void Device::SetBrowseMtu(uint16_t browse_mtu) { DEVICE_LOG(INFO) << __PRETTY_FUNCTION__ << ": browse_mtu = " << browse_mtu; browse_mtu_ = browse_mtu; } bool Device::IsActive() const { return address_ == a2dp_interface_->active_peer(); } Loading
system/profile/avrcp/device.h +6 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,12 @@ class Device { A2dpInterface* a2dp_interface, VolumeInterface* volume_interface); /** * Set the maximum size of a AVRCP Browsing Packet. This is done after the * connection of the Browsing channel. */ void SetBrowseMtu(uint16_t browse_mtu); /** * Notify the device that metadata, play_status, and/or queue have updated * via a boolean. Each boolean represents whether its respective content has Loading