package com.ss.android.ugc.aweme.shortvideo.ui.task;

import X.0CB;
import X.0CD;
import X.0CH;
import X.0CN;
import X.3jM;
import X.6Is;
import X.9Y3;
import X.C3400NgJ;
import X.C4683O2k;
import X.M12;
import X.MO7;
import X.MWE;
import android.content.Context;
import android.view.LayoutInflater;
import com.bytedance.covode.number.Covode;
import kotlin.h.b.n;

public final class CacheChooseMediaViewHolderTask implements 6Is, MWE {
    public final Context LIZ;

    static {
        Covode.recordClassIndex(113378);
    }

    public final boolean LIZIZ() {
        return false;
    }

    public final void onStateChanged(0CH r2, 0CB r3) {
        if (r3 == 0CB.ON_DESTROY) {
            onDestroy();
        }
    }

    @0CN(LIZ = 0CB.ON_DESTROY)
    public final void onDestroy() {
        3jM.LIZ.clear();
    }

    public final C3400NgJ LIZJ() {
        int LIZ2 = MO7.LIZ();
        if (LIZ2 == 1) {
            return C3400NgJ.P1;
        }
        if (LIZ2 == 2) {
            return C3400NgJ.P3;
        }
        C3400NgJ ngJ = C3400NgJ.P1;
        n.LIZIZ(ngJ, "");
        return ngJ;
    }

    public final void LIZ() {
        System.currentTimeMillis();
        int LIZ2 = 9Y3.LIZ(9Y3.LIZ(), true, "creative_tools_mt_album_optimization_v2_cache_viewholder", 0);
        if (LIZ2 != 0) {
            Context context = this.LIZ;
            M12.LIZ(context);
            3jM.LIZIZ = LIZ2;
            LayoutInflater from = LayoutInflater.from(context);
            for (int i = 0; i < LIZ2; i++) {
                System.currentTimeMillis();
                3jM.LIZ.add(new C4683O2k(3jM.LIZ(from)));
            }
        }
    }

    public CacheChooseMediaViewHolderTask(Context context, 0CD r3) {
        M12.LIZ(context, r3);
        this.LIZ = context;
        r3.LIZ(this);
    }
}
