package com.ss.android.ugc.aweme.social.monitor;

import X.C1931Pns;
import X.C1935Pnw;
import X.C1936Pnx;
import X.C2059Ppw;
import X.DL2;
import X.Lnj;
import X.M12;
import X.Q39;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import java.util.UUID;
import kotlin.h.b.n;

public final class RelationMonitorServiceImp implements IRelationMonitorService {
    static {
        Covode.recordClassIndex(114696);
    }

    public static IRelationMonitorService LIZ() {
        MethodCollector.i(694);
        IRelationMonitorService iRelationMonitorService = (IRelationMonitorService) Lnj.LIZ(IRelationMonitorService.class, false);
        if (iRelationMonitorService != null) {
            MethodCollector.o(694);
            return iRelationMonitorService;
        }
        Object LIZIZ = Lnj.LIZIZ(IRelationMonitorService.class, false);
        if (LIZIZ != null) {
            IRelationMonitorService iRelationMonitorService2 = (IRelationMonitorService) LIZIZ;
            MethodCollector.o(694);
            return iRelationMonitorService2;
        }
        if (Lnj.bx == null) {
            synchronized (IRelationMonitorService.class) {
                try {
                    if (Lnj.bx == null) {
                        Lnj.bx = new RelationMonitorServiceImp();
                    }
                } catch (Throwable th) {
                    MethodCollector.o(694);
                    throw th;
                }
            }
        }
        RelationMonitorServiceImp relationMonitorServiceImp = (RelationMonitorServiceImp) Lnj.bx;
        MethodCollector.o(694);
        return relationMonitorServiceImp;
    }

    public final DL2 LIZ(String str, UUID uuid) {
        M12.LIZ(str, uuid);
        M12.LIZ(str, uuid);
        String uuid2 = uuid.toString();
        n.LIZIZ(uuid2, Q39.LIZJ);
        C1931Pns pns = C1931Pns.LJIILIIL.get(uuid2);
        if (pns != null) {
            return pns;
        }
        String uuid3 = uuid.toString();
        n.LIZIZ(uuid3, Q39.LIZJ);
        C1931Pns pns2 = new C1931Pns(uuid3, str);
        C1931Pns.LJIILIIL.put(uuid2, pns2);
        return pns2;
    }

    public final C2059Ppw LIZ(int i, UUID uuid) {
        M12.LIZ(uuid);
        M12.LIZ(uuid);
        String uuid2 = uuid.toString();
        n.LIZIZ(uuid2, Q39.LIZJ);
        C1935Pnw pnw = C1935Pnw.LIZLLL.get(uuid2);
        if (pnw == null) {
            pnw = new C1935Pnw(i, uuid2);
            C1935Pnw.LIZLLL.put(uuid2, pnw);
        }
        pnw.LIZ = new C1936Pnx(pnw.LIZIZ, (byte) 0);
        return pnw;
    }
}
