diff options
author | rkc@chromium.org <rkc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-16 07:54:18 +0000 |
---|---|---|
committer | rkc@chromium.org <rkc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-16 07:54:18 +0000 |
commit | 4cd381921c85e549af1554dcbc32c4fdf2a1393b (patch) | |
tree | 86bf754e8444bddc368ac31c063368e44a06171e /chromeos | |
parent | 4f6b75104e8d5d185670bdf05e64b36d82b6d7ca (diff) | |
download | chromium_src-4cd381921c85e549af1554dcbc32c4fdf2a1393b.zip chromium_src-4cd381921c85e549af1554dcbc32c4fdf2a1393b.tar.gz chromium_src-4cd381921c85e549af1554dcbc32c4fdf2a1393b.tar.bz2 |
Change the modem reset command on cellular activation completion.
Instead of calling ModemReset on completing activation for an LTE modem, instead call the new CompleteCellularActivation shill service method.
R=gspencer@chromium.org,benchan@chromium.org
BUG=172526
Review URL: https://chromiumcodereview.appspot.com/12279012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182956 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
-rw-r--r-- | chromeos/dbus/mock_shill_service_client.h | 4 | ||||
-rw-r--r-- | chromeos/dbus/shill_service_client.cc | 12 | ||||
-rw-r--r-- | chromeos/dbus/shill_service_client.h | 7 | ||||
-rw-r--r-- | chromeos/dbus/shill_service_client_stub.cc | 9 | ||||
-rw-r--r-- | chromeos/dbus/shill_service_client_stub.h | 4 | ||||
-rw-r--r-- | chromeos/network/cros_network_functions.cc | 7 | ||||
-rw-r--r-- | chromeos/network/cros_network_functions.h | 3 | ||||
-rw-r--r-- | chromeos/network/cros_network_functions_unittest.cc | 9 |
8 files changed, 55 insertions, 0 deletions
diff --git a/chromeos/dbus/mock_shill_service_client.h b/chromeos/dbus/mock_shill_service_client.h index 96e2e57..fc94ed9 100644 --- a/chromeos/dbus/mock_shill_service_client.h +++ b/chromeos/dbus/mock_shill_service_client.h @@ -53,6 +53,10 @@ class MockShillServiceClient : public ShillServiceClient { const std::string& carrier, const base::Closure& callback, const ErrorCallback& error_callback)); + MOCK_METHOD3(CompleteCellularActivation, + void(const dbus::ObjectPath& service_path, + const base::Closure& callback, + const ErrorCallback& error_callback)); MOCK_METHOD2(CallActivateCellularModemAndBlock, bool(const dbus::ObjectPath& service_path, const std::string& carrier)); diff --git a/chromeos/dbus/shill_service_client.cc b/chromeos/dbus/shill_service_client.cc index fa0cb7a..7b628b5 100644 --- a/chromeos/dbus/shill_service_client.cc +++ b/chromeos/dbus/shill_service_client.cc @@ -159,6 +159,18 @@ class ShillServiceClientImpl : public ShillServiceClient { error_callback); } + virtual void CompleteCellularActivation( + const dbus::ObjectPath& service_path, + const base::Closure& callback, + const ErrorCallback& error_callback) OVERRIDE { + dbus::MethodCall method_call(flimflam::kFlimflamServiceInterface, + shill::kCompleteCellularActivationFunction); + dbus::MessageWriter writer(&method_call); + GetHelper(service_path)->CallVoidMethodWithErrorCallback(&method_call, + callback, + error_callback); + } + virtual bool CallActivateCellularModemAndBlock( const dbus::ObjectPath& service_path, const std::string& carrier) OVERRIDE { diff --git a/chromeos/dbus/shill_service_client.h b/chromeos/dbus/shill_service_client.h index 07c1cba..b12cc37 100644 --- a/chromeos/dbus/shill_service_client.h +++ b/chromeos/dbus/shill_service_client.h @@ -127,6 +127,13 @@ class CHROMEOS_EXPORT ShillServiceClient { const base::Closure& callback, const ErrorCallback& error_callback) = 0; + // Calls the CompleteCellularActivation method. + // |callback| is called after the method call succeeds. + virtual void CompleteCellularActivation( + const dbus::ObjectPath& service_path, + const base::Closure& callback, + const ErrorCallback& error_callback) = 0; + // DEPRECATED DO NOT USE: Calls ActivateCellularModem method and blocks until // the method call finishes. // diff --git a/chromeos/dbus/shill_service_client_stub.cc b/chromeos/dbus/shill_service_client_stub.cc index edf4227..0883693 100644 --- a/chromeos/dbus/shill_service_client_stub.cc +++ b/chromeos/dbus/shill_service_client_stub.cc @@ -221,6 +221,15 @@ void ShillServiceClientStub::ActivateCellularModem( MessageLoop::current()->PostTask(FROM_HERE, callback); } +void ShillServiceClientStub::CompleteCellularActivation( + const dbus::ObjectPath& service_path, + const base::Closure& callback, + const ErrorCallback& error_callback) { + if (callback.is_null()) + return; + MessageLoop::current()->PostTask(FROM_HERE, callback); +} + bool ShillServiceClientStub::CallActivateCellularModemAndBlock( const dbus::ObjectPath& service_path, const std::string& carrier) { diff --git a/chromeos/dbus/shill_service_client_stub.h b/chromeos/dbus/shill_service_client_stub.h index cc26854..cddaaef 100644 --- a/chromeos/dbus/shill_service_client_stub.h +++ b/chromeos/dbus/shill_service_client_stub.h @@ -58,6 +58,10 @@ class ShillServiceClientStub : public ShillServiceClient, const std::string& carrier, const base::Closure& callback, const ErrorCallback& error_callback) OVERRIDE; + virtual void CompleteCellularActivation( + const dbus::ObjectPath& service_path, + const base::Closure& callback, + const ErrorCallback& error_callback) OVERRIDE; virtual bool CallActivateCellularModemAndBlock( const dbus::ObjectPath& service_path, const std::string& carrier) OVERRIDE; diff --git a/chromeos/network/cros_network_functions.cc b/chromeos/network/cros_network_functions.cc index c38c5e0..43f36ce 100644 --- a/chromeos/network/cros_network_functions.cc +++ b/chromeos/network/cros_network_functions.cc @@ -318,6 +318,13 @@ bool CrosActivateCellularModem(const std::string& service_path, carrier); } +void CrosCompleteCellularActivation(const std::string& service_path) { + return DBusThreadManager::Get()->GetShillServiceClient()-> + CompleteCellularActivation(dbus::ObjectPath(service_path), + base::Bind(&DoNothing), + base::Bind(&IgnoreErrors)); +} + void CrosSetNetworkServiceProperty(const std::string& service_path, const std::string& property, const base::Value& value) { diff --git a/chromeos/network/cros_network_functions.h b/chromeos/network/cros_network_functions.h index ddc4481..09fafc1 100644 --- a/chromeos/network/cros_network_functions.h +++ b/chromeos/network/cros_network_functions.h @@ -62,6 +62,9 @@ class CHROMEOS_EXPORT CrosNetworkWatcher { CHROMEOS_EXPORT bool CrosActivateCellularModem(const std::string& service_path, const std::string& carrier); +// Completes the activation for the cellular modem specified by |service_path|. +CHROMEOS_EXPORT void CrosCompleteCellularActivation( + const std::string& service_path); // Sets a property of a service to the provided value. // Success is indicated by the receipt of a matching PropertyChanged signal. diff --git a/chromeos/network/cros_network_functions_unittest.cc b/chromeos/network/cros_network_functions_unittest.cc index 5c4772d..6a6e8ea 100644 --- a/chromeos/network/cros_network_functions_unittest.cc +++ b/chromeos/network/cros_network_functions_unittest.cc @@ -185,6 +185,15 @@ TEST_F(CrosNetworkFunctionsTest, CrosActivateCellularModem) { EXPECT_TRUE(CrosActivateCellularModem(service_path, carrier)); } +TEST_F(CrosNetworkFunctionsTest, CrosCompleteCellularActivation) { + const std::string service_path = "/"; + EXPECT_CALL(*mock_service_client_, + CompleteCellularActivation(dbus::ObjectPath(service_path), _, _)) + .Times(1); + + CrosCompleteCellularActivation(service_path); +} + TEST_F(CrosNetworkFunctionsTest, CrosSetNetworkServiceProperty) { const std::string service_path = "/"; const std::string property = "property"; |