package com.ss.android.ugc.aweme.legoImp.task;

import X.AnonymousClass9EX;
import X.AnonymousClass9FH;
import X.AnonymousClass9JE;
import X.AnonymousClass9JF;
import X.C22428Zd;
import X.C22438Ze;
import X.C25518ec;
import X.C29988lp;
import X.C42869Ft;
import X.C42909Fx;
import X.C43029Gj;
import X.MK9;
import X.TnA;
import X.Tnp;
import android.content.Context;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.live.LiveOuterService;
import java.util.List;

public class LivePrefetchLoadOptTask implements AnonymousClass9FH, C22438Ze {
    static {
        Covode.recordClassIndex(90519);
    }

    public String[] deps() {
        return null;
    }

    public boolean meetTrigger() {
        return true;
    }

    public String prefix() {
        return "task_";
    }

    public int priority() {
        return 1;
    }

    public boolean serialExecute() {
        return false;
    }

    public int targetProcess() {
        return 1;
    }

    public List triggerOtherLegoComponents() {
        return null;
    }

    public C42869Ft triggerType() {
        return C22428Zd.LIZ(this);
    }

    public C42909Fx scenesType() {
        return C42909Fx.DEFAULT;
    }

    public String key() {
        return getClass().getSimpleName();
    }

    public C29988lp threadType() {
        if (C43029Gj.LJII.LIZJ()) {
            return C29988lp.IO;
        }
        return C29988lp.CPU;
    }

    public C25518ec type() {
        AnonymousClass9JE LIZ;
        if (MK9.LJI.LIZIZ() && (LIZ = AnonymousClass9JF.LIZ.LIZ("live_play_level")) != null) {
            int LIZIZ = LIZ.LIZIZ();
            if (LIZIZ == 0) {
                return C25518ec.APP_BACKGROUND;
            }
            if (LIZIZ == 1 || LIZIZ == 2) {
                return C25518ec.BOOT_FINISH;
            }
            if (LIZIZ == 3) {
                return C25518ec.BACKGROUND;
            }
        }
        if (((Boolean) Tnp.LJIIIIZZ.getValue()).booleanValue()) {
            return C25518ec.APP_BACKGROUND;
        }
        if (((Boolean) TnA.LJ.getValue()).booleanValue()) {
            return C25518ec.BOOT_FINISH;
        }
        return C25518ec.BACKGROUND;
    }

    public void run(Context context) {
        LiveOuterService.LJJI().LJIIL().LIZIZ();
        AnonymousClass9EX.LIZ(context, Boolean.valueOf(((Boolean) TnA.LIZLLL.getValue()).booleanValue()));
        if (!TnA.LJFF.LIZLLL()) {
            AnonymousClass9EX.LIZ(context);
        }
    }
}
