package defpackage;

import com.google.android.gms.tasks.Task;
import defpackage.im1;
import java.util.Objects;
import java.util.concurrent.TimeoutException;

/* JADX INFO: loaded from: classes2.dex */
class gl1 implements im1.a {
    public final /* synthetic */ nl1 a;

    public gl1(nl1 nl1Var) {
        this.a = nl1Var;
    }

    public final void a(tn8 tn8Var, Thread thread, Throwable th) {
        Task taskContinueWithTask;
        nl1 nl1Var = this.a;
        synchronized (nl1Var) {
            Objects.toString(th);
            thread.getName();
            long jCurrentTimeMillis = System.currentTimeMillis();
            jm1 jm1Var = nl1Var.e.a;
            il1 il1Var = new il1(nl1Var, jCurrentTimeMillis, th, thread, tn8Var);
            synchronized (jm1Var.b) {
                taskContinueWithTask = jm1Var.c.continueWithTask(jm1Var.a, new dj1(il1Var, 15));
                jm1Var.c = taskContinueWithTask;
            }
            try {
                try {
                    tda.a(taskContinueWithTask);
                } catch (TimeoutException unused) {
                    hh5.a.a("Cannot send reports. Timed out while fetching settings.", null);
                }
            } catch (Exception e) {
                hh5.a.a("Error handling uncaught exception", e);
            }
        }
    }
}
