package p138.p145.p146.p151.p160.p161;

import android.os.Build;
import android.util.Log;
import java.io.File;

/* JADX INFO: renamed from: ދ.ؠ.֏.ތ.ތ.ހ.ގ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C3103 {

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public static final File f9319 = new File("/proc/self/fd");

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public static volatile C3103 f9320;

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final boolean f9321;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public final int f9322;

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public final int f9323;

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public int f9324;

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public boolean f9325 = true;

    public C3103() {
        boolean z = true;
        String str = Build.MODEL;
        if (str != null && str.length() >= 7) {
            switch (Build.MODEL.substring(0, 7)) {
                case "SM-N935":
                case "SM-J720":
                case "SM-G960":
                case "SM-G965":
                case "SM-G935":
                case "SM-G930":
                case "SM-A520":
                    if (Build.VERSION.SDK_INT == 26) {
                        z = false;
                        break;
                    }
                    break;
            }
        }
        this.f9321 = z;
        if (Build.VERSION.SDK_INT >= 28) {
            this.f9322 = 20000;
            this.f9323 = 0;
        } else {
            this.f9322 = 700;
            this.f9323 = 128;
        }
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public static C3103 m5185() {
        if (f9320 == null) {
            synchronized (C3103.class) {
                if (f9320 == null) {
                    f9320 = new C3103();
                }
            }
        }
        return f9320;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final synchronized boolean m5186() {
        boolean z = true;
        int i = this.f9324 + 1;
        this.f9324 = i;
        if (i >= 50) {
            this.f9324 = 0;
            int length = f9319.list().length;
            if (length >= this.f9322) {
                z = false;
            }
            this.f9325 = z;
            if (!z && Log.isLoggable("Downsampler", 5)) {
                Log.w("Downsampler", "Excluding HARDWARE bitmap config because we're over the file descriptor limit, file descriptors " + length + ", limit " + this.f9322);
            }
        }
        return this.f9325;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public boolean m5187(int i, int i2, boolean z, boolean z2) {
        int i3;
        return z && this.f9321 && Build.VERSION.SDK_INT >= 26 && !z2 && i >= (i3 = this.f9323) && i2 >= i3 && m5186();
    }
}
