package com.ironsource; import android.app.Activity; import com.ironsource.environment.ContextProvider; import com.ironsource.m1; import com.ironsource.mediationsdk.adunit.adapter.internal.AdapterAdFullScreenInterface; import com.ironsource.mediationsdk.adunit.adapter.internal.listener.AdapterAdRewardListener; import com.ironsource.mediationsdk.adunit.adapter.listener.InterstitialAdListener; import com.ironsource.mediationsdk.logger.IronLog; import com.ironsource.mediationsdk.logger.IronSourceError; import com.ironsource.mediationsdk.model.Placement; import java.lang.ref.WeakReference; import java.util.HashMap; import java.util.Map; import kotlin.jvm.internal.Intrinsics; /* loaded from: classes2.dex */ public final class oc extends x implements InterstitialAdListener, AdapterAdRewardListener { private WeakReference v; private ta w; /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public oc(p2 adTools, y instanceData, pc listener) { super(adTools, instanceData, listener); Intrinsics.checkNotNullParameter(adTools, "adTools"); Intrinsics.checkNotNullParameter(instanceData, "instanceData"); Intrinsics.checkNotNullParameter(listener, "listener"); this.v = new WeakReference<>(listener); } private final void G() { this.w = new ta(); IronLog.INTERNAL.verbose(x.a(this, (String) null, 1, (Object) null)); e().e().a().a(j(), ""); pc pcVar = this.v.get(); if (pcVar != null) { pcVar.c(this); } } private final void H() { IronLog.INTERNAL.verbose(x.a(this, (String) null, 1, (Object) null)); e().e().a().d(j()); } private final void I() { if (i() == null) { IronLog.INTERNAL.verbose(a("placement is null ")); e().e().g().f("mCurrentPlacement is null"); return; } IronLog.INTERNAL.verbose(a("placement name = " + j())); HashMap hashMap = new HashMap(); Map l = e().l(); if (l != null) { for (String str : l.keySet()) { hashMap.put("custom_" + str, l.get(str)); } } long currentTimeMillis = System.currentTimeMillis(); String a = e().a(currentTimeMillis, n()); long a2 = ta.a(this.w); j0 a3 = e().e().a(); String j = j(); Placement i = i(); String rewardName = i != null ? i.getRewardName() : null; Placement i2 = i(); a3.a(j, rewardName, i2 != null ? i2.getRewardAmount() : 0, currentTimeMillis, a, a2, hashMap, e().k()); pc pcVar = this.v.get(); if (pcVar != null) { pcVar.a(this); } } private final void J() { IronLog.INTERNAL.verbose(x.a(this, (String) null, 1, (Object) null)); e().e().a().l(j()); pc pcVar = this.v.get(); if (pcVar != null) { pcVar.b(this); } } private final void K() { IronLog.INTERNAL.verbose(x.a(this, (String) null, 1, (Object) null)); e().e().a().i(j()); } private final void L() { IronLog.INTERNAL.verbose(x.a(this, (String) null, 1, (Object) null)); e().e().a().k(j()); } /* JADX INFO: Access modifiers changed from: private */ public static final void a(oc this$0) { Intrinsics.checkNotNullParameter(this$0, "this$0"); this$0.G(); } /* JADX INFO: Access modifiers changed from: private */ public static final void a(oc this$0, int i, String str) { Intrinsics.checkNotNullParameter(this$0, "this$0"); this$0.b(i, str); } private final void b(int i, String str) { IronLog.INTERNAL.verbose(a("error = " + i + ", " + str)); e().e().a().a(j(), i, str, ""); a(m1.a.FailedToShow); IronSourceError ironSourceError = new IronSourceError(i, str); pc pcVar = this.v.get(); if (pcVar != null) { pcVar.a(ironSourceError, this); } } /* JADX INFO: Access modifiers changed from: private */ public static final void b(oc this$0) { Intrinsics.checkNotNullParameter(this$0, "this$0"); this$0.H(); } /* JADX INFO: Access modifiers changed from: private */ public static final void c(oc this$0) { Intrinsics.checkNotNullParameter(this$0, "this$0"); this$0.I(); } /* JADX INFO: Access modifiers changed from: private */ public static final void d(oc this$0) { Intrinsics.checkNotNullParameter(this$0, "this$0"); this$0.J(); } /* JADX INFO: Access modifiers changed from: private */ public static final void e(oc this$0) { Intrinsics.checkNotNullParameter(this$0, "this$0"); this$0.K(); } /* JADX INFO: Access modifiers changed from: private */ public static final void f(oc this$0) { Intrinsics.checkNotNullParameter(this$0, "this$0"); this$0.L(); } public final void a(Activity activity) { Intrinsics.checkNotNullParameter(activity, "activity"); IronLog ironLog = IronLog.INTERNAL; ironLog.verbose(a("placementName = " + j())); try { e().e().a().a(activity, j()); if (f() instanceof AdapterAdFullScreenInterface) { Object f = f(); Intrinsics.checkNotNull(f, "null cannot be cast to non-null type com.ironsource.mediationsdk.adunit.adapter.internal.AdapterAdFullScreenInterface"); ((AdapterAdFullScreenInterface) f).showAd(h(), this); } else { ironLog.error(a("showAd - adapter not instance of AdapterAdFullScreenInterface")); e().e().g().f("showAd - adapter not instance of AdapterAdFullScreenInterface"); } } catch (Throwable th) { i9.d().a(th); String str = "showAd - exception = " + th.getMessage(); IronLog.INTERNAL.error(a(str)); e().e().g().f(str); b(t1.h(l().h()), str); } } @Override // com.ironsource.x public void a(f0 adInstancePresenter) { Intrinsics.checkNotNullParameter(adInstancePresenter, "adInstancePresenter"); adInstancePresenter.a(this); } @Override // com.ironsource.mediationsdk.adunit.adapter.internal.listener.AdapterAdInteractionListener public void onAdClosed() { a(new Runnable() { // from class: com.ironsource.oc$$ExternalSyntheticLambda4 @Override // java.lang.Runnable public final void run() { oc.a(oc.this); } }); } @Override // com.ironsource.mediationsdk.adunit.adapter.internal.listener.AdapterAdInteractionListener public void onAdEnded() { a(new Runnable() { // from class: com.ironsource.oc$$ExternalSyntheticLambda3 @Override // java.lang.Runnable public final void run() { oc.b(oc.this); } }); } @Override // com.ironsource.mediationsdk.adunit.adapter.internal.listener.AdapterAdRewardListener public void onAdRewarded() { a(new Runnable() { // from class: com.ironsource.oc$$ExternalSyntheticLambda5 @Override // java.lang.Runnable public final void run() { oc.c(oc.this); } }); } @Override // com.ironsource.mediationsdk.adunit.adapter.internal.listener.AdapterAdInteractionListener public void onAdShowFailed(final int i, final String str) { a(new Runnable() { // from class: com.ironsource.oc$$ExternalSyntheticLambda2 @Override // java.lang.Runnable public final void run() { oc.a(oc.this, i, str); } }); } @Override // com.ironsource.mediationsdk.adunit.adapter.internal.listener.AdapterAdInteractionListener public void onAdShowSuccess() { a(new Runnable() { // from class: com.ironsource.oc$$ExternalSyntheticLambda0 @Override // java.lang.Runnable public final void run() { oc.d(oc.this); } }); } @Override // com.ironsource.mediationsdk.adunit.adapter.internal.listener.AdapterAdInteractionListener public void onAdStarted() { a(new Runnable() { // from class: com.ironsource.oc$$ExternalSyntheticLambda1 @Override // java.lang.Runnable public final void run() { oc.e(oc.this); } }); } @Override // com.ironsource.mediationsdk.adunit.adapter.internal.listener.AdapterAdInteractionListener public void onAdVisible() { a(new Runnable() { // from class: com.ironsource.oc$$ExternalSyntheticLambda6 @Override // java.lang.Runnable public final void run() { oc.f(oc.this); } }); } @Override // com.ironsource.x public void y() { if (!(f() instanceof AdapterAdFullScreenInterface)) { IronLog.INTERNAL.error(a("adapter not instance of AdapterAdFullScreenInterface")); return; } Object f = f(); Intrinsics.checkNotNull(f, "null cannot be cast to non-null type com.ironsource.mediationsdk.adunit.adapter.internal.AdapterAdFullScreenInterface"); ((AdapterAdFullScreenInterface) f).loadAd(l().g(), ContextProvider.getInstance().getCurrentActiveActivity(), this); } }