cellular: Upload UMA stats for 3GPP delayed registration drop.

crbug.com/238820 ensures that small glitches in 3GPP bearer registration
do not cause connection drop. These glitches were originally observed
for E362 modem. Upload UMA stats to figure out if the workaround should
be restricted to devices with E362.

BUG=chromium:241231
TEST=(1) build and run unit-tests.
     (2) Check that the following increments the value of
         the histogram Network.Shill.Cellular.3GPPRegistrationDelayedDrop in
         chrome://histograms on DUT.
         - Connect to cellular network on DUT.
         - Move the DUT to an area with bad reception, so that cellular
           connection is dropped.
         - Check that the histogram value for '0' is incremented and value for
           '1' remains unchanged.
     (3) Check that the following increments the value of
         the histogram Network.Shill.Cellular.3GPPRegistrationDelayedDrop in
         chrome://histograms on DUT.
         - Connect to cellular network on DUT.
         - Move the DUT to an area with bad reception so that signal strength
           goes down to 0. Return to an area with good reception within 10
           seconds.
         - Ensure that the cellular connection is never dropped.
         - Check that the histogram values for '0' and '1' are incremented.

Change-Id: Ic24ca0293226cefd4d334aec48a331a8b1f9b401
Reviewed-on: https://gerrit.chromium.org/gerrit/51398
Reviewed-by: Thieu Le <thieule@chromium.org>
Commit-Queue: Prathmesh Prabhu <pprabhu@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
diff --git a/metrics.h b/metrics.h
index 330e0de..58a7eaf 100644
--- a/metrics.h
+++ b/metrics.h
@@ -195,6 +195,12 @@
     kTerminationActionReasonTerminate
   };
 
+  enum Cellular3GPPRegistrationDelayedDrop {
+    kCellular3GPPRegistrationDelayedDropPosted = 0,
+    kCellular3GPPRegistrationDelayedDropCanceled = 1,
+    kCellular3GPPRegistrationDelayedDropMax
+  };
+
   enum CellularDropTechnology {
     kCellularDropTechnology1Xrtt = 0,
     kCellularDropTechnologyEdge = 1,
@@ -367,6 +373,7 @@
   static const char kMetricServiceFixupEntries[];
 
   // Cellular specific statistics.
+  static const char kMetricCellular3GPPRegistrationDelayedDrop[];
   static const char kMetricCellularAutoConnectTries[];
   static const int kMetricCellularAutoConnectTriesMax;
   static const int kMetricCellularAutoConnectTriesMin;
@@ -539,6 +546,10 @@
                                 const std::string &network_technology,
                                 uint16 signal_strength);
 
+  // Notifies this object about 3GPP registration drop events.
+  virtual void Notify3GPPRegistrationDelayedDropPosted();
+  virtual void Notify3GPPRegistrationDelayedDropCanceled();
+
   // Notifies this object about a cellular device failure code.
   void NotifyCellularDeviceFailure(const Error &error);