shill: Framework for asynchronous service side RPC calls.
Use the framework to switch EnterPIN to return asynchronously.
Also, added a few try/catch clauses around DBus proxy calls to ease testing and
debugging. They should go away as we transition to asynchronous proxy calls.
BUG=chromium-os:17263
TEST=unit tests, tested on device
Change-Id: I4177c5b91e23c31838b03689de729932c859a936
Reviewed-on: https://gerrit.chromium.org/gerrit/12541
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Eric Shienbrood <ers@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
diff --git a/cellular.cc b/cellular.cc
index e5d8070..3158f4b 100644
--- a/cellular.cc
+++ b/cellular.cc
@@ -201,7 +201,11 @@
void Cellular::EnableModem() {
CHECK_EQ(kStateDisabled, state_);
// TODO(petkov): Switch to asynchronous calls (crosbug.com/17583).
- proxy_->Enable(true);
+ try {
+ proxy_->Enable(true);
+ } catch (const DBus::Error e) {
+ LOG(WARNING) << "Enable failed: " << e.what();
+ }
SetState(kStateEnabled);
}
@@ -239,8 +243,9 @@
capability_->RequirePIN(pin, require, error);
}
-void Cellular::EnterPIN(const string &pin, Error *error) {
- capability_->EnterPIN(pin, error);
+void Cellular::EnterPIN(const string &pin, ReturnerInterface *returner) {
+ VLOG(2) << __func__ << "(" << returner << ")";
+ capability_->EnterPIN(pin, returner);
}
void Cellular::UnblockPIN(