Bug 1370111 - Set 'started' telemetry timestamp before attempting to talk to the Token Server r=nalexander draft
authorGrigory Kruglov <gkruglov@mozilla.com>
Mon, 05 Jun 2017 19:51:27 -0400
changeset 589710 fdf22f1cdc2a5eba3ada1339aeefcc23c2debfe7
parent 589687 c511ad826fe71ba2bb956d2e1c119e86d2266aba
child 589711 da73247ae0a27ba6ae3d6ad0d8814c1e2249e722
push id62477
push userbmo:gkruglov@mozilla.com
push dateTue, 06 Jun 2017 17:26:27 +0000
reviewersnalexander
bugs1370111
milestone55.0a1
Bug 1370111 - Set 'started' telemetry timestamp before attempting to talk to the Token Server r=nalexander MozReview-Commit-ID: E0vN1NY10WA
mobile/android/services/src/main/java/org/mozilla/gecko/fxa/sync/FxAccountSyncAdapter.java
--- a/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/sync/FxAccountSyncAdapter.java
+++ b/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/sync/FxAccountSyncAdapter.java
@@ -419,17 +419,16 @@ public class FxAccountSyncAdapter extend
           final SyncConfiguration syncConfig = new SyncConfiguration(token.uid, authHeaderProvider, sharedPrefs, syncKeyBundle);
 
           Collection<String> knownStageNames = SyncConfiguration.validEngineNames();
           syncConfig.stagesToSync = Utils.getStagesToSyncFromBundle(knownStageNames, extras);
           syncConfig.setClusterURL(storageServerURI);
 
           globalSession = new GlobalSession(syncConfig, callback, context, clientsDataDelegate, telemetryCollector);
           telemetryCollector.setIDs(token.hashedFxaUid, clientsDataDelegate.getAccountGUID());
-          telemetryCollector.setStarted(SystemClock.elapsedRealtime());
           globalSession.start(syncDeadline);
         } catch (Exception e) {
           callback.handleError(globalSession, e);
           return;
         }
       }
 
       @Override
@@ -465,17 +464,17 @@ public class FxAccountSyncAdapter extend
         // value for token server scheduling.
         tokenBackoffHandler.setEarliestNextRequest(delay(backoffSeconds * 1000));
       }
 
       private long delay(long delay) {
         return System.currentTimeMillis() + delay;
       }
     };
-
+    telemetryCollector.setStarted(SystemClock.elapsedRealtime());
     TokenServerClient tokenServerclient = new TokenServerClient(tokenServerEndpointURI, executor);
     tokenServerclient.getTokenFromBrowserIDAssertion(assertion, true, clientState, delegate);
   }
 
   public void maybeRegisterDevice(Context context, AndroidFxAccount fxAccount) {
     // Register the device if necessary (asynchronous, in another thread).
     // As part of device registration, we obtain a PushSubscription, register our push endpoint
     // with FxA, and update account data with fxaDeviceId, which is part of our synced