Moving various common executors to a single location

Change-Id: I44bca49b8adb6fa22c3b48d10f674e42c28d792c
This commit is contained in:
Sunny Goyal
2019-08-15 14:53:41 -07:00
parent 4fa6f63ffd
commit 6fe3eec95c
59 changed files with 434 additions and 441 deletions

View File

@@ -16,13 +16,14 @@
package com.android.launcher3.util;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
import android.os.Process;
import android.view.View;
import android.view.View.OnAttachStateChangeListener;
import android.view.ViewTreeObserver.OnDrawListener;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherModel;
import java.util.ArrayList;
import java.util.concurrent.Executor;
@@ -66,7 +67,7 @@ public class ViewOnDrawExecutor implements Executor, OnDrawListener, Runnable,
@Override
public void execute(Runnable command) {
mTasks.add(command);
LauncherModel.setWorkerPriority(Process.THREAD_PRIORITY_BACKGROUND);
MODEL_EXECUTOR.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
}
@Override
@@ -108,7 +109,7 @@ public class ViewOnDrawExecutor implements Executor, OnDrawListener, Runnable,
if (mLauncher != null) {
mLauncher.clearPendingExecutor(this);
}
LauncherModel.setWorkerPriority(Process.THREAD_PRIORITY_DEFAULT);
MODEL_EXECUTOR.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT);
}
protected boolean isCompleted() {