diff options
Diffstat (limited to 'chromeos/dbus/fake_bluetooth_agent_manager_client.cc')
-rw-r--r-- | chromeos/dbus/fake_bluetooth_agent_manager_client.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/chromeos/dbus/fake_bluetooth_agent_manager_client.cc b/chromeos/dbus/fake_bluetooth_agent_manager_client.cc index 2672ad5..b2bdf96 100644 --- a/chromeos/dbus/fake_bluetooth_agent_manager_client.cc +++ b/chromeos/dbus/fake_bluetooth_agent_manager_client.cc @@ -45,8 +45,11 @@ void FakeBluetoothAgentManagerClient::UnregisterAgent( const base::Closure& callback, const ErrorCallback& error_callback) { VLOG(1) << "UnregisterAgent: " << agent_path.value(); - if (service_provider_ != NULL) { - error_callback.Run(bluetooth_agent_manager::kErrorInvalidArguments, + if (service_provider_ == NULL) { + error_callback.Run(bluetooth_agent_manager::kErrorDoesNotExist, + "No agent registered"); + } else if (service_provider_->object_path_ != agent_path) { + error_callback.Run(bluetooth_agent_manager::kErrorDoesNotExist, "Agent still registered"); } else { callback.Run(); |