package com.vungle.warren; import android.os.Bundle; import android.os.SystemClock; import android.util.Log; import com.vungle.warren.utility.a; /* loaded from: classes2.dex */ public class j { /* renamed from: a, reason: collision with root package name */ private i8.h f8243a; /* renamed from: b, reason: collision with root package name */ long f8244b = 0; /* renamed from: c, reason: collision with root package name */ private long f8245c = -2147483648L; /* renamed from: d, reason: collision with root package name */ private long f8246d; /* renamed from: e, reason: collision with root package name */ private long f8247e; /* renamed from: f, reason: collision with root package name */ private int f8248f; class a extends a.g { a() { } @Override // com.vungle.warren.utility.a.g public void c() { super.c(); j.this.b(); } @Override // com.vungle.warren.utility.a.g public void d() { super.d(); j.this.f(); } } protected j(i8.h hVar) { this.f8243a = hVar; if (com.vungle.warren.utility.a.p().s()) { c(); } else { Log.e(j.class.getSimpleName(), "No lifecycle listener set"); VungleLogger.c(j.class.getSimpleName() + "#deliverError", "No lifecycle listener set"); } this.f8248f = 0; } private void c() { com.vungle.warren.utility.a.p().n(new a()); } long a() { return SystemClock.elapsedRealtime(); } void b() { if (this.f8248f != 0 || this.f8244b == 0) { return; } this.f8248f = 1; Bundle bundle = new Bundle(); bundle.putLong("cache_bust_interval", this.f8244b); bundle.putLong("next_cache_bust", a() + this.f8244b); this.f8243a.a(i8.b.c().j(this.f8244b - this.f8247e).n(this.f8244b, 0).k(bundle)); this.f8247e = 0L; this.f8246d = a(); } public void d(long j10) { long j11 = this.f8245c; if (j11 != -2147483648L) { this.f8244b = j11; return; } long max = j10 > 0 ? Math.max(j10, 900000L) : 0L; if (max != this.f8244b) { this.f8244b = max; if (this.f8248f == 1) { this.f8243a.b(i8.b.f10936d); this.f8248f = 0; e(); } } } public synchronized void e() { if (this.f8248f == 1) { return; } this.f8248f = 1; if (this.f8244b == 0) { this.f8243a.a(i8.b.c()); } else { Bundle bundle = new Bundle(); bundle.putLong("cache_bust_interval", this.f8244b); bundle.putLong("next_cache_bust", a() + this.f8244b); this.f8243a.a(i8.b.c().n(this.f8244b, 0).k(bundle)); } this.f8246d = a(); } void f() { if (this.f8244b != 0) { this.f8247e = (a() - this.f8246d) % this.f8244b; } this.f8243a.b(i8.b.f10936d); this.f8248f = 0; } }