@Test public void testTrackAppOpenedInBackgroundEmptyIntent() throws Exception { Intent intent = new Intent(); ParseTaskUtils.wait(ParseAnalytics.trackAppOpenedInBackground(intent)); verify(controller, times(1)).trackAppOpenedInBackground(isNull(String.class), isNull(String.class)); }
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) { String sessionToken = task.getResult(); return getAnalyticsController().trackAppOpenedInBackground(pushHash.get(), sessionToken); } }); }
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) { String sessionToken = task.getResult(); return getAnalyticsController().trackAppOpenedInBackground(pushHash.get(), sessionToken); } }); } }
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) { String sessionToken = task.getResult(); return getAnalyticsController().trackAppOpenedInBackground(pushHash.get(), sessionToken); } }); }  }
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) { String sessionToken = task.getResult(); return getAnalyticsController().trackAppOpenedInBackground(pushHash.get(), sessionToken); } }); }  static Task<Void> trackAppOpenedInBackground(Intent intent); static void trackAppOpenedInBackground(Intent intent, SaveCallback callback); static void trackEventInBackground(String name, SaveCallback callback); static void trackEventInBackground(String name, Map<String, String> dimensions, SaveCallback callback); static Task<Void> trackEventInBackground(String name); static Task<Void> trackEventInBackground(final String name,
                                                    Map<String, String> dimensions); }
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) { String sessionToken = task.getResult(); return getAnalyticsController().trackAppOpenedInBackground(pushHash.get(), sessionToken); } }); }  static Task<Void> trackAppOpenedInBackground(Intent intent); static void trackAppOpenedInBackground(Intent intent, SaveCallback callback); static void trackEventInBackground(String name, SaveCallback callback); static void trackEventInBackground(String name, Map<String, String> dimensions, SaveCallback callback); static Task<Void> trackEventInBackground(String name); static Task<Void> trackEventInBackground(final String name,
                                                    Map<String, String> dimensions);  }