what-the-bank/sources/o/zuk.java

114 lines
3.1 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package o;
import com.airbnb.deeplinkdispatch.UrlTreeKt;
/* loaded from: classes.dex */
final class zuk<Z> implements Ezi<Z> {
private final boolean a;
final Ezi<Z> b;
private boolean c;
private int d;
final boolean e;
private final HBt h;
private final InterfaceC2545agd i;
/* loaded from: classes.dex */
interface HBt {
void b(InterfaceC2545agd interfaceC2545agd, zuk<?> zukVar);
}
/* JADX INFO: Access modifiers changed from: package-private */
public zuk(Ezi<Z> ezi, boolean z, boolean z2, InterfaceC2545agd interfaceC2545agd, HBt hBt) {
if (ezi == null) {
throw new NullPointerException("Argument must not be null");
}
this.b = ezi;
this.e = z;
this.a = z2;
this.i = interfaceC2545agd;
if (hBt == null) {
throw new NullPointerException("Argument must not be null");
}
this.h = hBt;
}
@Override // o.Ezi
public final Class<Z> d() {
return this.b.d();
}
@Override // o.Ezi
public final Z e() {
return this.b.e();
}
@Override // o.Ezi
public final int a() {
return this.b.a();
}
@Override // o.Ezi
public final void b() {
synchronized (this) {
if (this.d > 0) {
throw new IllegalStateException("Cannot recycle a resource while it is still acquired");
}
if (this.c) {
throw new IllegalStateException("Cannot recycle a resource that has already been recycled");
}
this.c = true;
if (this.a) {
this.b.b();
}
}
}
/* JADX INFO: Access modifiers changed from: package-private */
public final void c() {
synchronized (this) {
if (this.c) {
throw new IllegalStateException("Cannot acquire a recycled resource");
}
this.d++;
}
}
/* JADX INFO: Access modifiers changed from: package-private */
public final void g() {
boolean z;
synchronized (this) {
int i = this.d;
if (i <= 0) {
throw new IllegalStateException("Cannot release a recycled or not yet acquired resource");
}
int i2 = i - 1;
this.d = i2;
z = i2 == 0;
}
if (z) {
this.h.b(this.i, this);
}
}
public final String toString() {
String obj;
synchronized (this) {
StringBuilder sb = new StringBuilder("EngineResource{isMemoryCacheable=");
sb.append(this.e);
sb.append(", listener=");
sb.append(this.h);
sb.append(", key=");
sb.append(this.i);
sb.append(", acquired=");
sb.append(this.d);
sb.append(", isRecycled=");
sb.append(this.c);
sb.append(", resource=");
sb.append(this.b);
sb.append(UrlTreeKt.componentParamSuffixChar);
obj = sb.toString();
}
return obj;
}
}