package androidx.emoji2.text; import android.os.Build; import android.os.Handler; import android.os.Looper; import androidx.annotation.DoNotInline; import androidx.annotation.NonNull; import androidx.annotation.RequiresApi; import java.util.Objects; import java.util.concurrent.Executor; import java.util.concurrent.LinkedBlockingDeque; import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; /* loaded from: classes.dex */ class ConcurrencyHelpers { private static final int FONT_LOAD_TIMEOUT_SECONDS = 15; private ConcurrencyHelpers() { } public static ThreadPoolExecutor createBackgroundPriorityExecutor(@NonNull final String str) { ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(0, 1, 15L, TimeUnit.SECONDS, new LinkedBlockingDeque(), new ThreadFactory() { // from class: androidx.emoji2.text.ConcurrencyHelpers$$ExternalSyntheticLambda0 @Override // java.util.concurrent.ThreadFactory public final Thread newThread(Runnable runnable) { Thread lambda$createBackgroundPriorityExecutor$0; lambda$createBackgroundPriorityExecutor$0 = ConcurrencyHelpers.lambda$createBackgroundPriorityExecutor$0(str, runnable); return lambda$createBackgroundPriorityExecutor$0; } }); threadPoolExecutor.allowCoreThreadTimeOut(true); return threadPoolExecutor; } /* JADX INFO: Access modifiers changed from: private */ public static /* synthetic */ Thread lambda$createBackgroundPriorityExecutor$0(String str, Runnable runnable) { Thread thread = new Thread(runnable, str); thread.setPriority(10); return thread; } public static Handler mainHandlerAsync() { if (Build.VERSION.SDK_INT >= 28) { return Handler28Impl.createAsync(Looper.getMainLooper()); } return new Handler(Looper.getMainLooper()); } @NonNull @Deprecated public static Executor convertHandlerToExecutor(@NonNull Handler handler) { Objects.requireNonNull(handler); return new ConcurrencyHelpers$$ExternalSyntheticLambda1(handler); } @RequiresApi(28) public static class Handler28Impl { private Handler28Impl() { } @DoNotInline public static Handler createAsync(Looper looper) { Handler createAsync; createAsync = Handler.createAsync(looper); return createAsync; } } }