Bug 1370111 - Set 'started' telemetry timestamp before attempting to talk to the Token Server r=nalexander
MozReview-Commit-ID: E0vN1NY10WA
--- 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