shill: Move PIN management to the capability delegates.
BUG=chromium-os:18735
TEST=unit tests
Change-Id: Icdaca0ee95f56d84e15a10029551a0abeaee79c1
Reviewed-on: https://gerrit.chromium.org/gerrit/11261
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Eric Shienbrood <ers@chromium.org>
Commit-Ready: Darin Petkov <petkov@chromium.org>
diff --git a/cellular_capability.h b/cellular_capability.h
index 32dd661..f12a4cf 100644
--- a/cellular_capability.h
+++ b/cellular_capability.h
@@ -5,11 +5,15 @@
#ifndef SHILL_CELLULAR_CAPABILITY_
#define SHILL_CELLULAR_CAPABILITY_
+#include <string>
+
#include <base/basictypes.h>
namespace shill {
class Cellular;
+class Error;
+class EventDispatcher;
class ProxyFactory;
// Cellular devices instantiate subclasses of CellularCapability that handle the
@@ -22,10 +26,21 @@
Cellular *cellular() const { return cellular_; }
ProxyFactory *proxy_factory() const { return proxy_factory_; }
+ EventDispatcher *dispatcher() const;
// Initialize RPC proxies.
virtual void InitProxies() = 0;
+ // PIN management. The default implementation fails by populating |error|.
+ virtual void RequirePIN(const std::string &pin, bool require, Error *error);
+ virtual void EnterPIN(const std::string &pin, Error *error);
+ virtual void UnblockPIN(const std::string &unblock_code,
+ const std::string &pin,
+ Error *error);
+ virtual void ChangePIN(const std::string &old_pin,
+ const std::string &new_pin,
+ Error *error);
+
private:
Cellular *cellular_;
ProxyFactory *proxy_factory_;