package com.strmr.ps.util;

import android.app.ActivityManager;
import android.content.Context;
import androidx.media3.container.NalUnitUtil;
import com.bumptech.glide.a;
import com.bumptech.glide.integration.okhttp3.b;
import defpackage.au5;
import defpackage.bf2;
import defpackage.bm5;
import defpackage.bx1;
import defpackage.cr4;
import defpackage.cv3;
import defpackage.dc2;
import defpackage.dq;
import defpackage.ex7;
import defpackage.f18;
import defpackage.fq4;
import defpackage.gf7;
import defpackage.qv3;
import defpackage.ta0;
import defpackage.tx6;
import java.util.concurrent.TimeUnit;
import kotlin.Metadata;
import okhttp3.OkHttpClient;

/* JADX INFO: loaded from: classes3.dex */
@qv3
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0007\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\u0002\u0010\u0003¨\u0006\u0004"}, d2 = {"Lcom/strmr/ps/util/CustomGlideModule;", "Ldq;", "<init>", "()V", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
public final class CustomGlideModule extends dq {
    @Override // defpackage.t75
    public final void a(Context context, a aVar, ex7 ex7Var) {
        OkHttpClient.Builder builder = new OkHttpClient.Builder();
        TimeUnit timeUnit = TimeUnit.SECONDS;
        ex7Var.a.c(new b.a(builder.connectTimeout(30L, timeUnit).readTimeout(30L, timeUnit).writeTimeout(30L, timeUnit).build()));
    }

    @Override // defpackage.dq
    public final void b(Context context, com.bumptech.glide.b bVar) {
        cr4.g(context, "context");
        Object systemService = context.getSystemService("activity");
        cr4.e(systemService, "null cannot be cast to non-null type android.app.ActivityManager");
        float f = ((ActivityManager) systemService).isLowRamDevice() ? 1.2f : 2.0f;
        au5.a aVar = new au5.a(context);
        gf7.a("Memory cache screens must be greater than or equal to 0", f >= 0.0f);
        aVar.d = f;
        bVar.f = new bm5(new au5(aVar).b);
        bVar.i = new fq4(context, 262144000);
        f18 f18Var = new f18();
        tx6 tx6Var = bf2.f;
        bx1 bx1Var = bx1.b;
        f18 f18Var2 = (f18) ((f18) f18Var.r(tx6Var, bx1Var).r(cv3.a, bx1Var)).e(dc2.a);
        f18Var2.getClass();
        bVar.a((f18) f18Var2.r(ta0.b, 85));
    }
}
