package androidx.media3.exoplayer.upstream.experimental;

import android.content.ContentValues;
import android.database.sqlite.SQLiteDatabase;
import androidx.media3.common.util.Clock;
import androidx.media3.exoplayer.upstream.experimental.SlidingWeightedAverageBandwidthStatistic;
import java.util.Deque;
import o3.c;
import r3.j;
import y3.InterfaceC3268e;

/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class a implements SlidingWeightedAverageBandwidthStatistic.SampleEvictionFunction, InterfaceC3268e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ long f12564a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ Object f12565b;

    public /* synthetic */ a(long j4, Object obj) {
        this.f12564a = j4;
        this.f12565b = obj;
    }

    @Override // y3.InterfaceC3268e
    public Object apply(Object obj) {
        SQLiteDatabase sQLiteDatabase = (SQLiteDatabase) obj;
        ContentValues contentValues = new ContentValues();
        contentValues.put("next_request_ms", Long.valueOf(this.f12564a));
        j jVar = (j) this.f12565b;
        String str = jVar.f23972a;
        c cVar = jVar.f23974c;
        if (sQLiteDatabase.update("transport_contexts", contentValues, "backend_name = ? and priority = ?", new String[]{str, String.valueOf(B3.a.a(cVar))}) < 1) {
            contentValues.put("backend_name", jVar.f23972a);
            contentValues.put("priority", Integer.valueOf(B3.a.a(cVar)));
            sQLiteDatabase.insert("transport_contexts", null, contentValues);
        }
        return null;
    }

    @Override // androidx.media3.exoplayer.upstream.experimental.SlidingWeightedAverageBandwidthStatistic.SampleEvictionFunction
    public boolean shouldEvictSample(Deque deque) {
        return SlidingWeightedAverageBandwidthStatistic.lambda$getAgeBasedEvictionFunction$1(this.f12564a, (Clock) this.f12565b, deque);
    }
}
