package defpackage;

import j$.util.Objects;
import java.util.HashMap;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

/* JADX INFO: renamed from: ˁˏﹶ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C0708 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final C1516 f3239;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public C1300 f3240 = null;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final Executor f3241;

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public static final HashMap f3238 = new HashMap();

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public static final ExecutorC1337 f3237 = new ExecutorC1337(2);

    public C0708(Executor executor, C1516 c1516) {
        this.f3241 = executor;
        this.f3239 = c1516;
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public static Object m2558(C1300 c1300) throws ExecutionException, TimeoutException {
        C1014 c1014 = new C1014(16);
        Executor executor = f3237;
        c1300.m3818(executor, c1014);
        c1300.m3815(executor, c1014);
        c1300.m3825(executor, c1014);
        if (!((CountDownLatch) c1014.f4404).await(5L, TimeUnit.SECONDS)) {
            throw new TimeoutException("Task await timed out.");
        }
        if (c1300.m3829()) {
            return c1300.m3826();
        }
        throw new ExecutionException(c1300.m3830());
    }

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public static synchronized C0708 m2559(Executor executor, C1516 c1516) {
        String str;
        HashMap map;
        try {
            str = c1516.f6142;
            map = f3238;
            if (!map.containsKey(str)) {
                map.put(str, new C0708(executor, c1516));
            }
        } catch (Throwable th) {
            throw th;
        }
        return (C0708) map.get(str);
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final synchronized C1300 m2560() {
        try {
            C1300 c1300 = this.f3240;
            if (c1300 == null || (c1300.m3816() && !this.f3240.m3829())) {
                Executor executor = this.f3241;
                C1516 c1516 = this.f3239;
                Objects.requireNonNull(c1516);
                this.f3240 = ᵥˈᵛ.ᵶᵥᵝ(new ᵫᵔˊᵲ(0, c1516), executor);
            }
        } catch (Throwable th) {
            throw th;
        }
        return this.f3240;
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final C5235 m2561() {
        synchronized (this) {
            try {
                C1300 c1300 = this.f3240;
                if (c1300 == null || !c1300.m3829()) {
                    try {
                        return (C5235) m2558(m2560());
                    } catch (InterruptedException | ExecutionException | TimeoutException unused) {
                        return null;
                    }
                }
                return (C5235) this.f3240.m3826();
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public final C1300 m2562(C5235 c5235) {
        CallableC2397 callableC2397 = new CallableC2397(this, 0, c5235);
        Executor executor = this.f3241;
        return ᵥˈᵛ.ᵶᵥᵝ(callableC2397, executor).m3824(executor, new C0732(this, 1, c5235));
    }
}
