package com.google.android.gms.internal.ads;

import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;

/* JADX INFO: loaded from: classes2.dex */
public abstract class lu1 extends vu1 implements Runnable {

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public static final /* synthetic */ int f13870j = 0;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public com.google.common.util.concurrent.w f13871h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public Object f13872i;

    public lu1(com.google.common.util.concurrent.w wVar, Object obj) {
        wVar.getClass();
        this.f13871h = wVar;
        this.f13872i = obj;
    }

    @Override // com.google.android.gms.internal.ads.cu1
    public final void e() {
        o(this.f13871h);
        this.f13871h = null;
        this.f13872i = null;
    }

    @Override // com.google.android.gms.internal.ads.cu1
    public final String f() {
        String strP;
        com.google.common.util.concurrent.w wVar = this.f13871h;
        Object obj = this.f13872i;
        String strF = super.f();
        if (wVar != null) {
            String string = wVar.toString();
            strP = defpackage.e.p(new StringBuilder(string.length() + 16), "inputFuture=[", string, "], ");
        } else {
            strP = "";
        }
        if (obj == null) {
            if (strF != null) {
                return strP.concat(strF);
            }
            return null;
        }
        int length = strP.length();
        String string2 = obj.toString();
        return com.bytedance.sdk.component.adexpress.dynamic.dynamicview.b.h(new StringBuilder(string2.length() + length + 10 + 1), strP, "function=[", string2, "]");
    }

    @Override // java.lang.Runnable
    public final void run() {
        com.google.common.util.concurrent.w wVar = this.f13871h;
        Object obj = this.f13872i;
        if (((this.f11887a instanceof wt1) | (wVar == null)) || (obj == null)) {
            return;
        }
        this.f13871h = null;
        if (wVar.isCancelled()) {
            n(wVar);
            return;
        }
        try {
            try {
                Object objU = u(obj, ih1.A1(wVar));
                this.f13872i = null;
                t(objU);
            } catch (Throwable th) {
                try {
                    if (th instanceof InterruptedException) {
                        Thread.currentThread().interrupt();
                    }
                    d(th);
                } finally {
                    this.f13872i = null;
                }
            }
        } catch (Error e10) {
            d(e10);
        } catch (CancellationException unused) {
            cancel(false);
        } catch (ExecutionException e11) {
            d(e11.getCause());
        } catch (Exception e12) {
            d(e12);
        }
    }

    public abstract void t(Object obj);

    public abstract Object u(Object obj, Object obj2);
}
