package com.bytedance.sdk.component.fm;

/* JADX INFO: loaded from: classes.dex */
public abstract class lb<P, R> extends com.bytedance.sdk.component.fm.ro<P, R> {
    private boolean fm = true;

    /* JADX INFO: renamed from: lb, reason: collision with root package name */
    private jnr f6622lb;
    private fm ro;

    public interface fm {
        void fm(Object obj);

        void fm(Throwable th);
    }

    public interface ro {
        lb fm();
    }

    private boolean ajl() {
        if (this.fm) {
            return true;
        }
        wu.fm(new IllegalStateException("Jsb async call already finished: " + fm() + ", hashcode: " + hashCode()));
        return false;
    }

    @Override // com.bytedance.sdk.component.fm.ro
    public /* bridge */ /* synthetic */ String fm() {
        return super.fm();
    }

    public abstract void fm(P p10, jnr jnrVar) throws Exception;

    public void jnr() {
        yz();
    }

    public final void lb() {
        fm((Throwable) null);
    }

    public void yz() {
        this.fm = false;
        this.f6622lb = null;
    }

    public final void fm(R r10) {
        if (ajl()) {
            this.ro.fm(r10);
            yz();
        }
    }

    public final void fm(Throwable th) {
        if (ajl()) {
            this.ro.fm(th);
            yz();
        }
    }

    public void fm(P p10, jnr jnrVar, fm fmVar) throws Exception {
        this.f6622lb = jnrVar;
        this.ro = fmVar;
        fm(p10, jnrVar);
    }
}
