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

@@ -15,12 +15,13 @@
*/
package com.android.launcher3.util;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import android.content.Context;
import android.os.Looper;
import androidx.annotation.VisibleForTesting;
import com.android.launcher3.MainThreadExecutor;
import com.android.launcher3.util.ResourceBasedOverride.Overrides;
import java.util.concurrent.ExecutionException;
@@ -43,7 +44,7 @@ public class MainThreadInitializedObject<T> {
mValue = mProvider.get(context.getApplicationContext());
} else {
try {
return new MainThreadExecutor().submit(() -> get(context)).get();
return MAIN_EXECUTOR.submit(() -> get(context)).get();
} catch (InterruptedException|ExecutionException e) {
throw new RuntimeException(e);
}