package com.google.firebase.firestore.local;

import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import androidx.media3.common.C1117c;
import java.util.Map;
import java.util.Objects;
import x3.C3221f;
import x3.C3222g;
import y3.C3270g;
import y3.InterfaceC3267d;
import z3.C3295a;

/* JADX INFO: loaded from: classes3.dex */
public final /* synthetic */ class t implements Runnable {

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

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

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

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ Object f14072d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ Object f14073e;

    public /* synthetic */ t(int i6, int i7, Object obj, Object obj2, Object obj3) {
        this.f14069a = i7;
        this.f14071c = obj;
        this.f14072d = obj2;
        this.f14070b = i6;
        this.f14073e = obj3;
    }

    @Override // java.lang.Runnable
    public final void run() {
        switch (this.f14069a) {
            case 0:
                ((SQLiteDocumentOverlayCache) this.f14071c).lambda$processOverlaysInBackground$5((byte[]) this.f14072d, this.f14070b, (Map) this.f14073e);
                return;
            default:
                r3.j jVar = (r3.j) this.f14072d;
                int i6 = this.f14070b;
                Runnable runnable = (Runnable) this.f14073e;
                C3222g c3222g = (C3222g) this.f14071c;
                z3.c cVar = c3222g.f26024f;
                try {
                    try {
                        InterfaceC3267d interfaceC3267d = c3222g.f26021c;
                        Objects.requireNonNull(interfaceC3267d);
                        ((C3270g) cVar).g(new C3221f(interfaceC3267d, 1));
                        NetworkInfo activeNetworkInfo = ((ConnectivityManager) c3222g.f26019a.getSystemService("connectivity")).getActiveNetworkInfo();
                        if (activeNetworkInfo == null || !activeNetworkInfo.isConnected()) {
                            ((C3270g) cVar).g(new C1117c(c3222g, jVar, i6, 2));
                        } else {
                            c3222g.a(jVar, i6);
                        }
                        break;
                    } catch (C3295a unused) {
                        c3222g.f26022d.a(jVar, i6 + 1, false);
                    }
                    runnable.run();
                    return;
                } catch (Throwable th) {
                    runnable.run();
                    throw th;
                }
        }
    }
}
