mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 01:16:49 +00:00
Moving various common executors to a single location
Change-Id: I44bca49b8adb6fa22c3b48d10f674e42c28d792c
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user