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

import X.7xa;
import X.8Zd;
import X.8Ze;
import X.8ec;
import X.9Ft;
import X.9Fx;
import X.C5134OJt;
import X.C5135OJu;
import X.MG9;
import X.SfZ;
import android.content.Context;
import com.bytedance.covode.number.Covode;
import io.reactivex.internal.schedulers.SchedulerPoolFactory;
import java.lang.reflect.Field;
import java.util.List;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.atomic.AtomicReference;
import kotlin.h.b.n;

public final class RxSchedulerPurgeOptTask implements 8Ze {
    public static AtomicReference<ScheduledThreadPoolExecutor> LIZIZ;
    public static final C5134OJt LIZJ = new C5134OJt((byte) 0);
    public boolean LIZ;

    static {
        Covode.recordClassIndex(90591);
    }

    public final boolean meetTrigger() {
        return true;
    }

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

    public final boolean serialExecute() {
        return false;
    }

    public final int targetProcess() {
        return 1048575;
    }

    public final List triggerOtherLegoComponents() {
        return null;
    }

    public final 9Ft triggerType() {
        return 8Zd.LIZ(this);
    }

    public final 9Fx scenesType() {
        return 9Fx.DEFAULT;
    }

    public final 8ec type() {
        return 8ec.BACKGROUND;
    }

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

    private final void LIZ() {
        try {
            Field declaredField = SchedulerPoolFactory.class.getDeclaredField("PURGE_ENABLED");
            declaredField.setAccessible(true);
            declaredField.set(SchedulerPoolFactory.class, false);
            if (n.LIZ(declaredField.get(SchedulerPoolFactory.class), false)) {
                SchedulerPoolFactory.shutdown();
            }
        } catch (Throwable th) {
            th.getMessage();
        }
    }

    public final void run(Context context) {
        int intValue = ((Number) MG9.LIZ.getValue()).intValue();
        if (7xa.LIZIZ(context)) {
            if ((intValue & 1) != 0) {
                SfZ.LJIJ.LJI().LIZLLL(new C5135OJu(this));
            } else if ((intValue & 2) != 0) {
                LIZ();
            }
        } else if ((intValue & 4) != 0) {
            LIZ();
        }
    }
}
