- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
237 lines
6.8 KiB
Java
237 lines
6.8 KiB
Java
package com.ironsource.lifecycle;
|
|
|
|
import android.app.Activity;
|
|
import android.app.Application;
|
|
import android.content.Context;
|
|
import android.os.Bundle;
|
|
import com.ironsource.environment.thread.IronSourceThreadManager;
|
|
import com.ironsource.ij;
|
|
import com.ironsource.jj;
|
|
import com.ironsource.lifecycle.a;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.concurrent.CopyOnWriteArrayList;
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public class b implements Application.ActivityLifecycleCallbacks {
|
|
private static final b m = new b();
|
|
private static AtomicBoolean n = new AtomicBoolean(false);
|
|
static final long o = 700;
|
|
private int a = 0;
|
|
private int b = 0;
|
|
private boolean c = true;
|
|
private boolean d = true;
|
|
private jj e = jj.NONE;
|
|
private final List<ij> f = new CopyOnWriteArrayList();
|
|
private final Runnable g = new Runnable() { // from class: com.ironsource.lifecycle.b$$ExternalSyntheticLambda0
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
b.this.f();
|
|
}
|
|
};
|
|
private final Runnable h = new Runnable() { // from class: com.ironsource.lifecycle.b$$ExternalSyntheticLambda1
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
b.this.g();
|
|
}
|
|
};
|
|
private final Runnable i = new Runnable() { // from class: com.ironsource.lifecycle.b$$ExternalSyntheticLambda2
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
b.this.h();
|
|
}
|
|
};
|
|
private final Runnable j = new Runnable() { // from class: com.ironsource.lifecycle.b$$ExternalSyntheticLambda3
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
b.this.i();
|
|
}
|
|
};
|
|
private final Runnable k = new Runnable() { // from class: com.ironsource.lifecycle.b$$ExternalSyntheticLambda4
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
b.this.j();
|
|
}
|
|
};
|
|
private final a.InterfaceC0172a l = new a();
|
|
|
|
public class a implements a.InterfaceC0172a {
|
|
public a() {
|
|
}
|
|
|
|
@Override // com.ironsource.lifecycle.a.InterfaceC0172a
|
|
public void a(Activity activity) {
|
|
b.this.c(activity);
|
|
}
|
|
|
|
@Override // com.ironsource.lifecycle.a.InterfaceC0172a
|
|
public void b(Activity activity) {
|
|
}
|
|
|
|
@Override // com.ironsource.lifecycle.a.InterfaceC0172a
|
|
public void onResume(Activity activity) {
|
|
b.this.b(activity);
|
|
}
|
|
}
|
|
|
|
private void a() {
|
|
if (this.b == 0) {
|
|
this.c = true;
|
|
IronSourceThreadManager.INSTANCE.postMediationBackgroundTask(this.h);
|
|
this.e = jj.PAUSED;
|
|
}
|
|
}
|
|
|
|
private void b() {
|
|
if (this.a == 0 && this.c) {
|
|
IronSourceThreadManager.INSTANCE.postMediationBackgroundTask(this.i);
|
|
this.d = true;
|
|
this.e = jj.STOPPED;
|
|
}
|
|
}
|
|
|
|
public static b d() {
|
|
return m;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void f() {
|
|
a();
|
|
b();
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void g() {
|
|
Iterator<ij> it = this.f.iterator();
|
|
while (it.hasNext()) {
|
|
it.next().d();
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void h() {
|
|
Iterator<ij> it = this.f.iterator();
|
|
while (it.hasNext()) {
|
|
it.next().b();
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void i() {
|
|
Iterator<ij> it = this.f.iterator();
|
|
while (it.hasNext()) {
|
|
it.next().a();
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void j() {
|
|
Iterator<ij> it = this.f.iterator();
|
|
while (it.hasNext()) {
|
|
it.next().c();
|
|
}
|
|
}
|
|
|
|
public void a(Activity activity) {
|
|
int i = this.b - 1;
|
|
this.b = i;
|
|
if (i == 0) {
|
|
IronSourceThreadManager.INSTANCE.postOnUiThreadTask(this.g, 700L);
|
|
}
|
|
}
|
|
|
|
public void a(Context context) {
|
|
Application application;
|
|
if (!n.compareAndSet(false, true) || (application = (Application) context.getApplicationContext()) == null) {
|
|
return;
|
|
}
|
|
application.registerActivityLifecycleCallbacks(this);
|
|
}
|
|
|
|
public void a(ij ijVar) {
|
|
if (!IronsourceLifecycleProvider.a() || ijVar == null || this.f.contains(ijVar)) {
|
|
return;
|
|
}
|
|
this.f.add(ijVar);
|
|
}
|
|
|
|
public void b(Activity activity) {
|
|
int i = this.b + 1;
|
|
this.b = i;
|
|
if (i == 1) {
|
|
if (!this.c) {
|
|
IronSourceThreadManager.INSTANCE.removeUiThreadTask(this.g);
|
|
return;
|
|
}
|
|
IronSourceThreadManager.INSTANCE.postMediationBackgroundTask(this.j);
|
|
this.c = false;
|
|
this.e = jj.RESUMED;
|
|
}
|
|
}
|
|
|
|
public void b(ij ijVar) {
|
|
if (this.f.contains(ijVar)) {
|
|
this.f.remove(ijVar);
|
|
}
|
|
}
|
|
|
|
public jj c() {
|
|
return this.e;
|
|
}
|
|
|
|
public void c(Activity activity) {
|
|
int i = this.a + 1;
|
|
this.a = i;
|
|
if (i == 1 && this.d) {
|
|
IronSourceThreadManager.INSTANCE.postMediationBackgroundTask(this.k);
|
|
this.d = false;
|
|
this.e = jj.STARTED;
|
|
}
|
|
}
|
|
|
|
public void d(Activity activity) {
|
|
this.a--;
|
|
b();
|
|
}
|
|
|
|
public boolean e() {
|
|
return this.e == jj.STOPPED;
|
|
}
|
|
|
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
|
public void onActivityCreated(Activity activity, Bundle bundle) {
|
|
com.ironsource.lifecycle.a.b(activity);
|
|
com.ironsource.lifecycle.a a2 = com.ironsource.lifecycle.a.a(activity);
|
|
if (a2 != null) {
|
|
a2.d(this.l);
|
|
}
|
|
}
|
|
|
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
|
public void onActivityDestroyed(Activity activity) {
|
|
}
|
|
|
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
|
public void onActivityPaused(Activity activity) {
|
|
a(activity);
|
|
}
|
|
|
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
|
public void onActivityResumed(Activity activity) {
|
|
}
|
|
|
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
|
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
|
|
}
|
|
|
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
|
public void onActivityStarted(Activity activity) {
|
|
}
|
|
|
|
@Override // android.app.Application.ActivityLifecycleCallbacks
|
|
public void onActivityStopped(Activity activity) {
|
|
d(activity);
|
|
}
|
|
}
|