package defpackage;

import android.util.Log;
import java.lang.Thread;
import java.util.concurrent.atomic.AtomicBoolean;

/* renamed from: ᵡˊᵣ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C3195 implements Thread.UncaughtExceptionHandler {

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final AtomicBoolean f12089 = new AtomicBoolean(false);

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final Thread.UncaughtExceptionHandler f12090;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final C3718 f12091;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final C0975 f12092;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final C4036 f12093;

    public C3195(C3718 c3718, C0975 c0975, Thread.UncaughtExceptionHandler uncaughtExceptionHandler, C4036 c4036) {
        this.f12091 = c3718;
        this.f12092 = c0975;
        this.f12090 = uncaughtExceptionHandler;
        this.f12093 = c4036;
    }

    @Override // java.lang.Thread.UncaughtExceptionHandler
    public final void uncaughtException(Thread thread, Throwable th) {
        AtomicBoolean atomicBoolean = this.f12089;
        atomicBoolean.set(true);
        Thread.UncaughtExceptionHandler uncaughtExceptionHandler = this.f12090;
        if (thread == null || th == null) {
            Log.isLoggable("FirebaseCrashlytics", 3);
        } else {
            try {
                if (this.f12093.m8895()) {
                    Log.isLoggable("FirebaseCrashlytics", 3);
                    Log.isLoggable("FirebaseCrashlytics", 3);
                } else {
                    this.f12091.m8351(this.f12092, thread, th);
                }
            } catch (Exception unused) {
                if (uncaughtExceptionHandler != null) {
                    Log.isLoggable("FirebaseCrashlytics", 3);
                    uncaughtExceptionHandler.uncaughtException(thread, th);
                } else {
                    Log.isLoggable("FirebaseCrashlytics", 3);
                    System.exit(1);
                }
                atomicBoolean.set(false);
                return;
            } catch (Throwable th2) {
                if (uncaughtExceptionHandler != null) {
                    Log.isLoggable("FirebaseCrashlytics", 3);
                    uncaughtExceptionHandler.uncaughtException(thread, th);
                } else {
                    Log.isLoggable("FirebaseCrashlytics", 3);
                    System.exit(1);
                }
                atomicBoolean.set(false);
                throw th2;
            }
        }
        if (uncaughtExceptionHandler != null) {
            Log.isLoggable("FirebaseCrashlytics", 3);
            uncaughtExceptionHandler.uncaughtException(thread, th);
        } else {
            Log.isLoggable("FirebaseCrashlytics", 3);
            System.exit(1);
        }
        atomicBoolean.set(false);
    }
}
