package defpackage;

import com.google.common.util.concurrent.ListenableFuture;
import java.util.concurrent.ExecutionException;

/* JADX INFO: renamed from: ˉˆᵗ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public abstract class AbstractRunnableC1165 extends AbstractC3726 implements Runnable {

    /* JADX INFO: renamed from: ᵠˏˏ, reason: contains not printable characters */
    public static final /* synthetic */ int f4968 = 0;

    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public Object f4969;

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public Class f4970;

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public ListenableFuture f4971;

    public AbstractRunnableC1165(ListenableFuture listenableFuture, Class cls, Object obj) {
        this.f4971 = listenableFuture;
        this.f4970 = cls;
        this.f4969 = obj;
    }

    @Override // java.lang.Runnable
    public final void run() {
        ListenableFuture listenableFuture = this.f4971;
        Class cls = this.f4970;
        Object obj = this.f4969;
        if (((obj == null) || ((listenableFuture == null) | (cls == null))) || (this.f20157 instanceof C4074)) {
            return;
        }
        this.f4971 = null;
        try {
            th = listenableFuture instanceof AbstractC5343 ? ((AbstractC5343) listenableFuture).m10930() : null;
        } catch (ExecutionException e) {
            Throwable cause = e.getCause();
            if (cause == null) {
                cause = new NullPointerException("Future type " + listenableFuture.getClass() + " threw " + e.getClass() + " without a cause");
            }
            th = cause;
        } catch (Throwable th) {
            th = th;
        }
        Object objM9192 = th == null ? AbstractC4226.m9192(listenableFuture) : null;
        if (th == null) {
            m10929(objM9192);
            return;
        }
        if (!cls.isInstance(th)) {
            m10932(listenableFuture);
            return;
        }
        try {
            Object objMo3650 = mo3650(obj, th);
            this.f4970 = null;
            this.f4969 = null;
            mo3649(objMo3650);
        } catch (Throwable th2) {
            try {
                if (th2 instanceof InterruptedException) {
                    Thread.currentThread().interrupt();
                }
                m10927(th2);
            } finally {
                this.f4970 = null;
                this.f4969 = null;
            }
        }
    }

    /* JADX INFO: renamed from: ˉᵲ, reason: contains not printable characters */
    public abstract void mo3649(Object obj);

    /* JADX INFO: renamed from: ˊᵙᵾᵲ, reason: contains not printable characters */
    public abstract Object mo3650(Object obj, Throwable th);

    @Override // defpackage.AbstractC5343
    /* JADX INFO: renamed from: ᵶᵥᵝ */
    public final String mo1685() {
        String str;
        ListenableFuture listenableFuture = this.f4971;
        Class cls = this.f4970;
        Object obj = this.f4969;
        String strMo1685 = super.mo1685();
        if (listenableFuture != null) {
            str = "inputFuture=[" + listenableFuture + "], ";
        } else {
            str = "";
        }
        if (cls == null || obj == null) {
            if (strMo1685 != null) {
                return str.concat(strMo1685);
            }
            return null;
        }
        return str + "exceptionType=[" + cls + "], fallback=[" + obj + "]";
    }

    @Override // defpackage.AbstractC5343
    /* JADX INFO: renamed from: ᵷᵺʾᵖ */
    public final void mo1686() {
        ListenableFuture listenableFuture = this.f4971;
        if ((listenableFuture != null) & (this.f20157 instanceof C4074)) {
            listenableFuture.cancel(m10934());
        }
        this.f4971 = null;
        this.f4970 = null;
        this.f4969 = null;
    }
}
