class ParseAnalytics {

  public static Task<Void> trackAppOpenedInBackground(Intent intent) {
    String pushHashStr = getPushHashFromIntent(intent);
    final Capture<String> pushHash = new Capture<>();
    if (pushHashStr != null && pushHashStr.length() > 0) {
      synchronized (lruSeenPushes) {
        if (lruSeenPushes.containsKey(pushHashStr)) {
          return Task.forResult(null);
        } else {
          lruSeenPushes.put(pushHashStr, true);
          pushHash.set(pushHashStr);
        }
      }
    }
    return ParseUser.getCurrentSessionTokenAsync().onSuccessTask(new Continuation<String, Task<Void>>() {
      @Override
      public Task<Void> then(Task<String> task) throws Exception {
        String sessionToken = task.getResult();
        return getAnalyticsController().trackAppOpenedInBackground(pushHash.get(), sessionToken);
      }
    });
  }

}