package com.twotoasters.android.hoot;

import android.annotation.SuppressLint;
import android.os.AsyncTask;
import android.os.Build;

public abstract class HootThreadPoolAsyncTask<Params, Progress, Result> extends AsyncTask<Params, Progress, Result> {
	@SuppressLint("NewApi")
	public void executeOnThreadPoolExecutor(Params...params) {
		if(isSerialExecutorByDefault()) {
			executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, params);
		} else {
			execute(params);
		}
	}
	
	private static boolean isSerialExecutorByDefault() {
		return Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2;
	}
}

@@ -245,16 +245,143 @@
 sult%3E %7B%0A
+%09%0A%09private static final boolean IS_SERIAL_EXECUTOR_BY_DEFAULT = Build.VERSION.SDK_INT %3E= Build.VERSION_CODES.HONEYCOMB_MR2;%0A%09%09%0A
 %09@Suppre
@@ -397,16 +397,16 @@
 ewApi%22)%0A
-
 %09public 
@@ -466,35 +466,37 @@
 %09if(
-isSerialExecutorByDefault()
+IS_SERIAL_EXECUTOR_BY_DEFAULT
 ) %7B%0A
@@ -592,141 +592,13 @@
 s);%0A
+
 %09%09%7D%0A%09%7D%0A
-%09%0A%09private static boolean isSerialExecutorByDefault() %7B%0A%09%09return Build.VERSION.SDK_INT %3E= Build.VERSION_CODES.HONEYCOMB_MR2;%0A%09%7D%0A
 %7D%0A

Implement feedback from pull request #10