package o; import android.app.ActivityManager; import android.content.Context; import android.text.format.Formatter; import android.util.DisplayMetrics; import android.util.Log; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import org.bouncycastle.asn1.cmp.PKIFailureInfo; /* loaded from: classes.dex */ public final class gHz { public final int a; public final int b; private final Context c; public final int d; /* loaded from: classes.dex */ interface HBt { int d(); int e(); } public gHz(RVV rvv) { int i; Context context = rvv.d; this.c = context; if (rvv.e.isLowRamDevice()) { i = rvv.c / 2; } else { i = rvv.c; } this.d = i; ActivityManager activityManager = rvv.e; float f = rvv.j; int round = Math.round(activityManager.getMemoryClass() * PKIFailureInfo.badCertTemplate * (activityManager.isLowRamDevice() ? rvv.b : f)); float e = (rvv.g.e() * rvv.g.d()) << 2; int round2 = Math.round(rvv.a * e); int round3 = Math.round(e * rvv.f); int i2 = round - i; if (round3 + round2 <= i2) { this.b = round3; this.a = round2; } else { float f2 = i2 / (rvv.a + rvv.f); this.b = Math.round(rvv.f * f2); this.a = Math.round(f2 * rvv.a); } if (Log.isLoggable("MemorySizeCalculator", 3)) { Formatter.formatFileSize(context, this.b); Formatter.formatFileSize(context, this.a); Formatter.formatFileSize(context, i); Formatter.formatFileSize(context, round); rvv.e.getMemoryClass(); rvv.e.isLowRamDevice(); } } /* loaded from: classes.dex */ public static final class RVV { private static int i = 1; float a; final Context d; ActivityManager e; HBt g; float f = 2.0f; float j = 0.4f; float b = 0.33f; int c = 4194304; public RVV(Context context) { this.a = i; this.d = context; this.e = (ActivityManager) context.getSystemService("activity"); this.g = new LWm(context.getResources().getDisplayMetrics()); if (this.e.isLowRamDevice()) { this.a = BitmapDescriptorFactory.HUE_RED; } } } /* loaded from: classes.dex */ static final class LWm implements HBt { private final DisplayMetrics d; LWm(DisplayMetrics displayMetrics) { this.d = displayMetrics; } @Override // o.gHz.HBt public final int e() { return this.d.widthPixels; } @Override // o.gHz.HBt public final int d() { return this.d.heightPixels; } } }