cellular_capability_universal.h revision c7b1560b03c070fad239767f868322e6b3bdd932
182f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
282f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow// Use of this source code is governed by a BSD-style license that can be
382f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow// found in the LICENSE file.
482f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
5145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow#ifndef SHILL_CELLULAR_CAPABILITY_UNIVERSAL_H_
6145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow#define SHILL_CELLULAR_CAPABILITY_UNIVERSAL_H_
782f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
882f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow#include <deque>
9af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow#include <map>
1082f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow#include <string>
1182f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow#include <vector>
1282f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
1382f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow#include <base/memory/scoped_ptr.h>
1482f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow#include <base/memory/weak_ptr.h>
1582f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow#include <gtest/gtest_prod.h>  // for FRIEND_TEST
165c853ef21b9247d2ad3d60736b3dea77b8681ed8Ben Chan#include <ModemManager/ModemManager.h>
1782f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
1882f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow#include "shill/accessor_interface.h"
1982f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow#include "shill/cellular.h"
2082f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow#include "shill/cellular_capability.h"
216e5639f9ef54db278c5f2265d5364e5994966f4aArman Uguray#include "shill/mm1_bearer_proxy_interface.h"
2282f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow#include "shill/mm1_modem_modem3gpp_proxy_interface.h"
2382f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow#include "shill/mm1_modem_modemcdma_proxy_interface.h"
2482f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow#include "shill/mm1_modem_proxy_interface.h"
2582f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow#include "shill/mm1_modem_simple_proxy_interface.h"
2682f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow#include "shill/mm1_sim_proxy_interface.h"
2782f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
2882f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
2982f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgowstruct mobile_provider;
3082f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
3182f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgownamespace shill {
3282f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
33c7b1560b03c070fad239767f868322e6b3bdd932Arman Ugurayclass ActivatingIccidStore;
34c7b1560b03c070fad239767f868322e6b3bdd932Arman Uguray
3582f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow// CellularCapabilityUniversal handles modems using the
3682f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow// org.chromium.ModemManager1 DBUS interface.  This class is used for
3782f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow// all types of modems, i.e. CDMA, GSM, and LTE modems.
3882f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgowclass CellularCapabilityUniversal : public CellularCapability {
3982f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow public:
4082f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  typedef std::vector<DBusPropertiesMap> ScanResults;
4182f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  typedef DBusPropertiesMap ScanResult;
42af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  typedef std::map< uint32_t, uint32_t > LockRetryData;
4382f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
44145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  // Constants used in connect method call.  Make available to test matchers.
45145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  // TODO(jglasgow): Generate from modem manager into
46145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  // ModemManager-names.h.
47145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  // See http://crosbug.com/30551.
48145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  static const char kConnectPin[];
49145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  static const char kConnectOperatorId[];
50145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  static const char kConnectBands[];
51145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  static const char kConnectAllowedModes[];
52145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  static const char kConnectPreferredMode[];
53145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  static const char kConnectApn[];
54145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  static const char kConnectIPType[];
55145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  static const char kConnectUser[];
56145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  static const char kConnectPassword[];
57145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  static const char kConnectNumber[];
58145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  static const char kConnectAllowRoaming[];
59145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  static const char kConnectRMProtocol[];
60145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow
61ce4483e054058ab3f6d940c7aa2e7b5697af325aThieu Le  CellularCapabilityUniversal(Cellular *cellular,
62ce4483e054058ab3f6d940c7aa2e7b5697af325aThieu Le                              ProxyFactory *proxy_factory,
63c7b1560b03c070fad239767f868322e6b3bdd932Arman Uguray                              Metrics *metrics,
64c7b1560b03c070fad239767f868322e6b3bdd932Arman Uguray                              ActivatingIccidStore *activating_iccid_store);
6582f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
6682f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  // Inherited from CellularCapability.
67e285a84b38b81f5557b576da187d037ad24ae4afGary Morain  // Checks the modem state.  If the state is kModemStateDisabled, then the
68e285a84b38b81f5557b576da187d037ad24ae4afGary Morain  // modem is enabled.  Otherwise, the enable command is buffered until the
69e285a84b38b81f5557b576da187d037ad24ae4afGary Morain  // modem becomes disabled.  ModemManager rejects the enable command if the
70e285a84b38b81f5557b576da187d037ad24ae4afGary Morain  // modem is not disabled, for exmaple, if it is initializing insted.
7182f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual void StartModem(Error *error, const ResultCallback &callback);
7282f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual void StopModem(Error *error, const ResultCallback &callback);
7382f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual void Connect(const DBusPropertiesMap &properties, Error *error,
7482f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow                       const ResultCallback &callback);
7582f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual void Disconnect(Error *error, const ResultCallback &callback);
768a46890363301a4e28fe3175e194703409e344dcChristopher Wiley  virtual void DisconnectCleanup();
7782f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual void Activate(const std::string &carrier,
7882f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow                        Error *error, const ResultCallback &callback);
79c7b1560b03c070fad239767f868322e6b3bdd932Arman Uguray  virtual void CompleteActivation(Error *error);
8082f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
8182f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual void OnServiceCreated();
8282f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual void SetupConnectProperties(DBusPropertiesMap *properties);
83ef96556fff984bbc79597669af2465905666ed09Jason Glasgow  virtual void GetProperties();
8415786033dc85e3dd7fea18ba936957b8b2c34e29Ben Chan  virtual bool IsServiceActivationRequired() const;
8582f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual void Register(const ResultCallback &callback);
8682f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
8782f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual void RegisterOnNetwork(const std::string &network_id,
8882f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow                                 Error *error,
8982f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow                                 const ResultCallback &callback);
9082f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual bool IsRegistered();
917fce52c4afdc5e73a9e740dc9b90f1e61ae8cea4Eric Shienbrood  virtual void SetUnregistered(bool searching);
9282f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual std::string CreateFriendlyServiceName();
9382f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual void RequirePIN(const std::string &pin, bool require,
9482f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow                          Error *error, const ResultCallback &callback);
9582f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual void EnterPIN(const std::string &pin,
9682f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow                        Error *error, const ResultCallback &callback);
9782f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual void UnblockPIN(const std::string &unblock_code,
9882f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow                          const std::string &pin,
9982f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow                          Error *error, const ResultCallback &callback);
10082f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual void ChangePIN(const std::string &old_pin,
10182f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow                         const std::string &new_pin,
10282f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow                         Error *error, const ResultCallback &callback);
1035d0d32c1b5e2370ff0739f7a2dbb641726d4bf87Ben Chan  virtual void Reset(Error *error, const ResultCallback &callback);
10482f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
10582f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual void Scan(Error *error, const ResultCallback &callback);
10682f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual std::string GetNetworkTechnologyString() const;
10782f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual std::string GetRoamingStateString() const;
10882f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual void GetSignalQuality();
1099f09aeffcd088960c5b1a7d507c3705ce14b2b0dJason Glasgow  virtual std::string GetTypeString() const;
11082f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual void OnDBusPropertiesChanged(
11182f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow      const std::string &interface,
11282f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow      const DBusPropertiesMap &changed_properties,
11382f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow      const std::vector<std::string> &invalidated_properties);
114af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  virtual bool AllowRoaming();
115145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow
11682f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow protected:
11782f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual void InitProxies();
11882f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  virtual void ReleaseProxies();
11982f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
12082f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow private:
121cd0349c9bafcb5c250da25691ada7fcc3752e145Jason Glasgow  // Constants used in scan results.  Make available to unit tests.
122cd0349c9bafcb5c250da25691ada7fcc3752e145Jason Glasgow  // TODO(jglasgow): Generate from modem manager into ModemManager-names.h.
123cd0349c9bafcb5c250da25691ada7fcc3752e145Jason Glasgow  // See http://crosbug.com/30551.
124cd0349c9bafcb5c250da25691ada7fcc3752e145Jason Glasgow  static const char kStatusProperty[];
125cd0349c9bafcb5c250da25691ada7fcc3752e145Jason Glasgow  static const char kOperatorLongProperty[];
126cd0349c9bafcb5c250da25691ada7fcc3752e145Jason Glasgow  static const char kOperatorShortProperty[];
127cd0349c9bafcb5c250da25691ada7fcc3752e145Jason Glasgow  static const char kOperatorCodeProperty[];
128cd0349c9bafcb5c250da25691ada7fcc3752e145Jason Glasgow  static const char kOperatorAccessTechnologyProperty[];
129cd0349c9bafcb5c250da25691ada7fcc3752e145Jason Glasgow
130145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  // Modem Model ID strings.  From modem firmware via modemmanager.
131145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  static const char kE362ModelId[];
132145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow
1332717a10096e12e46413adf47b39c5b19cd33bce7Arman Uguray  // Generic service name prefix, shown when the correct carrier name is
1342717a10096e12e46413adf47b39c5b19cd33bce7Arman Uguray  // unknown.
1352717a10096e12e46413adf47b39c5b19cd33bce7Arman Uguray  static const char kGenericServiceNamePrefix[];
1362717a10096e12e46413adf47b39c5b19cd33bce7Arman Uguray
1371361c0366043f3d2628dc7c339339116ce31085eArman Uguray  static const unsigned int kDefaultScanningOrSearchingTimeoutMilliseconds;
138ee464d3c77dc7662973bfa5cb3c6eeb207366eacArman Uguray  static const int kSetPowerStateTimeoutSeconds;
139ee464d3c77dc7662973bfa5cb3c6eeb207366eacArman Uguray
1401361c0366043f3d2628dc7c339339116ce31085eArman Uguray
1416552f8c74196782e9adf09f4fea01c836f551255Arman Uguray  // Root path. The SIM path is reported by ModemManager to be the root path
1426552f8c74196782e9adf09f4fea01c836f551255Arman Uguray  // when no SIM is present.
1436552f8c74196782e9adf09f4fea01c836f551255Arman Uguray  static const char kRootPath[];
1446552f8c74196782e9adf09f4fea01c836f551255Arman Uguray
14582f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  friend class CellularTest;
14682f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  friend class CellularCapabilityTest;
1473d27539b13590e0b149440ce017fdc401ef6e735Thieu Le  friend class CellularCapabilityUniversalTest;
1481361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, AllowRoaming);
1491361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, Connect);
1501361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, ConnectApns);
1511361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, CreateFriendlyServiceName);
1521361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, DisconnectNoProxy);
1531361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, GetTypeString);
154c7b1560b03c070fad239767f868322e6b3bdd932Arman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, IsMdnValid);
1551361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, IsServiceActivationRequired);
1566552f8c74196782e9adf09f4fea01c836f551255Arman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, IsValidSimPath);
157d759252158ec07b4a9edbcfdfb265f010b3e7e13Ben Chan  FRIEND_TEST(CellularCapabilityUniversalMainTest, NormalizeMdn);
1581361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, OnListBearersReply);
1591361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest,
160fcca27bd166ce485d9ef8afce5e060be935ece97Ben Chan              OnModemCurrentCapabilitiesChanged);
1611361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, PropertiesChanged);
1621361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, Reset);
1631361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, Scan);
1641361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, ScanFailure);
1651361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, SetHomeProvider);
1661361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, SimLockStatusChanged);
1671361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, SimPathChanged);
1681361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, SimPropertiesChanged);
1691361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, StartModem);
1701361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, StopModem);
1711361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, StopModemConnected);
172c7b1560b03c070fad239767f868322e6b3bdd932Arman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, UpdateIccidActivationState);
1731361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, UpdateServiceName);
1741361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, UpdateStorageIdentifier);
1751361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, UpdateOLP);
1761361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, UpdateOperatorInfo);
1771361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest,
1781361c0366043f3d2628dc7c339339116ce31085eArman Uguray              UpdateOperatorInfoViaOperatorId);
1791361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalMainTest, UpdateScanningProperty);
1801361c0366043f3d2628dc7c339339116ce31085eArman Uguray  FRIEND_TEST(CellularCapabilityUniversalTimerTest,
1811361c0366043f3d2628dc7c339339116ce31085eArman Uguray              UpdateScanningPropertyTimeout);
18209fa2a0e9c0feed7b3ca23fc7d8ad59783f4c6a7Ben Chan  FRIEND_TEST(CellularTest,
18309fa2a0e9c0feed7b3ca23fc7d8ad59783f4c6a7Ben Chan              HandleNewRegistrationStateForServiceRequiringActivation);
1845218cf2bb1301197e0e3c9381bc4c66e8adf80b0Thieu Le  FRIEND_TEST(CellularTest, ModemStateChangeLostRegistration);
18582f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
186ef96556fff984bbc79597669af2465905666ed09Jason Glasgow  // Methods used in starting a modem
187e285a84b38b81f5557b576da187d037ad24ae4afGary Morain  void EnableModem(Error *error, const ResultCallback &callback);
188ef96556fff984bbc79597669af2465905666ed09Jason Glasgow  void Start_EnableModemCompleted(const ResultCallback &callback,
189ef96556fff984bbc79597669af2465905666ed09Jason Glasgow                                  const Error &error);
190ef96556fff984bbc79597669af2465905666ed09Jason Glasgow
191ef96556fff984bbc79597669af2465905666ed09Jason Glasgow  // Methods used in stopping a modem
192ef96556fff984bbc79597669af2465905666ed09Jason Glasgow  void Stop_DisconnectCompleted(const ResultCallback &callback,
193ef96556fff984bbc79597669af2465905666ed09Jason Glasgow                               const Error &error);
194ef96556fff984bbc79597669af2465905666ed09Jason Glasgow  void Stop_Disable(const ResultCallback &callback);
195ef96556fff984bbc79597669af2465905666ed09Jason Glasgow  void Stop_DisableCompleted(const ResultCallback &callback,
196ef96556fff984bbc79597669af2465905666ed09Jason Glasgow                             const Error &error);
197ee464d3c77dc7662973bfa5cb3c6eeb207366eacArman Uguray  void Stop_PowerDown(const ResultCallback &callback);
198ee464d3c77dc7662973bfa5cb3c6eeb207366eacArman Uguray  void Stop_PowerDownCompleted(const ResultCallback &callback,
199ee464d3c77dc7662973bfa5cb3c6eeb207366eacArman Uguray                               const Error &error);
200ef96556fff984bbc79597669af2465905666ed09Jason Glasgow
2012717a10096e12e46413adf47b39c5b19cd33bce7Arman Uguray  // Updates the name property that is exposed by the service to Chrome.
2022717a10096e12e46413adf47b39c5b19cd33bce7Arman Uguray  void UpdateServiceName();
2032717a10096e12e46413adf47b39c5b19cd33bce7Arman Uguray
2048a2c01e2d7fb27724f529adc3a0aa2daba9b1b44Ben Chan  void UpdateScanningProperty();
2058a2c01e2d7fb27724f529adc3a0aa2daba9b1b44Ben Chan
206d73783fb016a4c9d7d8644db83c8caeb447b0063Arman Uguray  // Methods used in acquiring information related to the carrier;
207d73783fb016a4c9d7d8644db83c8caeb447b0063Arman Uguray
2086d0d1e7f24c2c3ad491392997cd2b05cc0460ea1Ben Chan  // Updates the online payment portal information, if any, for the cellular
2096d0d1e7f24c2c3ad491392997cd2b05cc0460ea1Ben Chan  // provider.
2106d0d1e7f24c2c3ad491392997cd2b05cc0460ea1Ben Chan  void UpdateOLP();
2116d0d1e7f24c2c3ad491392997cd2b05cc0460ea1Ben Chan
21282f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  // Updates the Universal operator name and country based on a newly
21382f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  // obtained network id.
21482f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  void UpdateOperatorInfo();
21582f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
216d73783fb016a4c9d7d8644db83c8caeb447b0063Arman Uguray  // Sets the upper level information about the home cellular provider from the
217d73783fb016a4c9d7d8644db83c8caeb447b0063Arman Uguray  // modem's IMSI and SPN.
218d73783fb016a4c9d7d8644db83c8caeb447b0063Arman Uguray  void SetHomeProvider();
219d73783fb016a4c9d7d8644db83c8caeb447b0063Arman Uguray
22082f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  // Updates the serving operator on the active service.
22182f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  void UpdateServingOperator();
22282f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
223d73783fb016a4c9d7d8644db83c8caeb447b0063Arman Uguray  // Initializes the |apn_list_| property based on the current |home_provider_|.
224d73783fb016a4c9d7d8644db83c8caeb447b0063Arman Uguray  void InitAPNList();
225d73783fb016a4c9d7d8644db83c8caeb447b0063Arman Uguray
2266e5639f9ef54db278c5f2265d5364e5994966f4aArman Uguray  // Updates |bearer_path_| to match the currently active bearer.
2276e5639f9ef54db278c5f2265d5364e5994966f4aArman Uguray  void UpdateBearerPath();
2286e5639f9ef54db278c5f2265d5364e5994966f4aArman Uguray
229c953357b248a9559c95097892d1458ff1a4e43bfArman Uguray  // Updates the storage identifier used for the current cellular service.
230c953357b248a9559c95097892d1458ff1a4e43bfArman Uguray  void UpdateStorageIdentifier();
231c953357b248a9559c95097892d1458ff1a4e43bfArman Uguray
23282f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
23382f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  Stringmap ParseScanResult(const ScanResult &result);
23482f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
23582f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  KeyValueStore SimLockStatusToProperty(Error *error);
23682f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
23782f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  void SetupApnTryList();
23882f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  void FillConnectPropertyMap(DBusPropertiesMap *properties);
23982f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
24082f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  void HelpRegisterDerivedKeyValueStore(
24182f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow      const std::string &name,
24282f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow      KeyValueStore(CellularCapabilityUniversal::*get)(Error *error),
24382f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow      void(CellularCapabilityUniversal::*set)(
24482f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow          const KeyValueStore &value, Error *error));
24582f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
246145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  // Returns true if a connect error should be retried.  This function
247145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  // abstracts modem specific behavior for modems which do a lousy job
248145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  // of returning specific errors on connect failures.
249145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  bool RetriableConnectError(const Error &error) const;
250145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow
25182f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  // Signal callbacks
2523022be5da0e7e158c7f8fc4e3f5d005eb5dde7e7Nathan Williams  void OnNetworkModeSignal(uint32 mode);
2537fce52c4afdc5e73a9e740dc9b90f1e61ae8cea4Eric Shienbrood  void OnModemStateChangedSignal(int32 old_state,
2547fce52c4afdc5e73a9e740dc9b90f1e61ae8cea4Eric Shienbrood                                 int32 new_state,
2557fce52c4afdc5e73a9e740dc9b90f1e61ae8cea4Eric Shienbrood                                 uint32 reason);
25682f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
25782f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  // Property Change notification handlers
2583022be5da0e7e158c7f8fc4e3f5d005eb5dde7e7Nathan Williams  void OnModemPropertiesChanged(
2594c0724af38d0eaf7155bb789280940a41ef9f08cJason Glasgow      const DBusPropertiesMap &properties,
2604c0724af38d0eaf7155bb789280940a41ef9f08cJason Glasgow      const std::vector<std::string> &invalidated_properties);
2614c0724af38d0eaf7155bb789280940a41ef9f08cJason Glasgow
2623022be5da0e7e158c7f8fc4e3f5d005eb5dde7e7Nathan Williams  void OnSignalQualityChanged(uint32 quality);
26382f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
264ef96556fff984bbc79597669af2465905666ed09Jason Glasgow  // Updates the sim_path_ variable and creates a new proxy to the
265ef96556fff984bbc79597669af2465905666ed09Jason Glasgow  // DBUS ModemManager1.Sim interface
2663022be5da0e7e158c7f8fc4e3f5d005eb5dde7e7Nathan Williams  void OnSimPathChanged(const std::string &sim_path);
267af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnModemCapabilitesChanged(uint32 capabilities);
268af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnModemCurrentCapabilitiesChanged(uint32 current_capabilities);
269af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnMdnChanged(const std::string &mdn);
270af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnModemManufacturerChanged(const std::string &manufacturer);
271af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnModemModelChanged(const std::string &model);
272af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnModemRevisionChanged(const std::string &revision);
273af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnModemStateChanged(Cellular::ModemState state);
274af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnAccessTechnologiesChanged(uint32 access_technologies);
275af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnSupportedModesChanged(uint32 supported_modes);
276af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnAllowedModesChanged(uint32 allowed_modes);
277af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnPreferredModeChanged(MMModemMode preferred_mode);
278af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnLockRetriesChanged(MMModemLock unlock_required,
279af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow                            const LockRetryData &lock_retries);
280af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnSimLockStatusChanged();
281af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow
282c7b1560b03c070fad239767f868322e6b3bdd932Arman Uguray  // Returns false if the MDN is empty or if the MDN consists of all 0s.
283c7b1560b03c070fad239767f868322e6b3bdd932Arman Uguray  bool IsMdnValid() const;
284c7b1560b03c070fad239767f868322e6b3bdd932Arman Uguray
285af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  // 3GPP property change handlers
286af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  virtual void OnModem3GPPPropertiesChanged(
287af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow      const DBusPropertiesMap &properties,
288af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow      const std::vector<std::string> &invalidated_properties);
289af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnImeiChanged(const std::string &imei);
290af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void On3GPPRegistrationChanged(MMModem3gppRegistrationState state,
291af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow                                 const std::string &operator_code,
292af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow                                 const std::string &operator_name);
293af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnFacilityLocksChanged(uint32 locks);
294af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow
295af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  // SIM property change handlers
296af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnSimPropertiesChanged(
297af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow      const DBusPropertiesMap &props,
298af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow      const std::vector<std::string> &invalidated_properties);
299af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnImsiChanged(const std::string &imsi);
300d73783fb016a4c9d7d8644db83c8caeb447b0063Arman Uguray  void OnSpnChanged(const std::string &spn);
301af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnSimIdentifierChanged(const std::string &id);
302af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnOperatorIdChanged(const std::string &operator_id);
303af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  void OnOperatorNameChanged(const std::string &operator_name);
304ef96556fff984bbc79597669af2465905666ed09Jason Glasgow
30582f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  // Method callbacks
3063022be5da0e7e158c7f8fc4e3f5d005eb5dde7e7Nathan Williams  void OnRegisterReply(const ResultCallback &callback,
3073022be5da0e7e158c7f8fc4e3f5d005eb5dde7e7Nathan Williams                       const Error &error);
3085d0d32c1b5e2370ff0739f7a2dbb641726d4bf87Ben Chan  void OnResetReply(const ResultCallback &callback, const Error &error);
3093022be5da0e7e158c7f8fc4e3f5d005eb5dde7e7Nathan Williams  void OnScanReply(const ResultCallback &callback,
3103022be5da0e7e158c7f8fc4e3f5d005eb5dde7e7Nathan Williams                   const ScanResults &results,
3113022be5da0e7e158c7f8fc4e3f5d005eb5dde7e7Nathan Williams                   const Error &error);
312b54974f033f713690135f3f3516ca14aa7ee6cfdNathan Williams  void OnConnectReply(const ResultCallback &callback,
313b54974f033f713690135f3f3516ca14aa7ee6cfdNathan Williams                      const DBus::Path &bearer,
314b54974f033f713690135f3f3516ca14aa7ee6cfdNathan Williams                      const Error &error);
3156e5639f9ef54db278c5f2265d5364e5994966f4aArman Uguray  void OnListBearersReply(const std::vector<DBus::Path> &paths,
3166e5639f9ef54db278c5f2265d5364e5994966f4aArman Uguray                          const Error &error);
31782f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
3181361c0366043f3d2628dc7c339339116ce31085eArman Uguray  // Timeout callback for the network scan initiated when Cellular connectivity
3191361c0366043f3d2628dc7c339339116ce31085eArman Uguray  // gets enabled.
3201361c0366043f3d2628dc7c339339116ce31085eArman Uguray  void OnScanningOrSearchingTimeout();
3211361c0366043f3d2628dc7c339339116ce31085eArman Uguray
3226552f8c74196782e9adf09f4fea01c836f551255Arman Uguray  // Returns true, if |sim_path| constitutes a valid SIM path. Currently, a
3236552f8c74196782e9adf09f4fea01c836f551255Arman Uguray  // path is accepted to be valid, as long as it is not equal to one of ""
3246552f8c74196782e9adf09f4fea01c836f551255Arman Uguray  // and "/".
3256552f8c74196782e9adf09f4fea01c836f551255Arman Uguray  bool IsValidSimPath(const std::string &sim_path) const;
3266552f8c74196782e9adf09f4fea01c836f551255Arman Uguray
327d759252158ec07b4a9edbcfdfb265f010b3e7e13Ben Chan  // Returns the normalized version of |mdn| by keeping only digits in |mdn|
328d759252158ec07b4a9edbcfdfb265f010b3e7e13Ben Chan  // and removing other non-digit characters.
329d759252158ec07b4a9edbcfdfb265f010b3e7e13Ben Chan  std::string NormalizeMdn(const std::string &mdn) const;
330d759252158ec07b4a9edbcfdfb265f010b3e7e13Ben Chan
3312717a10096e12e46413adf47b39c5b19cd33bce7Arman Uguray  static std::string GenerateNewGenericServiceName();
3322717a10096e12e46413adf47b39c5b19cd33bce7Arman Uguray
333c7b1560b03c070fad239767f868322e6b3bdd932Arman Uguray  // Post-payment activation handlers.
334c7b1560b03c070fad239767f868322e6b3bdd932Arman Uguray  void UpdateIccidActivationState();
335c7b1560b03c070fad239767f868322e6b3bdd932Arman Uguray  void ResetAfterActivation();
336c7b1560b03c070fad239767f868322e6b3bdd932Arman Uguray  void OnResetAfterActivationReply(const Error &error);
337c7b1560b03c070fad239767f868322e6b3bdd932Arman Uguray
33882f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  scoped_ptr<mm1::ModemModem3gppProxyInterface> modem_3gpp_proxy_;
33982f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  scoped_ptr<mm1::ModemModemCdmaProxyInterface> modem_cdma_proxy_;
34082f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  scoped_ptr<mm1::ModemProxyInterface> modem_proxy_;
34182f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  scoped_ptr<mm1::ModemSimpleProxyInterface> modem_simple_proxy_;
34282f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  scoped_ptr<mm1::SimProxyInterface> sim_proxy_;
34382f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
34482f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  base::WeakPtrFactory<CellularCapabilityUniversal> weak_ptr_factory_;
34582f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
34682f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  MMModem3gppRegistrationState registration_state_;
34782f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  MMModemCdmaRegistrationState cdma_registration_state_;
348af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow
349af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  // Bits based on MMModemCapabilities
350145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  uint32 capabilities_;          // technologies supported, may require reload
351145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  uint32 current_capabilities_;  // technologies supportsed without a reload
352145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  uint32 access_technologies_;   // Bits based on MMModemAccessTechnology
353145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  uint32 supported_modes_;       // Bits based on MMModemMode
354145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  uint32 allowed_modes_;         // Bits based on MMModemMode
355145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow  MMModemMode preferred_mode_;   // A single MMModemMode bit
356af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow
35782f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  Cellular::Operator serving_operator_;
35882f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  std::string spn_;
359af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  std::string sim_identifier_;
360af5832853cf49fcfa34632a736aa4763ef2347d6Jason Glasgow  std::string operator_id_;
36182f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  mobile_provider *home_provider_;
362f508c8273e6265599f184189a424e697598eb980Darin Petkov  bool provider_requires_roaming_;
36382f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  std::string desired_network_;
36482f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
36582f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  // Properties.
36682f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  std::string carrier_;
36782f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  std::string esn_;
36882f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  std::string firmware_revision_;
36982f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  std::string hardware_revision_;
37082f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  std::string imei_;
37182f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  std::string imsi_;
37282f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  std::string manufacturer_;
37382f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  std::string mdn_;
37482f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  std::string meid_;
37582f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  std::string min_;
37682f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  std::string model_id_;
37782f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  std::string selected_network_;
37882f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  Stringmaps found_networks_;
37982f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  std::deque<Stringmap> apn_try_list_;
3805d0d32c1b5e2370ff0739f7a2dbb641726d4bf87Ben Chan  bool resetting_;
38182f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  bool scanning_supported_;
38282f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  bool scanning_;
3838a2c01e2d7fb27724f529adc3a0aa2daba9b1b44Ben Chan  bool scanning_or_searching_;
38482f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  uint16 scan_interval_;
38582f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  SimLockStatus sim_lock_status_;
38682f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  Stringmaps apn_list_;
387ef96556fff984bbc79597669af2465905666ed09Jason Glasgow  std::string sim_path_;
388bd3aee80be371d838863eccf708fd107153503efBen Chan  bool sim_present_;
389b54974f033f713690135f3f3516ca14aa7ee6cfdNathan Williams  DBus::Path bearer_path_;
39082f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
391c7b1560b03c070fad239767f868322e6b3bdd932Arman Uguray  // Post-payment activation state.
392c7b1560b03c070fad239767f868322e6b3bdd932Arman Uguray  ActivatingIccidStore *activating_iccid_store_;
393c7b1560b03c070fad239767f868322e6b3bdd932Arman Uguray  bool reset_done_;
394c7b1560b03c070fad239767f868322e6b3bdd932Arman Uguray
395e285a84b38b81f5557b576da187d037ad24ae4afGary Morain  // If the modem is not in a state to be enabled when StartModem is called,
396e285a84b38b81f5557b576da187d037ad24ae4afGary Morain  // enabling is deferred using this callback.
397e285a84b38b81f5557b576da187d037ad24ae4afGary Morain  base::Closure deferred_enable_modem_callback_;
398e285a84b38b81f5557b576da187d037ad24ae4afGary Morain
3991361c0366043f3d2628dc7c339339116ce31085eArman Uguray  // Sometimes modems may be stuck in the SEARCHING state during the lack of
4001361c0366043f3d2628dc7c339339116ce31085eArman Uguray  // presence of a network. During this indefinite duration of time, keeping
4011361c0366043f3d2628dc7c339339116ce31085eArman Uguray  // the Device.Scanning property as |true| causes a bad user experience.
4021361c0366043f3d2628dc7c339339116ce31085eArman Uguray  // This callback sets it to |false| after a timeout period has passed.
4031361c0366043f3d2628dc7c339339116ce31085eArman Uguray  base::CancelableClosure scanning_or_searching_timeout_callback_;
4041361c0366043f3d2628dc7c339339116ce31085eArman Uguray  unsigned int scanning_or_searching_timeout_milliseconds_;
4051361c0366043f3d2628dc7c339339116ce31085eArman Uguray
40682f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  static unsigned int friendly_service_name_id_;
40782f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
40882f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow  DISALLOW_COPY_AND_ASSIGN(CellularCapabilityUniversal);
40982f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow};
41082f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
41182f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow}  // namespace shill
41282f9ab3f404c8f414348c6effdc57c4d3b9223d7Jason Glasgow
413145218710c2daa27ab55690f2ca372200d2a4cdfJason Glasgow#endif  // SHILL_CELLULAR_CAPABILITY_UNIVERSAL_H_
414