- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
110 lines
3.6 KiB
Java
110 lines
3.6 KiB
Java
package com.ironsource;
|
|
|
|
import com.ironsource.l0;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.concurrent.locks.ReadWriteLock;
|
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
|
import kotlin.collections.CollectionsKt___CollectionsKt;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class n0 implements l0, l0.a {
|
|
private final ReadWriteLock a;
|
|
private final Map<String, k0> b;
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
public n0() {
|
|
this(null, 1, 0 == true ? 1 : 0);
|
|
}
|
|
|
|
public n0(ReadWriteLock readWriteLock) {
|
|
Intrinsics.checkNotNullParameter(readWriteLock, "readWriteLock");
|
|
this.a = readWriteLock;
|
|
this.b = new LinkedHashMap();
|
|
}
|
|
|
|
public /* synthetic */ n0(ReadWriteLock readWriteLock, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this((i & 1) != 0 ? new ReentrantReadWriteLock() : readWriteLock);
|
|
}
|
|
|
|
@Override // com.ironsource.l0
|
|
public k0 a(String adId) {
|
|
Intrinsics.checkNotNullParameter(adId, "adId");
|
|
this.a.readLock().lock();
|
|
try {
|
|
return this.b.get(adId);
|
|
} finally {
|
|
this.a.readLock().unlock();
|
|
}
|
|
}
|
|
|
|
@Override // com.ironsource.l0
|
|
public List<k0> a() {
|
|
this.a.readLock().lock();
|
|
List<k0> list = CollectionsKt___CollectionsKt.toList(this.b.values());
|
|
this.a.readLock().unlock();
|
|
return list;
|
|
}
|
|
|
|
@Override // com.ironsource.l0.a
|
|
public void a(j1 adStatus, String adId) {
|
|
Intrinsics.checkNotNullParameter(adStatus, "adStatus");
|
|
Intrinsics.checkNotNullParameter(adId, "adId");
|
|
this.a.writeLock().lock();
|
|
try {
|
|
k0 k0Var = this.b.get(adId);
|
|
if (k0Var != null) {
|
|
k0Var.a(adStatus);
|
|
k0Var.a(System.currentTimeMillis() / 1000.0d);
|
|
}
|
|
} finally {
|
|
this.a.writeLock().unlock();
|
|
}
|
|
}
|
|
|
|
@Override // com.ironsource.l0.a
|
|
public void a(k0 adInfo) {
|
|
Intrinsics.checkNotNullParameter(adInfo, "adInfo");
|
|
this.a.writeLock().lock();
|
|
try {
|
|
if (this.b.get(adInfo.c()) == null) {
|
|
this.b.put(adInfo.c(), adInfo);
|
|
}
|
|
} finally {
|
|
this.a.writeLock().unlock();
|
|
}
|
|
}
|
|
|
|
@Override // com.ironsource.l0.a
|
|
public void a(JSONObject json, j1 adStatus, String adId) {
|
|
Intrinsics.checkNotNullParameter(json, "json");
|
|
Intrinsics.checkNotNullParameter(adStatus, "adStatus");
|
|
Intrinsics.checkNotNullParameter(adId, "adId");
|
|
this.a.writeLock().lock();
|
|
try {
|
|
k0 k0Var = this.b.get(adId);
|
|
if (k0Var != null) {
|
|
String bundleId = json.optString("bundleId");
|
|
Intrinsics.checkNotNullExpressionValue(bundleId, "bundleId");
|
|
if (bundleId.length() > 0) {
|
|
k0Var.a(bundleId);
|
|
}
|
|
String dynamicDemandSourceId = json.optString("dynamicDemandSource");
|
|
Intrinsics.checkNotNullExpressionValue(dynamicDemandSourceId, "dynamicDemandSourceId");
|
|
if (dynamicDemandSourceId.length() > 0) {
|
|
k0Var.a(we.b.a(dynamicDemandSourceId));
|
|
}
|
|
k0Var.a(adStatus);
|
|
}
|
|
this.a.writeLock().unlock();
|
|
} catch (Throwable th) {
|
|
this.a.writeLock().unlock();
|
|
throw th;
|
|
}
|
|
}
|
|
}
|