Commit 4b7ead02 authored by Ben Chan's avatar Ben Chan Committed by Commit Bot

Remove bindings to shill's deprecated Device.ProposeScan DBus method.

shill's Device.ProposeScan DBus method has been deprecated and
superseded by the Device.RequestScan DBus method.

BUG=763198
TEST=chromeos_unittests

Change-Id: I9ae4a115ee2e0f14a10f06a5bdbe4e48b21bba83
Reviewed-on: https://chromium-review.googlesource.com/701622Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506791}
parent 0de0d3db
......@@ -95,12 +95,6 @@ void FakeShillDeviceClient::GetProperties(
weak_ptr_factory_.GetWeakPtr(), device_path, callback));
}
void FakeShillDeviceClient::ProposeScan(const dbus::ObjectPath& device_path,
VoidDBusMethodCallback callback) {
// Deprecated.
PostVoidCallback(std::move(callback), DBUS_METHOD_CALL_SUCCESS);
}
void FakeShillDeviceClient::SetProperty(const dbus::ObjectPath& device_path,
const std::string& name,
const base::Value& value,
......
......@@ -35,8 +35,6 @@ class CHROMEOS_EXPORT FakeShillDeviceClient
ShillPropertyChangedObserver* observer) override;
void GetProperties(const dbus::ObjectPath& device_path,
const DictionaryValueCallback& callback) override;
void ProposeScan(const dbus::ObjectPath& device_path,
VoidDBusMethodCallback callback) override;
void SetProperty(const dbus::ObjectPath& device_path,
const std::string& name,
const base::Value& value,
......
......@@ -66,13 +66,6 @@ class ShillDeviceClientImpl : public ShillDeviceClient {
GetHelper(device_path)->CallDictionaryValueMethod(&method_call, callback);
}
void ProposeScan(const dbus::ObjectPath& device_path,
VoidDBusMethodCallback callback) override {
dbus::MethodCall method_call(shill::kFlimflamDeviceInterface,
shill::kProposeScanFunction);
GetHelper(device_path)->CallVoidMethod(&method_call, std::move(callback));
}
void SetProperty(const dbus::ObjectPath& device_path,
const std::string& name,
const base::Value& value,
......
......@@ -92,11 +92,6 @@ class CHROMEOS_EXPORT ShillDeviceClient : public DBusClient {
virtual void GetProperties(const dbus::ObjectPath& device_path,
const DictionaryValueCallback& callback) = 0;
// Calls ProposeScan method.
// |callback| is called after the method call finishes.
virtual void ProposeScan(const dbus::ObjectPath& device_path,
VoidDBusMethodCallback callback) = 0;
// Calls SetProperty method.
// |callback| is called after the method call finishes.
virtual void SetProperty(const dbus::ObjectPath& device_path,
......
......@@ -139,21 +139,6 @@ TEST_F(ShillDeviceClientTest, GetProperties) {
base::RunLoop().RunUntilIdle();
}
TEST_F(ShillDeviceClientTest, ProposeScan) {
// Create response.
std::unique_ptr<dbus::Response> response(dbus::Response::CreateEmpty());
// Set expectations.
PrepareForMethodCall(shill::kProposeScanFunction,
base::Bind(&ExpectNoArgument),
response.get());
// Call method.
client_->ProposeScan(dbus::ObjectPath(kExampleDevicePath),
base::Bind(&ExpectNoResultValue));
// Run the message loop.
base::RunLoop().RunUntilIdle();
}
TEST_F(ShillDeviceClientTest, SetProperty) {
const bool kValue = true;
// Create response.
......
......@@ -27,11 +27,6 @@ void FakeNetworkDeviceHandler::RequestRefreshIPConfigs(
const base::Closure& callback,
const network_handler::ErrorCallback& error_callback) {}
void FakeNetworkDeviceHandler::ProposeScan(
const std::string& device_path,
const base::Closure& callback,
const network_handler::ErrorCallback& error_callback) {}
void FakeNetworkDeviceHandler::RegisterCellularNetwork(
const std::string& device_path,
const std::string& network_id,
......
......@@ -37,11 +37,6 @@ class CHROMEOS_EXPORT FakeNetworkDeviceHandler : public NetworkDeviceHandler {
const base::Closure& callback,
const network_handler::ErrorCallback& error_callback) override;
void ProposeScan(
const std::string& device_path,
const base::Closure& callback,
const network_handler::ErrorCallback& error_callback) override;
void RegisterCellularNetwork(
const std::string& device_path,
const std::string& network_id,
......
......@@ -41,11 +41,6 @@ class CHROMEOS_EXPORT MockNetworkDeviceHandler : public NetworkDeviceHandler {
const base::Closure& callback,
const network_handler::ErrorCallback& error_callback));
MOCK_METHOD3(ProposeScan,
void(const std::string& device_path,
const base::Closure& callback,
const network_handler::ErrorCallback& error_callback));
MOCK_METHOD4(RegisterCellularNetwork,
void(const std::string& device_path,
const std::string& network_id,
......
......@@ -77,21 +77,6 @@ class CHROMEOS_EXPORT NetworkDeviceHandler {
const base::Closure& callback,
const network_handler::ErrorCallback& error_callback) = 0;
// Requests a network scan on the device specified by |device_path|.
// For cellular networks, the result of this call gets asynchronously stored
// in the corresponding DeviceState object through a property update. For all
// other technologies a service gets created for each found network, which
// can be accessed through the corresponding NetworkState object.
//
// TODO(armansito): Device.ProposeScan is deprecated and the preferred method
// of requesting a network scan is Manager.RequestScan, however shill
// currently doesn't support cellular network scans via Manager.RequestScan.
// Remove this method once shill supports it (crbug.com/262356).
virtual void ProposeScan(
const std::string& device_path,
const base::Closure& callback,
const network_handler::ErrorCallback& error_callback) = 0;
// Tells the device specified by |device_path| to register to the cellular
// network with id |network_id|. If |network_id| is empty then registration
// will proceed in automatic mode, which will cause the modem to register
......
......@@ -109,24 +109,6 @@ void RefreshIPConfigsCallback(
callback.Run();
}
void ProposeScanCallback(
const std::string& device_path,
const base::Closure& callback,
const network_handler::ErrorCallback& error_callback,
DBusMethodCallStatus call_status) {
if (call_status != DBUS_METHOD_CALL_SUCCESS) {
network_handler::ShillErrorCallbackFunction(
"Device.ProposeScan Failed",
device_path,
error_callback,
base::StringPrintf("DBus call failed: %d", call_status), "");
return;
}
NET_LOG(EVENT) << "Device.ProposeScan succeeded: " << device_path;
if (!callback.is_null())
callback.Run();
}
void SetDevicePropertyInternal(
const std::string& device_path,
const std::string& property_name,
......@@ -331,15 +313,6 @@ void NetworkDeviceHandlerImpl::RequestRefreshIPConfigs(
error_callback);
}
void NetworkDeviceHandlerImpl::ProposeScan(
const std::string& device_path,
const base::Closure& callback,
const network_handler::ErrorCallback& error_callback) {
DBusThreadManager::Get()->GetShillDeviceClient()->ProposeScan(
dbus::ObjectPath(device_path),
base::Bind(&ProposeScanCallback, device_path, callback, error_callback));
}
void NetworkDeviceHandlerImpl::RegisterCellularNetwork(
const std::string& device_path,
const std::string& network_id,
......
......@@ -46,11 +46,6 @@ class CHROMEOS_EXPORT NetworkDeviceHandlerImpl
const base::Closure& callback,
const network_handler::ErrorCallback& error_callback) override;
void ProposeScan(
const std::string& device_path,
const base::Closure& callback,
const network_handler::ErrorCallback& error_callback) override;
void RegisterCellularNetwork(
const std::string& device_path,
const std::string& network_id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment