package U4;

import W.InterfaceC0341h;
import Z6.AbstractC0385z;
import a0.C0388b;
import a0.C0393g;
import a0.C0395i;
import android.util.Log;
import com.google.android.gms.internal.measurement.C1;
import java.io.IOException;

/* JADX INFO: loaded from: classes.dex */
public final class n {

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final C0393g f6765c = new C0393g("firebase_sessions_enabled");

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final C0393g f6766d = new C0393g("firebase_sessions_sampling_rate");

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public static final C0393g f6767e = new C0393g("firebase_sessions_restart_timeout");

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public static final C0393g f6768f = new C0393g("firebase_sessions_cache_duration");

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public static final C0393g f6769g = new C0393g("firebase_sessions_cache_updated_time");

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final InterfaceC0341h f6770a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public h f6771b;

    public n(InterfaceC0341h interfaceC0341h) throws Throwable {
        P6.g.e(interfaceC0341h, "dataStore");
        this.f6770a = interfaceC0341h;
        AbstractC0385z.v(E6.j.f2226q, new k(this, null));
    }

    public static final void a(n nVar, C0388b c0388b) {
        nVar.getClass();
        nVar.f6771b = new h((Boolean) c0388b.c(f6765c), (Double) c0388b.c(f6766d), (Integer) c0388b.c(f6767e), (Integer) c0388b.c(f6768f), (Long) c0388b.c(f6769g));
    }

    public final boolean b() {
        Integer num;
        h hVar = this.f6771b;
        if (hVar == null) {
            P6.g.h("sessionConfigs");
            throw null;
        }
        if (hVar != null) {
            Long l8 = hVar.f6748e;
            return l8 == null || (num = hVar.f6747d) == null || (System.currentTimeMillis() - l8.longValue()) / ((long) 1000) >= ((long) num.intValue());
        }
        P6.g.h("sessionConfigs");
        throw null;
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object c(C0393g c0393g, Object obj, G6.c cVar) throws Throwable {
        l lVar;
        if (cVar instanceof l) {
            lVar = (l) cVar;
            int i = lVar.f6760v;
            if ((i & Integer.MIN_VALUE) != 0) {
                lVar.f6760v = i - Integer.MIN_VALUE;
            } else {
                lVar = new l(this, cVar);
            }
        }
        Object obj2 = lVar.f6758t;
        F6.a aVar = F6.a.f2580q;
        int i5 = lVar.f6760v;
        try {
            if (i5 == 0) {
                C1.N(obj2);
                InterfaceC0341h interfaceC0341h = this.f6770a;
                m mVar = new m(obj, c0393g, this, null);
                lVar.f6760v = 1;
                if (interfaceC0341h.b(new C0395i(mVar, null), lVar) == aVar) {
                    return aVar;
                }
            } else {
                if (i5 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                C1.N(obj2);
            }
        } catch (IOException e8) {
            Log.w("SettingsCache", "Failed to update cache config value: " + e8);
        }
        return A6.n.f457a;
    }
}
