package o;

import android.content.Context;
import java.nio.charset.Charset;
import java.util.Collections;
import java.util.Set;
import java.util.concurrent.Executor;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class Ug0 {
    public static volatile C0533Uo e;
    public final C2616uQ a;
    public final C2616uQ b;
    public final C40 c;
    public final C0598Xb d;

    public Ug0(C2616uQ c2616uQ, C2616uQ c2616uQ2, C40 c40, C0598Xb c0598Xb, C2062oc0 c2062oc0) {
        this.a = c2616uQ;
        this.b = c2616uQ2;
        this.c = c40;
        this.d = c0598Xb;
        ((Executor) c2062oc0.a).execute(new RunnableC2108p1(26, c2062oc0));
    }

    public static Ug0 a() {
        C0533Uo c0533Uo = e;
        if (c0533Uo != null) {
            return (Ug0) c0533Uo.q.get();
        }
        throw new IllegalStateException("Not initialized!");
    }

    public static void b(Context context) {
        if (e == null) {
            synchronized (Ug0.class) {
                try {
                    if (e == null) {
                        C0507To c0507To = new C0507To();
                        context.getClass();
                        c0507To.l = context;
                        e = c0507To.b();
                    }
                } catch (Throwable th) {
                    throw th;
                }
            }
        }
    }

    public final Tg0 c(InterfaceC0488Sv interfaceC0488Sv) {
        byte[] bytes;
        Set setUnmodifiableSet = interfaceC0488Sv != null ? Collections.unmodifiableSet(C0187Hf.d) : Collections.singleton(new C0618Xv("proto"));
        C3126zm0 c3126zm0A = C2156pc.a();
        interfaceC0488Sv.getClass();
        c3126zm0A.m = "cct";
        C0187Hf c0187Hf = (C0187Hf) interfaceC0488Sv;
        String str = c0187Hf.a;
        String str2 = c0187Hf.b;
        if (str2 == null && str == null) {
            bytes = null;
        } else {
            if (str2 == null) {
                str2 = "";
            }
            bytes = ("1$" + str + "\\" + str2).getBytes(Charset.forName("UTF-8"));
        }
        c3126zm0A.n = bytes;
        return new Tg0(setUnmodifiableSet, c3126zm0A.m(), this);
    }
}
