Remove deprecated FormatDevice DBus method.
The FormatDevice DBus method has long been removed from cros-disks
(CL:12022). Chrome has recently been updated to deprecate the use of
FormatDevice DBus method as well (crrev.com/268623).
BUG=chromium:369877
TEST=Tested the following:
1. Insert a USB drive and format the mounted partition via Files.app.
Verify that Files.app notifies the successful completion of the
format operation.
2. Insert a write-protected SD card and format the mounted partition via
Files.app. Verify that Files.app reports an error.
Change-Id: I3c01d1850abc5c7f41a8a91fbbbfc826d0bf50a5
Reviewed-on: https://chromium-review.googlesource.com/198606
Reviewed-by: Toni Barzic <tbarzic@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
diff --git a/cros_disks_server.cc b/cros_disks_server.cc
index 1a25611..46ed55a 100644
--- a/cros_disks_server.cc
+++ b/cros_disks_server.cc
@@ -51,13 +51,6 @@
const string& filesystem_type,
const vector<string>& options,
DBus::Error &error) { // NOLINT
- FormatDevice(path, filesystem_type, error);
-}
-
-// TODO(benchan): Remove this method after Chrome switches to use Format().
-bool CrosDisksServer::FormatDevice(const string& path,
- const string& filesystem_type,
- DBus::Error &error) { // NOLINT
FormatErrorType error_type = FORMAT_ERROR_NONE;
Disk disk;
if (!disk_manager_->GetDiskByDevicePath(path, &disk)) {
@@ -75,9 +68,7 @@
LOG(ERROR) << "Could not format device '" << path
<< "' as filesystem '" << filesystem_type << "'";
FormatCompleted(error_type, path);
- return false;
}
- return true;
}
void CrosDisksServer::Mount(const string& path,
diff --git a/cros_disks_server.h b/cros_disks_server.h
index 243e110..645dfc0 100644
--- a/cros_disks_server.h
+++ b/cros_disks_server.h
@@ -67,13 +67,6 @@
const std::vector<std::string>& options,
DBus::Error& error); // NOLINT
- // A method for asynchronous formatting device using specified file system.
- // Assumes device path is valid (should it be invalid singal
- // FormattingFinished(false) will be sent)
- // Return true if formatting is successfully INITIALIZED, rather than finished
- virtual bool FormatDevice(const std::string& device_path,
- const std::string& filesystem, ::DBus::Error &error); // NOLINT
-
// A method for checking if the daemon is running. Always returns true.
virtual bool IsAlive(DBus::Error& error); // NOLINT
diff --git a/dbus_bindings/org.chromium.CrosDisks.xml b/dbus_bindings/org.chromium.CrosDisks.xml
index 53197fa..b06820f 100644
--- a/dbus_bindings/org.chromium.CrosDisks.xml
+++ b/dbus_bindings/org.chromium.CrosDisks.xml
@@ -72,18 +72,6 @@
<arg name="options" type="as" direction="in">
</arg>
</method>
- <method name="FormatDevice">
- <arg name="devicePath" type="s" direction="in">
- </arg>
- <arg name="filesystem" type="s" direction="in">
- </arg>
- <arg name="result" type="b" direction="out">
- <tp:docstring>
- This variable indicates that the formatting was succesfully
- initialized, rather than successfully finished.
- </tp:docstring>
- </arg>
- </method>
<method name="IsAlive">
<tp:docstring>
Test method to verify that CrosDisks service is working.
diff --git a/org.chromium.CrosDisks.conf b/org.chromium.CrosDisks.conf
index 5929ad5..b1baa50 100644
--- a/org.chromium.CrosDisks.conf
+++ b/org.chromium.CrosDisks.conf
@@ -29,9 +29,6 @@
send_member="Format" />
<allow send_destination="org.chromium.CrosDisks"
send_interface="org.chromium.CrosDisks"
- send_member="FormatDevice" />
- <allow send_destination="org.chromium.CrosDisks"
- send_interface="org.chromium.CrosDisks"
send_member="GetDeviceProperties" />
<allow send_destination="org.chromium.CrosDisks"
send_interface="org.chromium.CrosDisks"