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;

/* renamed from: ʿˁﹳᵽ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C0382 {

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public C3921 f2193 = null;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final Executor f2194;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final C4366 f2195;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public static final HashMap f2192 = new HashMap();

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public static final ExecutorC0438 f2191 = new ExecutorC0438(2);

    public C0382(Executor executor, C4366 c4366) {
        this.f2194 = executor;
        this.f2195 = c4366;
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public static Object m1827(C3921 c3921) throws ExecutionException, TimeoutException {
        C3718 c3718 = new C3718(11);
        Executor executor = f2191;
        c3921.m8708(executor, c3718);
        c3921.m8714(executor, c3718);
        c3921.m8710(executor, c3718);
        if (!((CountDownLatch) c3718.f13883).await(5L, TimeUnit.SECONDS)) {
            throw new TimeoutException("Task await timed out.");
        }
        if (c3921.m8709()) {
            return c3921.m8706();
        }
        throw new ExecutionException(c3921.m8707());
    }

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public static synchronized C0382 m1828(Executor executor, C4366 c4366) {
        String str;
        HashMap map;
        try {
            str = c4366.f16330;
            map = f2192;
            if (!map.containsKey(str)) {
                map.put(str, new C0382(executor, c4366));
            }
        } catch (Throwable th) {
            throw th;
        }
        return (C0382) map.get(str);
    }

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final C3921 m1829(C2275 c2275) {
        CallableC4508 callableC4508 = new CallableC4508(this, 0, c2275);
        Executor executor = this.f2194;
        return ʼٴ.ˇʼʤˎ(callableC4508, executor).m8715(executor, new C3376(this, 1, c2275));
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final C2275 m1830() {
        synchronized (this) {
            try {
                C3921 c3921 = this.f2193;
                if (c3921 == null || !c3921.m8709()) {
                    try {
                        return (C2275) m1827(m1831());
                    } catch (InterruptedException | ExecutionException | TimeoutException unused) {
                        return null;
                    }
                }
                return (C2275) this.f2193.m8706();
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final synchronized C3921 m1831() {
        try {
            C3921 c3921 = this.f2193;
            if (c3921 == null || (c3921.m8717() && !this.f2193.m8709())) {
                Executor executor = this.f2194;
                C4366 c4366 = this.f2195;
                Objects.requireNonNull(c4366);
                this.f2193 = ʼٴ.ˇʼʤˎ(new ːⁱᵸ(0, c4366), executor);
            }
        } catch (Throwable th) {
            throw th;
        }
        return this.f2193;
    }
}
