package d3;

import android.content.SharedPreferences;
import java.io.Serializable;
import java.util.ArrayList;

/* JADX INFO: renamed from: d3.f0, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0782f0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public long f11939a;

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public Serializable f11941c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public Serializable f11942d;

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

    /* JADX WARN: Removed duplicated region for block: B:22:0x009a  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public boolean a(long j8, com.google.android.gms.internal.measurement.W0 w02) {
        if (((ArrayList) this.f11942d) == null) {
            this.f11942d = new ArrayList();
        }
        if (((ArrayList) this.f11941c) == null) {
            this.f11941c = new ArrayList();
        }
        if (((ArrayList) this.f11942d).isEmpty() || ((((com.google.android.gms.internal.measurement.W0) ((ArrayList) this.f11942d).get(0)).q() / 1000) / 60) / 60 == ((w02.q() / 1000) / 60) / 60) {
            long jD = this.f11939a + ((long) w02.d());
            Q1 q12 = (Q1) this.f11943e;
            if (!q12.h0().R(null, I.f11583r1)) {
                q12.h0();
                if (jD < Math.max(0, ((Integer) I.f11559j.a(null)).intValue())) {
                }
            } else if (!((ArrayList) this.f11942d).isEmpty()) {
                q12.h0();
                if (jD < Math.max(0, ((Integer) I.f11559j.a(null)).intValue())) {
                    this.f11939a = jD;
                    ((ArrayList) this.f11942d).add(w02);
                    ((ArrayList) this.f11941c).add(Long.valueOf(j8));
                    int size = ((ArrayList) this.f11942d).size();
                    q12.h0();
                    if (size < Math.max(1, ((Integer) I.f11562k.a(null)).intValue())) {
                        return true;
                    }
                }
            }
        }
        return false;
    }

    public void b() {
        C0785g0 c0785g0 = (C0785g0) this.f11943e;
        c0785g0.E();
        ((C0817r0) c0785g0.f5146q).D.getClass();
        long jCurrentTimeMillis = System.currentTimeMillis();
        SharedPreferences.Editor editorEdit = c0785g0.J().edit();
        editorEdit.remove((String) this.f11941c);
        editorEdit.remove((String) this.f11942d);
        editorEdit.putLong((String) this.f11940b, jCurrentTimeMillis);
        editorEdit.apply();
    }

    public /* synthetic */ C0782f0(C0785g0 c0785g0, long j8) {
        this.f11943e = c0785g0;
        P2.w.c("health_monitor");
        P2.w.a(j8 > 0);
        this.f11940b = "health_monitor:start";
        this.f11941c = "health_monitor:count";
        this.f11942d = "health_monitor:value";
        this.f11939a = j8;
    }
}
