package Q4;

import android.util.Log;
import com.google.android.gms.internal.measurement.C1;

/* JADX INFO: loaded from: classes.dex */
public final class T implements P {

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public static final double f5696f = Math.random();

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public static final /* synthetic */ int f5697g = 0;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final W3.f f5698a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final E4.e f5699b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final U4.j f5700c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final C0265l f5701d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final E6.i f5702e;

    public T(W3.f fVar, E4.e eVar, U4.j jVar, C0265l c0265l, E6.i iVar) {
        P6.g.e(fVar, "firebaseApp");
        P6.g.e(eVar, "firebaseInstallations");
        P6.g.e(jVar, "sessionSettings");
        P6.g.e(c0265l, "eventGDTLogger");
        P6.g.e(iVar, "backgroundDispatcher");
        this.f5698a = fVar;
        this.f5699b = eVar;
        this.f5700c = jVar;
        this.f5701d = c0265l;
        this.f5702e = iVar;
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static final Object a(T t6, G6.c cVar) throws Throwable {
        S s8;
        if (cVar instanceof S) {
            s8 = (S) cVar;
            int i = s8.f5695w;
            if ((i & Integer.MIN_VALUE) != 0) {
                s8.f5695w = i - Integer.MIN_VALUE;
            } else {
                s8 = new S(t6, cVar);
            }
        }
        Object obj = s8.f5693u;
        F6.a aVar = F6.a.f2580q;
        int i5 = s8.f5695w;
        boolean zBooleanValue = true;
        if (i5 == 0) {
            C1.N(obj);
            Log.d("SessionFirelogPublisher", "Data Collection is enabled for at least one Subscriber");
            s8.f5692t = t6;
            s8.f5695w = 1;
            if (t6.f5700c.b(s8) == aVar) {
                return aVar;
            }
        } else {
            if (i5 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            t6 = s8.f5692t;
            C1.N(obj);
        }
        U4.j jVar = t6.f5700c;
        Boolean boolB = jVar.f6753a.b();
        if (boolB != null) {
            zBooleanValue = boolB.booleanValue();
        } else {
            Boolean boolB2 = jVar.f6754b.b();
            if (boolB2 != null) {
                zBooleanValue = boolB2.booleanValue();
            }
        }
        if (!zBooleanValue) {
            Log.d("SessionFirelogPublisher", "Sessions SDK disabled. Events will not be sent.");
            return Boolean.FALSE;
        }
        if (f5696f <= t6.f5700c.a()) {
            return Boolean.TRUE;
        }
        Log.d("SessionFirelogPublisher", "Sessions SDK has dropped this session due to sampling.");
        return Boolean.FALSE;
    }
}
