package g2;

import I2.J;
import android.util.Log;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/* JADX INFO: loaded from: classes.dex */
public final class f extends FutureTask {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ a f16464a;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public f(a aVar, J j4) {
        super(j4);
        this.f16464a = aVar;
    }

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