Index: device/media_transfer_protocol/media_transfer_protocol_daemon_client.cc |
diff --git a/device/media_transfer_protocol/media_transfer_protocol_daemon_client.cc b/device/media_transfer_protocol/media_transfer_protocol_daemon_client.cc |
index 832d5984e64980789f032676f0b374dcf90ffc45..8c2b2d9139e7faa073aae86f07aa8b9514499fae 100644 |
--- a/device/media_transfer_protocol/media_transfer_protocol_daemon_client.cc |
+++ b/device/media_transfer_protocol/media_transfer_protocol_daemon_client.cc |
@@ -171,6 +171,22 @@ class MediaTransferProtocolDaemonClientImpl |
error_callback)); |
} |
+ void RenameObject(const std::string& handle, |
+ const uint32 object_id, |
+ const std::string& new_name, |
+ const RenameObjectCallback& callback, |
+ const ErrorCallback& error_callback) override { |
+ dbus::MethodCall method_call(mtpd::kMtpdInterface, mtpd::kRenameObject); |
+ dbus::MessageWriter writer(&method_call); |
+ writer.AppendString(handle); |
+ writer.AppendUint32(object_id); |
+ writer.AppendString(new_name); |
+ proxy_->CallMethod( |
+ &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
+ base::Bind(&MediaTransferProtocolDaemonClientImpl::OnRenameObject, |
+ weak_ptr_factory_.GetWeakPtr(), callback, error_callback)); |
+ } |
+ |
void CopyFileFromLocal(const std::string& handle, |
const int source_file_descriptor, |
const uint32 parent_id, |
@@ -385,6 +401,17 @@ class MediaTransferProtocolDaemonClientImpl |
callback.Run(data); |
} |
+ void OnRenameObject(const RenameObjectCallback& callback, |
+ const ErrorCallback& error_callback, |
+ dbus::Response* response) { |
+ if (!response) { |
+ error_callback.Run(); |
+ return; |
+ } |
+ |
+ callback.Run(); |
+ } |
+ |
void OnCopyFileFromLocal(const CopyFileFromLocalCallback& callback, |
const ErrorCallback& error_callback, |
dbus::Response* response) { |