package com.ironsource; import android.os.Handler; import android.os.Looper; import android.text.TextUtils; import com.ironsource.mediationsdk.logger.IronSourceLogger; import com.ironsource.mediationsdk.logger.IronSourceLoggerManager; import com.ironsource.mediationsdk.sdk.SegmentListener; import java.util.Date; /* loaded from: classes2.dex */ public class rk implements SegmentListener { private SegmentListener a; private final b b; protected long c; public class b extends Thread { private Handler a; private b() { } public Handler a() { return this.a; } @Override // java.lang.Thread, java.lang.Runnable public void run() { Looper.prepare(); this.a = new Handler(); Looper.loop(); } } public rk() { b bVar = new b(); this.b = bVar; bVar.start(); this.c = new Date().getTime(); } /* JADX INFO: Access modifiers changed from: private */ public /* synthetic */ void a(String str) { if (TextUtils.isEmpty(str)) { return; } this.a.onSegmentReceived(str); } public void a(SegmentListener segmentListener) { this.a = segmentListener; } public void a(Runnable runnable) { Handler a2; b bVar = this.b; if (bVar == null || (a2 = bVar.a()) == null) { return; } a2.post(runnable); } public boolean a(Object obj) { return (obj == null || this.b == null) ? false : true; } @Override // com.ironsource.mediationsdk.sdk.SegmentListener public void onSegmentReceived(final String str) { IronSourceLoggerManager.getLogger().log(IronSourceLogger.IronSourceTag.CALLBACK, "onSegmentReceived(" + str + ")", 1); if (a((Object) this.a)) { a(new Runnable() { // from class: com.ironsource.rk$$ExternalSyntheticLambda0 @Override // java.lang.Runnable public final void run() { rk.this.a(str); } }); } } }