Skip to content

Instantly share code, notes, and snippets.

@victorbrndls
Last active November 26, 2021 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victorbrndls/42284995bb70903fab0f33de3024bf49 to your computer and use it in GitHub Desktop.
Save victorbrndls/42284995bb70903fab0f33de3024bf49 to your computer and use it in GitHub Desktop.
// Returns a Task that results in TRUE if the reports can be uplaoded
private Task<Boolean> waitForReportAction() {
if (dataCollectionArbiter.isAutomaticDataCollectionEnabled()) {
Logger.getLogger().d("Automatic data collection is enabled. Allowing upload.");
...
return Tasks.forResult(true);
} else {
Logger.getLogger().d("Automatic data collection is disabled.");
...
dataCollectionArbiter.waitForAutomaticDataCollectionEnabled().onSuccessTask(new SuccessContinuation<Void, Boolean>() {
public Task<Boolean> then(@Nullable Void aVoid) throws Exception {
return Tasks.forResult(true);
}
});
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment