package com.ironsource; import com.ironsource.g2; import com.ironsource.mediationsdk.logger.IronLog; import java.util.Timer; import java.util.TimerTask; /* loaded from: classes2.dex */ public class i2 { private final g2 a; private final xk b; private final pk c = c(); private Timer d; public class a implements Runnable { public a() { } @Override // java.lang.Runnable public void run() { i2.this.b.a(); } } public class b extends TimerTask { public b() { } @Override // java.util.TimerTask, java.lang.Runnable public void run() { i2.this.b.a(); } } public i2(g2 g2Var, xk xkVar) { this.a = g2Var; this.b = xkVar; } private synchronized void b(long j) { j(); Timer timer = new Timer(); this.d = timer; timer.schedule(new b(), j); } private pk c() { return new pk(new a(), com.ironsource.lifecycle.b.d(), new nt()); } private synchronized void j() { Timer timer = this.d; if (timer != null) { timer.cancel(); this.d = null; } } public void a() { if (this.a.a() == g2.a.MANUAL_WITH_AUTOMATIC_RELOAD) { IronLog.INTERNAL.verbose(); i(); } } public void a(long j) { pk pkVar = this.c; if (pkVar != null) { pkVar.a(j); } } public g2 b() { return this.a; } public boolean d() { return this.a.c() > 0; } public void e() { if (this.a.e()) { IronLog.INTERNAL.verbose(); b(this.a.c()); } } public void f() { if (this.a.a() == g2.a.AUTOMATIC_LOAD_AFTER_CLOSE) { IronLog.INTERNAL.verbose(); b(this.a.d()); } } public void g() { if (this.a.e()) { IronLog.INTERNAL.verbose(); b(0L); } } public void h() { if (this.a.a() != g2.a.AUTOMATIC_LOAD_WHILE_SHOW || this.a.d() < 0) { return; } IronLog.INTERNAL.verbose(); b(this.a.d()); } public void i() { pk pkVar = this.c; if (pkVar != null) { pkVar.b(); } } public void k() { if (this.a.a() != g2.a.MANUAL_WITH_AUTOMATIC_RELOAD || this.a.b() <= 0) { return; } IronLog.INTERNAL.verbose(); a(this.a.b()); } }