| Index: device/media_transfer_protocol/media_transfer_protocol_manager.cc
|
| diff --git a/device/media_transfer_protocol/media_transfer_protocol_manager.cc b/device/media_transfer_protocol/media_transfer_protocol_manager.cc
|
| index 6c0210af1e0613f64439b24237f424642671f8dc..2b20296756a642b0c028e09665ba41951f5fc086 100644
|
| --- a/device/media_transfer_protocol/media_transfer_protocol_manager.cc
|
| +++ b/device/media_transfer_protocol/media_transfer_protocol_manager.cc
|
| @@ -50,16 +50,18 @@ class MediaTransferProtocolManagerImpl : public MediaTransferProtocolManager {
|
| session_bus_ = new dbus::Bus(options);
|
| #endif
|
|
|
| - // Listen for future mtpd service owner changes, in case it is not
|
| - // available right now. There is no guarantee on Linux or ChromeOS that
|
| - // mtpd is running already.
|
| - mtpd_owner_changed_callback_ =
|
| - base::Bind(&MediaTransferProtocolManagerImpl::FinishSetupOnOriginThread,
|
| - weak_ptr_factory_.GetWeakPtr());
|
| - GetBus()->ListenForServiceOwnerChange(mtpd::kMtpdServiceName,
|
| - mtpd_owner_changed_callback_);
|
| - GetBus()->GetServiceOwner(mtpd::kMtpdServiceName,
|
| - mtpd_owner_changed_callback_);
|
| + if (GetBus()) {
|
| + // Listen for future mtpd service owner changes, in case it is not
|
| + // available right now. There is no guarantee on Linux or ChromeOS that
|
| + // mtpd is running already.
|
| + mtpd_owner_changed_callback_ = base::Bind(
|
| + &MediaTransferProtocolManagerImpl::FinishSetupOnOriginThread,
|
| + weak_ptr_factory_.GetWeakPtr());
|
| + GetBus()->ListenForServiceOwnerChange(mtpd::kMtpdServiceName,
|
| + mtpd_owner_changed_callback_);
|
| + GetBus()->GetServiceOwner(mtpd::kMtpdServiceName,
|
| + mtpd_owner_changed_callback_);
|
| + }
|
| }
|
|
|
| virtual ~MediaTransferProtocolManagerImpl() {
|
| @@ -428,9 +430,7 @@ class MediaTransferProtocolManagerImpl : public MediaTransferProtocolManager {
|
|
|
| current_mtpd_owner_ = mtpd_service_owner;
|
|
|
| - mtp_client_.reset(
|
| - MediaTransferProtocolDaemonClient::Create(GetBus(),
|
| - false /* not stub */));
|
| + mtp_client_.reset(MediaTransferProtocolDaemonClient::Create(GetBus()));
|
|
|
| // Set up signals and start initializing |storage_info_map_|.
|
| mtp_client_->SetUpConnections(
|
|
|