- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
221 lines
8.2 KiB
Java
221 lines
8.2 KiB
Java
package com.mbridge.msdk.mbbanner.common.c;
|
|
|
|
import android.content.Context;
|
|
import android.os.Handler;
|
|
import android.text.TextUtils;
|
|
import com.mbridge.msdk.c.h;
|
|
import com.mbridge.msdk.c.k;
|
|
import com.mbridge.msdk.foundation.tools.af;
|
|
import com.mbridge.msdk.out.MBridgeIds;
|
|
import java.util.Map;
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public class a {
|
|
private static final String a = "a";
|
|
private static volatile a h;
|
|
private Context b = com.mbridge.msdk.foundation.controller.c.m().c();
|
|
private com.mbridge.msdk.mbbanner.common.util.a c = new com.mbridge.msdk.mbbanner.common.util.a();
|
|
private Map<String, com.mbridge.msdk.mbbanner.common.a.b> d = new ConcurrentHashMap();
|
|
private Map<String, Boolean> e = new ConcurrentHashMap();
|
|
private Map<String, Handler> f = new ConcurrentHashMap();
|
|
private Map<String, Integer> g = new ConcurrentHashMap();
|
|
|
|
public static a a() {
|
|
if (h == null) {
|
|
synchronized (a.class) {
|
|
try {
|
|
if (h == null) {
|
|
h = new a();
|
|
}
|
|
} finally {
|
|
}
|
|
}
|
|
}
|
|
return h;
|
|
}
|
|
|
|
private a() {
|
|
}
|
|
|
|
public final void a(String str, String str2, final com.mbridge.msdk.mbbanner.common.a.a aVar, com.mbridge.msdk.mbbanner.common.b.b bVar) {
|
|
com.mbridge.msdk.mbbanner.common.a.b bVar2;
|
|
Boolean bool;
|
|
MBridgeIds mBridgeIds = new MBridgeIds(str, str2);
|
|
String e = aVar.e();
|
|
com.mbridge.msdk.foundation.same.report.d.c a2 = com.mbridge.msdk.mbbanner.common.d.a.a(str2, e);
|
|
a2.i(!TextUtils.isEmpty(aVar.c()) ? "1" : "0");
|
|
a2.e(aVar.c());
|
|
a2.b(aVar.f() ? "1" : "2");
|
|
a2.d(aVar.f() ? 1 : 2);
|
|
a2.e(aVar.b());
|
|
com.mbridge.msdk.mbbanner.common.d.a.a("2000123", a2, null);
|
|
if (this.b == null) {
|
|
com.mbridge.msdk.foundation.c.b bVar3 = new com.mbridge.msdk.foundation.c.b(880025);
|
|
bVar3.a(mBridgeIds);
|
|
bVar3.b(e);
|
|
this.c.a(bVar, bVar3);
|
|
return;
|
|
}
|
|
if (bVar == null) {
|
|
com.mbridge.msdk.foundation.c.b bVar4 = new com.mbridge.msdk.foundation.c.b(880001);
|
|
bVar4.a(mBridgeIds);
|
|
bVar4.b(e);
|
|
this.c.a(bVar, bVar4);
|
|
return;
|
|
}
|
|
Map<String, Boolean> map = this.e;
|
|
if (map != null && map.containsKey(str2) && (bool = this.e.get(str2)) != null && bool.booleanValue()) {
|
|
com.mbridge.msdk.foundation.c.b bVar5 = new com.mbridge.msdk.foundation.c.b(880016, "Current unit is loading!");
|
|
bVar5.a(mBridgeIds);
|
|
bVar5.b(e);
|
|
this.c.a(bVar, bVar5);
|
|
return;
|
|
}
|
|
this.e.put(str2, Boolean.TRUE);
|
|
if (this.d.containsKey(str2)) {
|
|
bVar2 = this.d.get(str2);
|
|
} else {
|
|
k d = h.a().d(com.mbridge.msdk.foundation.controller.c.m().k(), str2);
|
|
if (d == null) {
|
|
d = k.d(str2);
|
|
}
|
|
com.mbridge.msdk.mbbanner.common.a.b bVar6 = new com.mbridge.msdk.mbbanner.common.a.b(str2, "", 0, d.w());
|
|
this.d.put(str2, bVar6);
|
|
bVar2 = bVar6;
|
|
}
|
|
bVar2.b(e);
|
|
new b(this.b, bVar2, bVar, this.c).a(str, str2, aVar, new com.mbridge.msdk.mbbanner.common.b.d() { // from class: com.mbridge.msdk.mbbanner.common.c.a.1
|
|
@Override // com.mbridge.msdk.mbbanner.common.b.d
|
|
public final void a(String str3) {
|
|
synchronized (a.a()) {
|
|
aVar.a("");
|
|
a.this.e.put(str3, Boolean.FALSE);
|
|
}
|
|
}
|
|
});
|
|
com.mbridge.msdk.mbbanner.common.d.a.a("2000125", a2, null);
|
|
}
|
|
|
|
public final void b(final String str, final String str2, final com.mbridge.msdk.mbbanner.common.a.a aVar, final com.mbridge.msdk.mbbanner.common.b.b bVar) {
|
|
Handler handler;
|
|
final MBridgeIds mBridgeIds = new MBridgeIds(str, str2);
|
|
if (aVar == null || aVar.b() <= 0) {
|
|
af.b(a, "doUnitRotation: Illegal banner request parameters! && unitId=" + str2);
|
|
return;
|
|
}
|
|
if (this.f.containsKey(str2)) {
|
|
handler = this.f.get(str2);
|
|
} else {
|
|
handler = new Handler();
|
|
this.f.put(str2, handler);
|
|
}
|
|
Handler handler2 = handler;
|
|
Runnable runnable = new Runnable() { // from class: com.mbridge.msdk.mbbanner.common.c.a.2
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
Boolean bool;
|
|
if (a.this.e == null || !a.this.e.containsKey(str2) || (bool = (Boolean) a.this.e.get(str2)) == null || !bool.booleanValue()) {
|
|
if (a.this.g.containsKey(str2)) {
|
|
Integer num = (Integer) a.this.g.get(str2);
|
|
int intValue = num != null ? num.intValue() : 0;
|
|
if (intValue == 2 || intValue == 4) {
|
|
af.b(a.a, "doUnitRotation: autoRotationStatus=" + intValue + " && unitId=" + str2);
|
|
if (a.this.c != null) {
|
|
com.mbridge.msdk.foundation.c.b bVar2 = new com.mbridge.msdk.foundation.c.b(880026);
|
|
bVar2.a(mBridgeIds);
|
|
a.this.c.a(bVar, bVar2);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
a.this.a(str, str2, aVar, bVar);
|
|
}
|
|
}
|
|
};
|
|
if (handler2 != null) {
|
|
handler2.removeCallbacksAndMessages(null);
|
|
handler2.postDelayed(runnable, aVar.b());
|
|
}
|
|
}
|
|
|
|
public final void a(String str) {
|
|
if (this.f.containsKey(str)) {
|
|
Handler handler = this.f.get(str);
|
|
if (handler != null) {
|
|
handler.removeCallbacksAndMessages(null);
|
|
}
|
|
this.f.remove(str);
|
|
}
|
|
}
|
|
|
|
public final void a(int i, String str, String str2, com.mbridge.msdk.mbbanner.common.a.a aVar, com.mbridge.msdk.mbbanner.common.b.b bVar) {
|
|
Handler handler;
|
|
Handler handler2;
|
|
Handler handler3;
|
|
Integer num;
|
|
int intValue = (!this.g.containsKey(str2) || (num = this.g.get(str2)) == null) ? 0 : num.intValue();
|
|
if (i == 1) {
|
|
if (this.f.containsKey(str2) && (handler = this.f.get(str2)) != null) {
|
|
handler.removeCallbacksAndMessages(null);
|
|
}
|
|
this.g.put(str2, Integer.valueOf(i));
|
|
return;
|
|
}
|
|
if (i == 2) {
|
|
if (intValue == 1) {
|
|
if (this.f.containsKey(str2) && (handler2 = this.f.get(str2)) != null) {
|
|
handler2.removeCallbacksAndMessages(null);
|
|
}
|
|
this.g.put(str2, Integer.valueOf(i));
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (i == 3) {
|
|
if (intValue == 2 || intValue == 4) {
|
|
this.g.put(str2, 1);
|
|
b(str, str2, aVar, bVar);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (i != 4) {
|
|
return;
|
|
}
|
|
if (intValue == 0) {
|
|
this.g.put(str2, 0);
|
|
return;
|
|
}
|
|
if (this.f.containsKey(str2) && (handler3 = this.f.get(str2)) != null) {
|
|
handler3.removeCallbacksAndMessages(null);
|
|
}
|
|
this.g.put(str2, Integer.valueOf(i));
|
|
}
|
|
|
|
public final void b() {
|
|
Map<String, com.mbridge.msdk.mbbanner.common.a.b> map = this.d;
|
|
if (map != null) {
|
|
map.clear();
|
|
}
|
|
Map<String, Boolean> map2 = this.e;
|
|
if (map2 != null) {
|
|
map2.clear();
|
|
}
|
|
Map<String, Handler> map3 = this.f;
|
|
if (map3 != null) {
|
|
for (Map.Entry<String, Handler> entry : map3.entrySet()) {
|
|
if (entry.getValue() != null) {
|
|
entry.getValue().removeCallbacksAndMessages(null);
|
|
}
|
|
}
|
|
this.f.clear();
|
|
}
|
|
Map<String, Integer> map4 = this.g;
|
|
if (map4 != null) {
|
|
map4.clear();
|
|
}
|
|
}
|
|
}
|