Fix tests on ICS

This commit is contained in:
2016-04-04 06:43:42 -04:00
parent cbc8cbfea3
commit 9891139b5a
4 changed files with 17 additions and 2 deletions

View File

@@ -20,6 +20,7 @@
package org.isoron.uhabits.tasks;
import android.os.AsyncTask;
import android.os.Build;
import java.util.concurrent.TimeoutException;
@@ -53,6 +54,9 @@ public abstract class BaseTask extends AsyncTask<Void, Integer, Void>
public static void waitForTasks(long timeout)
throws TimeoutException, InterruptedException
{
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN)
throw new UnsupportedOperationException("waitForTasks requires API 16+");
int poolInterval = 100;
while(timeout > 0)