private final EmailAsyncTask<Params, Progress, Result> executeInternal( Executor executor, boolean cancelPrevious, Params... params) { if (cancelPrevious) { if (mTracker == null) { throw new IllegalStateException(); } else { mTracker.cancelOthers(this); } } mInnerTask.executeOnExecutor(executor, params); return this; }
/* package */ final void callOnPostExecuteForTest(Result result) { mInnerTask.onPostExecute(result); }
/* package */ final void callOnCancelledForTest(Result result) { mInnerTask.onCancelled(result); }
/* package */ final Result callDoInBackgroundForTest(Params... params) { return mInnerTask.doInBackground(params); }
/** * Wait until {@link #doInBackground} finishes and returns the results of the computation. * * @see android.os.AsyncTask#get */ public final Result get() throws InterruptedException, ExecutionException { return mInnerTask.get(); }
/** @see android.os.AsyncTask#cancel(boolean) */ public final void cancel(boolean mayInterruptIfRunning) { mCancelled = true; mInnerTask.cancel(mayInterruptIfRunning); }