shill: Fix the cellular service storage identifier.

This CL fixes a few issues:

- It bases the default cellular service storage identifier on the friendly
  service name.

- If service is GSM and IMSI is available, use it instead of the friendly name.

- Fix a bug where all legal characters in the storage identifier were replaced
  by "_" (rather than all illegal characters).

BUG=chromium-os:24952
TEST=unit tests

Change-Id: Ie55cb2b4f2dafb73545ac285a57674063946ceb3
Reviewed-on: https://gerrit.chromium.org/gerrit/15151
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_service.h b/cellular_service.h
index 7f4a2d6..a067973 100644
--- a/cellular_service.h
+++ b/cellular_service.h
@@ -38,8 +38,8 @@
                                      ReturnerInterface *returner);
   virtual bool TechnologyIs(const Technology::Identifier type) const;
 
-  // cellular_<MAC>_<Service_Operator_Name>
-  std::string GetStorageIdentifier() const;
+  virtual std::string GetStorageIdentifier() const;
+  void SetStorageIdentifier(const std::string &identifier);
 
   void SetActivationState(const std::string &state);
   const std::string &activation_state() const { return activation_state_; }
@@ -80,6 +80,8 @@
   std::map<std::string, std::string> apn_info_;
   std::map<std::string, std::string> last_good_apn_info_;
 
+  std::string storage_identifier_;
+
   CellularRefPtr cellular_;
 
   DISALLOW_COPY_AND_ASSIGN(CellularService);