- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
178 lines
6.6 KiB
Java
178 lines
6.6 KiB
Java
package com.fyber.inneractive.sdk.config;
|
|
|
|
import android.app.Activity;
|
|
import android.app.Application;
|
|
import android.os.Bundle;
|
|
import android.os.Handler;
|
|
import android.os.Looper;
|
|
import android.os.Message;
|
|
import android.os.SystemClock;
|
|
import com.fyber.inneractive.sdk.config.m;
|
|
import com.fyber.inneractive.sdk.util.IAlog;
|
|
import com.fyber.inneractive.sdk.util.c1;
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class b implements m.a {
|
|
public c1 c;
|
|
public final j0 d;
|
|
public final c f;
|
|
public final AtomicBoolean a = new AtomicBoolean(false);
|
|
public boolean b = false;
|
|
public final Handler e = new Handler(Looper.getMainLooper(), new a());
|
|
|
|
public class a implements Handler.Callback {
|
|
public a() {
|
|
}
|
|
|
|
@Override // android.os.Handler.Callback
|
|
public final boolean handleMessage(Message message) {
|
|
if (message.what != 123) {
|
|
return false;
|
|
}
|
|
b bVar = b.this;
|
|
if (bVar.a.compareAndSet(false, true)) {
|
|
if (bVar.a.get() && bVar.c != null) {
|
|
IAlog.a("startCounting", new Object[0]);
|
|
c1 c1Var = bVar.c;
|
|
c1Var.getClass();
|
|
c1.a aVar = new c1.a(c1Var);
|
|
c1Var.c = aVar;
|
|
c1Var.d = false;
|
|
aVar.sendEmptyMessage(1932593528);
|
|
}
|
|
IAlog.a("Pause signal", new Object[0]);
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
|
|
/* renamed from: com.fyber.inneractive.sdk.config.b$b, reason: collision with other inner class name */
|
|
public class C0062b implements Application.ActivityLifecycleCallbacks {
|
|
public C0062b() {
|
|
}
|
|
|
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
|
public final void onActivityCreated(Activity activity, Bundle bundle) {
|
|
}
|
|
|
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
|
public final void onActivityDestroyed(Activity activity) {
|
|
}
|
|
|
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
|
public final void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
|
|
}
|
|
|
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
|
public final void onActivityStarted(Activity activity) {
|
|
}
|
|
|
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
|
public final void onActivityStopped(Activity activity) {
|
|
}
|
|
|
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
|
public final void onActivityPaused(Activity activity) {
|
|
if (b.this.e.hasMessages(123) || b.this.a.get()) {
|
|
return;
|
|
}
|
|
b.this.e.sendEmptyMessageDelayed(123, 3000L);
|
|
}
|
|
|
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
|
public final void onActivityResumed(Activity activity) {
|
|
com.fyber.inneractive.sdk.cache.session.e eVar;
|
|
b.this.e.removeMessages(123);
|
|
b bVar = b.this;
|
|
if (bVar.a.compareAndSet(true, false)) {
|
|
if (bVar.b) {
|
|
IAlog.a("onActivityResumed: restartSession", new Object[0]);
|
|
bVar.b = false;
|
|
j0 j0Var = bVar.d;
|
|
if (j0Var != null) {
|
|
com.fyber.inneractive.sdk.cache.session.d dVar = ((i0) j0Var).a;
|
|
if (dVar != null) {
|
|
com.fyber.inneractive.sdk.cache.session.f fVar = dVar.a;
|
|
for (com.fyber.inneractive.sdk.cache.session.enums.b bVar2 : com.fyber.inneractive.sdk.cache.session.enums.b.values()) {
|
|
if (bVar2 != com.fyber.inneractive.sdk.cache.session.enums.b.NONE && (eVar = fVar.a.get(bVar2)) != null && eVar.a != 0) {
|
|
synchronized (dVar.d) {
|
|
try {
|
|
com.fyber.inneractive.sdk.cache.session.h hVar = dVar.b.get(bVar2);
|
|
if (hVar != null) {
|
|
hVar.add(eVar);
|
|
}
|
|
} finally {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
com.fyber.inneractive.sdk.util.p.a(new com.fyber.inneractive.sdk.cache.session.c(dVar, com.fyber.inneractive.sdk.cache.session.enums.a.NEW_SESSION, com.fyber.inneractive.sdk.cache.session.enums.b.NONE));
|
|
}
|
|
((i0) bVar.d).c.put("SESSION_STAMP", Long.toString(SystemClock.elapsedRealtime()));
|
|
((i0) bVar.d).b.clear();
|
|
}
|
|
}
|
|
c1 c1Var = bVar.c;
|
|
if (c1Var != null) {
|
|
c1Var.d = false;
|
|
c1Var.f = 0L;
|
|
c1.a aVar = c1Var.c;
|
|
if (aVar != null) {
|
|
aVar.removeMessages(1932593528);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public class c implements c1.b {
|
|
public c() {
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.util.c1.b
|
|
public final void a() {
|
|
IAlog.a("onVisibleTimeReached: %s", Long.valueOf(System.currentTimeMillis()));
|
|
b.this.b = true;
|
|
}
|
|
}
|
|
|
|
public b(i0 i0Var) {
|
|
C0062b c0062b = new C0062b();
|
|
this.f = new c();
|
|
this.d = i0Var;
|
|
Application b = com.fyber.inneractive.sdk.util.o.b();
|
|
if (b != null) {
|
|
b.registerActivityLifecycleCallbacks(c0062b);
|
|
}
|
|
}
|
|
|
|
public final void a() {
|
|
m mVar = IAConfigManager.L.t;
|
|
if (!mVar.d) {
|
|
mVar.c.add(this);
|
|
}
|
|
c1 c1Var = new c1(TimeUnit.MINUTES, r0.t.b.a(30, 1, "session_duration"));
|
|
this.c = c1Var;
|
|
c1Var.e = this.f;
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.config.m.a
|
|
public final void onGlobalConfigChanged(m mVar, k kVar) {
|
|
c1 c1Var = this.c;
|
|
if (c1Var != null) {
|
|
c1Var.d = false;
|
|
c1Var.f = 0L;
|
|
c1.a aVar = c1Var.c;
|
|
if (aVar != null) {
|
|
aVar.removeMessages(1932593528);
|
|
}
|
|
c1 c1Var2 = new c1(TimeUnit.MINUTES, kVar.a(30, 1, "session_duration"), this.c.f);
|
|
this.c = c1Var2;
|
|
c1Var2.e = this.f;
|
|
}
|
|
mVar.c.remove(this);
|
|
}
|
|
}
|