am 10a8935e: Merge "Use AsyncTasks instead of creating new threads" into jb-ub-now-jolly-elf

* commit '10a8935ef1fc8f073e276fddc85bf66513050c81':
  Use AsyncTasks instead of creating new threads
This commit is contained in:
Michael Jurka
2013-12-03 07:07:19 -08:00
committed by Android Git Automerger
4 changed files with 30 additions and 24 deletions

View File

@@ -29,6 +29,7 @@ import android.content.res.Resources;
import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.drawable.TransitionDrawable;
import android.os.AsyncTask;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewConfiguration;
@@ -337,11 +338,12 @@ public class DeleteDropTarget extends ButtonDropTarget {
if (appWidgetHost != null) {
// Deleting an app widget ID is a void call but writes to disk before returning
// to the caller...
new Thread("deleteAppWidgetId") {
public void run() {
new AsyncTask<Void, Void, Void>() {
public Void doInBackground(Void ... args) {
appWidgetHost.deleteAppWidgetId(launcherAppWidgetInfo.appWidgetId);
return null;
}
}.start();
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void) null);
}
}
if (wasWaitingForUninstall && !mWaitingForUninstall) {