package com.google.android.gms.internal.ads;

import java.lang.Thread;
import java.util.Objects;

/* JADX INFO: loaded from: classes2.dex */
public final class cz implements Thread.UncaughtExceptionHandler {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f10113a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ Thread.UncaughtExceptionHandler f10114b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ dz f10115c;

    public cz(dz dzVar, Thread.UncaughtExceptionHandler uncaughtExceptionHandler, int i10) {
        this.f10113a = i10;
        if (i10 != 1) {
            this.f10114b = uncaughtExceptionHandler;
            Objects.requireNonNull(dzVar);
            this.f10115c = dzVar;
        } else {
            this.f10114b = uncaughtExceptionHandler;
            Objects.requireNonNull(dzVar);
            this.f10115c = dzVar;
        }
    }

    @Override // java.lang.Thread.UncaughtExceptionHandler
    public final void uncaughtException(Thread thread, Throwable th) {
        int i10 = this.f10113a;
        dz dzVar = this.f10115c;
        Thread.UncaughtExceptionHandler uncaughtExceptionHandler = this.f10114b;
        switch (i10) {
            case 0:
                try {
                    try {
                        dzVar.g(th);
                        break;
                    } catch (Throwable unused) {
                        q7.j.b("AdMob exception reporter failed reporting the exception.");
                        break;
                    }
                    if (uncaughtExceptionHandler != null) {
                        uncaughtExceptionHandler.uncaughtException(thread, th);
                        return;
                    }
                    return;
                } finally {
                }
            default:
                try {
                    try {
                        dzVar.g(th);
                    } finally {
                    }
                    break;
                } catch (Throwable unused2) {
                    q7.j.b("AdMob exception reporter failed reporting the exception.");
                    break;
                }
                if (uncaughtExceptionHandler != null) {
                    uncaughtExceptionHandler.uncaughtException(thread, th);
                    return;
                }
                return;
        }
    }
}
