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

import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

/* JADX INFO: loaded from: classes2.dex */
public final class pm1 implements xm1 {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final we f15466b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final ip1 f15467c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final long f15468d;

    public pm1(we weVar, Map map, bk1 bk1Var, jp1 jp1Var) {
        this.f15465a = map;
        this.f15466b = weVar;
        this.f15467c = jp1Var.a(112);
        this.f15468d = bk1Var.O();
    }

    @Override // java.util.concurrent.Callable
    public final Object call() {
        pf pfVar;
        try {
            try {
                this.f15467c.a();
                com.google.common.util.concurrent.w wVar = (com.google.common.util.concurrent.w) this.f15465a.get("gs");
                if (wVar != null && (pfVar = (pf) wVar.get(this.f15468d, TimeUnit.MILLISECONDS)) != null) {
                    we weVar = this.f15466b;
                    synchronized (weVar) {
                        zf zfVarB0 = pfVar.B0();
                        weVar.c();
                        ((pf) weVar.f8617b).p0(zfVarB0);
                        long jY0 = pfVar.y0();
                        weVar.c();
                        ((pf) weVar.f8617b).Y(jY0);
                    }
                }
            } catch (Throwable th) {
                this.f15467c.c();
                throw th;
            }
        } catch (ClassCastException | InterruptedException | ExecutionException | TimeoutException e10) {
            this.f15467c.b(e10);
        }
        this.f15467c.c();
        return null;
    }
}
