Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: chromeos/network/network_configuration_handler.cc

Issue 2836083002: [CrOS Tether] Update NetworkConfigurationHandler::GetShillProperties() to work with Tether networks. (Closed)
Patch Set: stevenjb@ comments. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromeos/network/network_configuration_handler.cc
diff --git a/chromeos/network/network_configuration_handler.cc b/chromeos/network/network_configuration_handler.cc
index 707894cafd04a6632de9ca75dfc29b1ff81cb0c5..f6a128a22cf4048063bc561519e9f143f6f74b27 100644
--- a/chromeos/network/network_configuration_handler.cc
+++ b/chromeos/network/network_configuration_handler.cc
@@ -228,6 +228,20 @@ void NetworkConfigurationHandler::GetShillProperties(
const network_handler::DictionaryResultCallback& callback,
const network_handler::ErrorCallback& error_callback) {
NET_LOG(USER) << "GetShillProperties: " << service_path;
+
+ const NetworkState* network_state =
+ network_state_handler_->GetNetworkState(service_path);
+ if (network_state &&
+ NetworkTypePattern::Tether().MatchesType(network_state->type())) {
+ // If this is a Tether network, use the properties present in the
+ // NetworkState object provided by NetworkStateHandler. Tether networks are
+ // not present in Shill, so the Shill call below will not work.
+ base::DictionaryValue dictionary;
+ network_state->GetStateProperties(&dictionary);
+ callback.Run(service_path, dictionary);
+ return;
+ }
+
DBusThreadManager::Get()->GetShillServiceClient()->GetProperties(
dbus::ObjectPath(service_path),
base::Bind(&NetworkConfigurationHandler::GetPropertiesCallback,

Powered by Google App Engine
This is Rietveld 408576698