Loading system/btif/avrcp/avrcp_service.cc +4 −7 Original line number Diff line number Diff line Loading @@ -352,9 +352,8 @@ void AvrcpService::SendMediaUpdate(bool track_changed, bool play_state, // device update happens on the main thread. for (const auto& device : instance_->connection_handler_->GetListOfDevices()) { do_in_main_thread(FROM_HERE, base::Bind(&Device::SendMediaUpdate, base::Unretained(device.get()), track_changed, play_state, queue)); do_in_main_thread(FROM_HERE, base::Bind(&Device::SendMediaUpdate, device.get()->Get(), track_changed, play_state, queue)); } } Loading @@ -368,10 +367,8 @@ void AvrcpService::SendFolderUpdate(bool available_players, // Ensure that the update is posted to the correct thread for (const auto& device : instance_->connection_handler_->GetListOfDevices()) { do_in_main_thread( FROM_HERE, base::Bind(&Device::SendFolderUpdate, base::Unretained(device.get()), available_players, addressed_players, uids)); do_in_main_thread(FROM_HERE, base::Bind(&Device::SendFolderUpdate, device.get()->Get(), available_players, addressed_players, uids)); } } Loading system/profile/avrcp/device.cc +4 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,10 @@ void Device::RegisterInterfaces(MediaInterface* media_interface, volume_interface_ = volume_interface; } base::WeakPtr<Device> Device::Get() { return weak_ptr_factory_.GetWeakPtr(); } void Device::SetBrowseMtu(uint16_t browse_mtu) { DEVICE_LOG(INFO) << __PRETTY_FUNCTION__ << ": browse_mtu = " << browse_mtu; browse_mtu_ = browse_mtu; Loading system/profile/avrcp/device.h +6 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,12 @@ class Device { uint16_t ctrl_mtu, uint16_t browse_mtu); virtual ~Device() = default; /** * Gets a weak pointer to this device that is invalidated when the device is * disconnected. */ base::WeakPtr<Device> Get(); const RawAddress& GetAddress() const { return address_; }; /** Loading Loading
system/btif/avrcp/avrcp_service.cc +4 −7 Original line number Diff line number Diff line Loading @@ -352,9 +352,8 @@ void AvrcpService::SendMediaUpdate(bool track_changed, bool play_state, // device update happens on the main thread. for (const auto& device : instance_->connection_handler_->GetListOfDevices()) { do_in_main_thread(FROM_HERE, base::Bind(&Device::SendMediaUpdate, base::Unretained(device.get()), track_changed, play_state, queue)); do_in_main_thread(FROM_HERE, base::Bind(&Device::SendMediaUpdate, device.get()->Get(), track_changed, play_state, queue)); } } Loading @@ -368,10 +367,8 @@ void AvrcpService::SendFolderUpdate(bool available_players, // Ensure that the update is posted to the correct thread for (const auto& device : instance_->connection_handler_->GetListOfDevices()) { do_in_main_thread( FROM_HERE, base::Bind(&Device::SendFolderUpdate, base::Unretained(device.get()), available_players, addressed_players, uids)); do_in_main_thread(FROM_HERE, base::Bind(&Device::SendFolderUpdate, device.get()->Get(), available_players, addressed_players, uids)); } } Loading
system/profile/avrcp/device.cc +4 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,10 @@ void Device::RegisterInterfaces(MediaInterface* media_interface, volume_interface_ = volume_interface; } base::WeakPtr<Device> Device::Get() { return weak_ptr_factory_.GetWeakPtr(); } void Device::SetBrowseMtu(uint16_t browse_mtu) { DEVICE_LOG(INFO) << __PRETTY_FUNCTION__ << ": browse_mtu = " << browse_mtu; browse_mtu_ = browse_mtu; Loading
system/profile/avrcp/device.h +6 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,12 @@ class Device { uint16_t ctrl_mtu, uint16_t browse_mtu); virtual ~Device() = default; /** * Gets a weak pointer to this device that is invalidated when the device is * disconnected. */ base::WeakPtr<Device> Get(); const RawAddress& GetAddress() const { return address_; }; /** Loading