package com.ss.android.ugc.aweme.mix.api;

import X.0HH;
import X.86a;
import X.9DY;
import X.9h6;
import X.C1371Ab9;
import X.C1389AbR;
import X.C1512AdQ;
import X.LsC;
import X.M12;
import X.P7z;
import X.PgU;
import android.os.Bundle;
import com.bytedance.covode.number.Covode;
import java.io.Serializable;

public final class MixListNetPreload implements P7z<MixFeedApi, PgU<C1512AdQ>> {
    static {
        Covode.recordClassIndex(92311);
    }

    public final boolean enable(Bundle bundle) {
        return true;
    }

    public final boolean handleException(Exception exc) {
        M12.LIZ(exc);
        0HH.LIZ(exc);
        return true;
    }

    public final 9h6 getPreloadStrategy(Bundle bundle) {
        return new 9h6(0, 9DY.LJ, false, 5);
    }

    public final PgU<C1512AdQ> preload(Bundle bundle, LsC<? super Class<MixFeedApi>, ? extends MixFeedApi> lsC) {
        Serializable serializable;
        String str;
        String str2;
        String str3;
        M12.LIZ(lsC);
        String str4 = null;
        if (bundle != null) {
            serializable = bundle.getSerializable("mix_video_list_params");
        } else {
            serializable = null;
        }
        if (!(serializable instanceof C1371Ab9)) {
            serializable = null;
        }
        C1371Ab9 ab9 = (C1371Ab9) serializable;
        if (ab9 != null) {
            str = ab9.getMUsrId();
            str2 = ab9.getMSecUid();
            str3 = ab9.getMAid();
            str4 = ab9.getMixId();
        } else {
            str = null;
            str2 = null;
            str3 = null;
        }
        int i = C1389AbR.LIZ;
        if (!86a.LIZ(str3)) {
            i = C1389AbR.LIZLLL;
        }
        MixFeedApi mixFeedApi = (MixFeedApi) lsC.invoke(MixFeedApi.class);
        String str5 = "";
        if (str4 == null) {
            str4 = str5;
        }
        if (str3 == null) {
            str3 = str5;
        }
        if (str == null) {
            str = str5;
        }
        if (str2 != null) {
            str5 = str2;
        }
        return mixFeedApi.getMixVideos2(str4, str3, 0, i, str, str5, false);
    }
}
