shill: Decouple Cellular's IsRegistered from the network technology string.
Also, broadcast changes in the cellular service network technology and roaming
state properties.
BUG=chromium-os:23327
TEST=unit tests, tested on device
Change-Id: Ia4c297586dbc9b8a32d297c126c4d791310b5abd
Reviewed-on: https://gerrit.chromium.org/gerrit/12028
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Eric Shienbrood <ers@chromium.org>
diff --git a/cellular_service.cc b/cellular_service.cc
index 2a5ff93..d27a360 100644
--- a/cellular_service.cc
+++ b/cellular_service.cc
@@ -10,6 +10,7 @@
#include <base/stringprintf.h>
#include <chromeos/dbus/service_constants.h>
+#include "shill/adaptor_interfaces.h"
#include "shill/cellular.h"
using std::string;
@@ -33,7 +34,7 @@
store->RegisterConstStringmap(flimflam::kCellularLastGoodApnProperty,
&last_good_apn_info_);
store->RegisterConstString(flimflam::kNetworkTechnologyProperty,
- &network_tech_);
+ &network_technology_);
store->RegisterConstString(flimflam::kPaymentURLProperty, &payment_url_);
store->RegisterConstString(flimflam::kRoamingStateProperty, &roaming_state_);
store->RegisterConstStringmap(flimflam::kServingOperatorProperty,
@@ -72,6 +73,23 @@
return cellular_->GetRpcIdentifier();
}
+void CellularService::SetNetworkTechnology(const string &technology) {
+ if (technology == network_technology_) {
+ return;
+ }
+ network_technology_ = technology;
+ adaptor()->EmitStringChanged(flimflam::kNetworkTechnologyProperty,
+ technology);
+}
+
+void CellularService::SetRoamingState(const string &state) {
+ if (state == roaming_state_) {
+ return;
+ }
+ roaming_state_ = state;
+ adaptor()->EmitStringChanged(flimflam::kRoamingStateProperty, state);
+}
+
const Cellular::Operator &CellularService::serving_operator() const {
return serving_operator_;
}