package com.bytedance.android.livesdk.init;

import X.7g6;
import X.8No;
import X.8Nq;
import X.8eL;
import X.HIL;
import X.HIN;
import android.os.Handler;
import android.os.Looper;
import com.bytedance.android.livesdk.livesetting.performance.ThreadPoolOptExperiment;
import com.bytedance.covode.number.Covode;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;

public class TaskManagerInitTask extends 7g6 {
    static {
        Covode.recordClassIndex(16968);
    }

    public String getTaskName() {
        return "task_manager_init_task";
    }

    public void run() {
        Executor INVOKESTATIC_com_bytedance_android_livesdk_init_TaskManagerInitTask_com_ss_android_ugc_aweme_lancet_thread_ThreadPoolLancet_newCachedThreadPool;
        if (ThreadPoolOptExperiment.INSTANCE.isEnableAll()) {
            INVOKESTATIC_com_bytedance_android_livesdk_init_TaskManagerInitTask_com_ss_android_ugc_aweme_lancet_thread_ThreadPoolLancet_newCachedThreadPool = 8eL.LIZ();
        } else {
            INVOKESTATIC_com_bytedance_android_livesdk_init_TaskManagerInitTask_com_ss_android_ugc_aweme_lancet_thread_ThreadPoolLancet_newCachedThreadPool = INVOKESTATIC_com_bytedance_android_livesdk_init_TaskManagerInitTask_com_ss_android_ugc_aweme_lancet_thread_ThreadPoolLancet_newCachedThreadPool(new 8No("live-work-threads"));
        }
        HIN hin = new HIN();
        if (INVOKESTATIC_com_bytedance_android_livesdk_init_TaskManagerInitTask_com_ss_android_ugc_aweme_lancet_thread_ThreadPoolLancet_newCachedThreadPool == null) {
            INVOKESTATIC_com_bytedance_android_livesdk_init_TaskManagerInitTask_com_ss_android_ugc_aweme_lancet_thread_ThreadPoolLancet_newCachedThreadPool = HIL.LIZ;
        }
        hin.LIZ = INVOKESTATIC_com_bytedance_android_livesdk_init_TaskManagerInitTask_com_ss_android_ugc_aweme_lancet_thread_ThreadPoolLancet_newCachedThreadPool;
        HIL LIZ = HIL.LIZ();
        LIZ.LJ = hin.LIZ;
        HIL.LIZJ = new Handler(Looper.getMainLooper());
        LIZ.LIZLLL = true;
    }

    public static ExecutorService INVOKESTATIC_com_bytedance_android_livesdk_init_TaskManagerInitTask_com_ss_android_ugc_aweme_lancet_thread_ThreadPoolLancet_newCachedThreadPool(ThreadFactory threadFactory) {
        if ((threadFactory instanceof 8No) || (threadFactory instanceof 8Nq)) {
            return 8eL.LIZ();
        }
        return Executors.newCachedThreadPool(threadFactory);
    }
}
