package defpackage;

import android.util.Log;
import java.util.concurrent.Callable;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
import java.util.concurrent.atomic.AtomicBoolean;

/* JADX INFO: loaded from: classes.dex */
class f86 extends FutureTask<Object> {
    public final /* synthetic */ h86 a;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public f86(h86 h86Var, Callable callable) {
        super(callable);
        this.a = h86Var;
    }

    @Override // java.util.concurrent.FutureTask
    public final void done() {
        h86 h86Var = this.a;
        AtomicBoolean atomicBoolean = h86Var.d;
        try {
            Object obj = get();
            if (atomicBoolean.get()) {
                return;
            }
            h86Var.d(obj);
        } catch (InterruptedException e) {
            Log.w("AsyncTask", e);
        } catch (CancellationException unused) {
            if (atomicBoolean.get()) {
                return;
            }
            h86Var.d(null);
        } catch (ExecutionException e2) {
            throw new RuntimeException("An error occurred while executing doInBackground()", e2.getCause());
        } catch (Throwable th) {
            throw new RuntimeException("An error occurred while executing doInBackground()", th);
        }
    }
}
