package j6; import android.util.Log; import c6.a; import j6.a; import java.io.File; import java.io.IOException; /* loaded from: classes2.dex */ public class d implements a { /* renamed from: b, reason: collision with root package name */ private final File f11075b; /* renamed from: c, reason: collision with root package name */ private final long f11076c; /* renamed from: e, reason: collision with root package name */ private c6.a f11078e; /* renamed from: d, reason: collision with root package name */ private final j f11077d = new j(); /* renamed from: a, reason: collision with root package name */ private final i f11074a = new i(); protected d(File file, long j10) { this.f11075b = file; this.f11076c = j10; } private synchronized c6.a c() { if (this.f11078e == null) { this.f11078e = c6.a.H0(this.f11075b, 1, 1, this.f11076c); } return this.f11078e; } public static a d(File file, long j10) { return new d(file, j10); } @Override // j6.a public void a(e6.h hVar, a.b bVar) { String b10 = this.f11074a.b(hVar); this.f11077d.a(b10); try { if (Log.isLoggable("DiskLruCacheWrapper", 2)) { Log.v("DiskLruCacheWrapper", "Put: Obtained: " + b10 + " for for Key: " + hVar); } try { c6.a c10 = c(); if (c10.G0(b10) == null) { a.C0060a D0 = c10.D0(b10); if (D0 == null) { throw new IllegalStateException("Had two simultaneous puts for: " + b10); } try { if (bVar.a(D0.f(0))) { D0.e(); } D0.c(); } catch (Throwable th) { D0.c(); throw th; } } } catch (IOException e10) { if (Log.isLoggable("DiskLruCacheWrapper", 5)) { Log.w("DiskLruCacheWrapper", "Unable to put to disk cache", e10); } } } finally { this.f11077d.b(b10); } } @Override // j6.a public File b(e6.h hVar) { String b10 = this.f11074a.b(hVar); if (Log.isLoggable("DiskLruCacheWrapper", 2)) { Log.v("DiskLruCacheWrapper", "Get: Obtained: " + b10 + " for for Key: " + hVar); } try { a.b G0 = c().G0(b10); if (G0 != null) { return G0.a(0); } } catch (IOException e10) { if (Log.isLoggable("DiskLruCacheWrapper", 5)) { Log.w("DiskLruCacheWrapper", "Unable to get from disk cache", e10); } } return null; } }