shill: Remove Cellular's obsolete |type_| data member.
Also, some cleanup and renaming.
BUG=chromium-os:18735
TEST=unit tests
Change-Id: Ia201113a9514c884a69209a2fd06a01068e8bd14
Reviewed-on: https://gerrit.chromium.org/gerrit/11901
Commit-Ready: Darin Petkov <petkov@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
diff --git a/cellular_capability_cdma.cc b/cellular_capability_cdma.cc
index 27b7ea3..551caaa 100644
--- a/cellular_capability_cdma.cc
+++ b/cellular_capability_cdma.cc
@@ -25,21 +25,30 @@
registration_state_evdo_(MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN),
registration_state_1x_(MM_MODEM_CDMA_REGISTRATION_STATE_UNKNOWN),
prl_version_(0) {
+ VLOG(2) << "Cellular capability constructed: CDMA";
PropertyStore *store = cellular->mutable_store();
store->RegisterConstUint16(flimflam::kPRLVersionProperty, &prl_version_);
}
-void CellularCapabilityCDMA::OnStart() {
+void CellularCapabilityCDMA::OnDeviceStarted() {
VLOG(2) << __func__;
proxy_.reset(proxy_factory()->CreateModemCDMAProxy(
this, cellular()->dbus_path(), cellular()->dbus_owner()));
}
-void CellularCapabilityCDMA::OnStop() {
+void CellularCapabilityCDMA::OnDeviceStopped() {
VLOG(2) << __func__;
proxy_.reset();
}
+void CellularCapabilityCDMA::OnServiceCreated() {
+ VLOG(2) << __func__;
+ cellular()->service()->set_payment_url(payment_url_);
+ cellular()->service()->set_usage_url(usage_url_);
+ UpdateServingOperator();
+ HandleNewActivationState(MM_MODEM_CDMA_ACTIVATION_ERROR_NO_ERROR);
+}
+
void CellularCapabilityCDMA::UpdateStatus(const DBusPropertiesMap &properties) {
string carrier;
if (DBusProperties::GetString(properties, "carrier", &carrier)) {
@@ -51,9 +60,9 @@
DBusProperties::GetUint32(
properties, "activation_state", &activation_state_);
DBusProperties::GetUint16(properties, "prl_version", &prl_version_);
- // TODO(petkov): For now, get the payment and usage URLs from ModemManager
- // to match flimflam. In the future, provide a plugin API to get these
- // directly from the modem driver.
+ // TODO(petkov): For now, get the payment and usage URLs from ModemManager to
+ // match flimflam. In the future, get these from an alternative source (e.g.,
+ // database, carrier-specific properties, etc.).
DBusProperties::GetString(properties, "payment_url", &payment_url_);
DBusProperties::GetString(properties, "usage_url", &usage_url_);
}
@@ -144,7 +153,7 @@
if (cellular()->meid().empty()) {
// TODO(petkov): Switch to asynchronous calls (crosbug.com/17583).
cellular()->set_meid(proxy_->MEID());
- VLOG(2) << "MEID: " << cellular()->imei();
+ VLOG(2) << "MEID: " << cellular()->meid();
}
}
@@ -206,14 +215,6 @@
}
}
-void CellularCapabilityCDMA::OnServiceCreated() {
- VLOG(2) << __func__;
- cellular()->service()->set_payment_url(payment_url_);
- cellular()->service()->set_usage_url(usage_url_);
- UpdateServingOperator();
- HandleNewActivationState(MM_MODEM_CDMA_ACTIVATION_ERROR_NO_ERROR);
-}
-
void CellularCapabilityCDMA::OnCDMAActivationStateChanged(
uint32 activation_state,
uint32 activation_error,