package com.qualtrics.digital;

import java.util.Locale;
import jr.a;
import or.u;
import uq.z;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public class c0 {

    /* renamed from: g, reason: collision with root package name */
    private static c0 f15367g;

    /* renamed from: a, reason: collision with root package name */
    private ILatencyReportingService f15368a;

    /* renamed from: b, reason: collision with root package name */
    private double f15369b = 0.0d;

    /* renamed from: c, reason: collision with root package name */
    private String f15370c;

    /* renamed from: d, reason: collision with root package name */
    private String f15371d;

    /* renamed from: e, reason: collision with root package name */
    private String f15372e;

    /* renamed from: f, reason: collision with root package name */
    private String f15373f;

    /* loaded from: classes3.dex */
    class a implements or.d {
        a() {
        }

        @Override // or.d
        public void a(or.b bVar, Throwable th2) {
            m0.a("Error recording latency: " + th2.getMessage());
        }

        @Override // or.d
        public void b(or.b bVar, or.t tVar) {
            m0.d("Latency recorded");
        }
    }

    private c0() {
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public static c0 b() {
        if (f15367g == null) {
            f15367g = new c0();
        }
        return f15367g;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void a(String str, String str2, String str3, String str4) {
        this.f15370c = str;
        this.f15371d = str2;
        this.f15372e = str3;
        this.f15373f = str4;
        jr.a aVar = new jr.a();
        if (m0.f15428a == n0.INFO) {
            aVar.d(a.EnumC0525a.BODY);
        }
        this.f15368a = (ILatencyReportingService) new u.b().c("https://survey.qualtrics.com").g(new z.a().a(new w0(this.f15370c)).a(aVar).a(new s0()).d()).b(pr.a.f()).e().b(ILatencyReportingService.class);
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void c(String str, String str2, long j10) {
        if (this.f15368a == null) {
            m0.a("Service not initialized, report latency network request cannot be performed");
        } else if (v0.a(Double.valueOf(this.f15369b))) {
            this.f15368a.recordLatency(new a0(String.format(Locale.US, "si.androidSDK.%s.%s.%s.%s.%s.%s", "2.17.0", this.f15370c, this.f15371d, this.f15372e, this.f15373f, str), str2, j10)).s0(new a());
        }
    }
}
