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_capability_gsm.cc b/cellular_capability_gsm.cc
index c79501b..34c5877 100644
--- a/cellular_capability_gsm.cc
+++ b/cellular_capability_gsm.cc
@@ -135,6 +135,11 @@
 }
 
 void CellularCapabilityGSM::OnServiceCreated() {
+  // If IMSI is available, base the service's storage identifier on it.
+  if (!imsi_.empty()) {
+    cellular()->service()->SetStorageIdentifier(
+        "cellular_" + cellular()->address() + "_" + imsi_);
+  }
   cellular()->service()->SetActivationState(
       flimflam::kActivationStateActivated);
   UpdateServingOperator();