1 package android.os; 2 3 import com.xtremelabs.robolectric.internal.DoNotInstrument; 4 5 @DoNotInstrument 6 public class ShadowAsyncTaskBridge<Params, Progress, Result> { 7 private AsyncTask<Params, Progress, Result> asyncTask; 8 9 public ShadowAsyncTaskBridge(AsyncTask<Params, Progress, Result> asyncTask) { 10 this.asyncTask = asyncTask; 11 } 12 13 public Result doInBackground(Params... params) { 14 return asyncTask.doInBackground(params); 15 } 16 17 public void onPreExecute() { 18 asyncTask.onPreExecute(); 19 } 20 21 public void onPostExecute(Result result) { 22 asyncTask.onPostExecute(result); 23 } 24 25 public void onProgressUpdate(Progress... values) { 26 asyncTask.onProgressUpdate(values); 27 } 28 29 public void onCancelled() { 30 asyncTask.onCancelled(); 31 } 32 } 33