package com.ironsource; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import java.util.concurrent.ScheduledThreadPoolExecutor; import kotlin.Unit; import kotlin.jvm.functions.Function1; import kotlin.jvm.internal.DefaultConstructorMarker; import kotlin.jvm.internal.Intrinsics; import kotlin.jvm.internal.Lambda; /* loaded from: classes2.dex */ public final class zp extends ScheduledThreadPoolExecutor { private final Function1 a; private final Function1 b; public static final class a extends Lambda implements Function1 { public static final a a = new a(); public a() { super(1); } public final void a(Throwable th) { } @Override // kotlin.jvm.functions.Function1 public /* bridge */ /* synthetic */ Object invoke(Object obj) { a((Throwable) obj); return Unit.INSTANCE; } } public static final class b extends Lambda implements Function1 { public static final b a = new b(); public b() { super(1); } public final void a(String it) { Intrinsics.checkNotNullParameter(it, "it"); } @Override // kotlin.jvm.functions.Function1 public /* bridge */ /* synthetic */ Object invoke(Object obj) { a((String) obj); return Unit.INSTANCE; } } public zp() { this(0, null, null, 7, null); } /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public zp(int i, Function1 report, Function1 log) { super(i, new ej()); Intrinsics.checkNotNullParameter(report, "report"); Intrinsics.checkNotNullParameter(log, "log"); this.a = report; this.b = log; } public /* synthetic */ zp(int i, Function1 function1, Function1 function12, int i2, DefaultConstructorMarker defaultConstructorMarker) { this((i2 & 1) != 0 ? aq.a : i, (i2 & 2) != 0 ? a.a : function1, (i2 & 4) != 0 ? b.a : function12); } private final String a(String str) { return zp.class.getName() + " RuntimeException caught: " + str; } @Override // java.util.concurrent.ThreadPoolExecutor public void afterExecute(Runnable runnable, Throwable th) { Function1 function1; Throwable e; super.afterExecute(runnable, th); if (th != null) { this.b.invoke(a(th.toString())); this.a.invoke(th); return; } if ((runnable instanceof Future) && ((Future) runnable).isDone()) { try { ((Future) runnable).get(); } catch (InterruptedException e2) { i9.d().a(e2); this.b.invoke(a(e2.toString())); Thread.currentThread().interrupt(); } catch (CancellationException e3) { e = e3; i9.d().a(e); this.b.invoke(a(e.toString())); function1 = this.a; function1.invoke(e); } catch (ExecutionException e4) { i9.d().a(e4); this.b.invoke(a(e4.toString())); function1 = this.a; e = e4.getCause(); function1.invoke(e); } } } }