return avrc_->FindService(
UUID_SERVCLASS_AV_REMOTE_CONTROL, bdaddr, &db_params,
- base::Bind(&ConnectionHandler::SdpCb, base::Unretained(this),
- bdaddr, cb, disc_db)) == AVRC_SUCCESS;
+ base::Bind(&ConnectionHandler::SdpCb,
+ weak_ptr_factory_.GetWeakPtr(), bdaddr, cb, disc_db)) ==
+ AVRC_SUCCESS;
}
bool ConnectionHandler::AvrcpConnect(bool initiator, const RawAddress& bdaddr) {
weak_ptr_factory_.GetWeakPtr());
}
open_cb.msg_cback =
- base::Bind(&ConnectionHandler::MessageCb, base::Unretained(this));
+ base::Bind(&ConnectionHandler::MessageCb, weak_ptr_factory_.GetWeakPtr());
open_cb.company_id = AVRC_CO_GOOGLE;
open_cb.conn = initiator ? AVRC_CONN_INT
: AVRC_CONN_ACP; // 0 if initiator, 1 if acceptor
LOG(INFO) << __PRETTY_FUNCTION__ << ": Connection Opened Event";
auto&& callback = base::Bind(&ConnectionHandler::SendMessage,
- base::Unretained(this), handle);
+ weak_ptr_factory_.GetWeakPtr(), handle);
auto&& ctrl_mtu = avrc_->GetPeerMtu(handle) - AVCT_HDR_LEN;
auto&& browse_mtu = avrc_->GetBrowseMtu(handle) - AVCT_HDR_LEN;
std::shared_ptr<Device> newDevice = std::make_shared<Device>(