package ඓ.ῲ.K.ᕣ.ᕣ.ʬ;

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

/* renamed from: ඓ.ῲ.K.ᕣ.ᕣ.ʬ.ؿ  reason: contains not printable characters */
/* compiled from: HardwareConfigState */
public final class C0857 {

    /* renamed from: ⁱ  reason: contains not printable characters */
    public static volatile C0857 f4088;

    /* renamed from: 㴹  reason: contains not printable characters */
    public static final File f4089 = new File("/proc/self/fd");

    /* renamed from: ʬ  reason: contains not printable characters */
    public final int f4090;

    /* renamed from: ඓ  reason: contains not printable characters */
    public boolean f4091 = true;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final int f4092;

    /* renamed from: K  reason: contains not printable characters */
    public final boolean f4093;

    /* renamed from: 㸾  reason: contains not printable characters */
    public int f4094;

    /* JADX INFO: Can't fix incorrect switch cases order, some code will duplicate */
    public C0857() {
        char c;
        boolean z = true;
        String str = Build.MODEL;
        if (str != null && str.length() >= 7) {
            String substring = Build.MODEL.substring(0, 7);
            switch (substring.hashCode()) {
                case -1398613787:
                    if (substring.equals("SM-A520")) {
                        c = 6;
                        break;
                    }
                    c = 65535;
                    break;
                case -1398431166:
                    if (substring.equals("SM-G930")) {
                        c = 5;
                        break;
                    }
                    c = 65535;
                    break;
                case -1398431161:
                    if (substring.equals("SM-G935")) {
                        c = 4;
                        break;
                    }
                    c = 65535;
                    break;
                case -1398431073:
                    if (substring.equals("SM-G960")) {
                        c = 2;
                        break;
                    }
                    c = 65535;
                    break;
                case -1398431068:
                    if (substring.equals("SM-G965")) {
                        c = 3;
                        break;
                    }
                    c = 65535;
                    break;
                case -1398343746:
                    if (substring.equals("SM-J720")) {
                        c = 1;
                        break;
                    }
                    c = 65535;
                    break;
                case -1398222624:
                    if (substring.equals("SM-N935")) {
                        c = 0;
                        break;
                    }
                    c = 65535;
                    break;
                default:
                    c = 65535;
                    break;
            }
            switch (c) {
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                    if (Build.VERSION.SDK_INT == 26) {
                        z = false;
                        break;
                    }
                    break;
            }
        }
        this.f4093 = z;
        if (Build.VERSION.SDK_INT >= 28) {
            this.f4092 = 20000;
            this.f4090 = 0;
            return;
        }
        this.f4092 = 700;
        this.f4090 = 128;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static C0857 m2481() {
        if (f4088 == null) {
            synchronized (C0857.class) {
                if (f4088 == null) {
                    f4088 = new C0857();
                }
            }
        }
        return f4088;
    }

    /* renamed from: K  reason: contains not printable characters */
    public boolean m2483(int i, int i2, boolean z, boolean z2) {
        int i3;
        if (!z || !this.f4093 || Build.VERSION.SDK_INT < 26 || z2 || i < (i3 = this.f4090) || i2 < i3 || !m2482()) {
            return false;
        }
        return true;
    }

    /* renamed from: K  reason: contains not printable characters */
    public final synchronized boolean m2482() {
        int i = this.f4094 + 1;
        this.f4094 = i;
        if (i >= 50) {
            boolean z = false;
            this.f4094 = 0;
            int length = f4089.list().length;
            if (length < this.f4092) {
                z = true;
            }
            this.f4091 = z;
            if (!this.f4091 && Log.isLoggable("Downsampler", 5)) {
                Log.w("Downsampler", "Excluding HARDWARE bitmap config because we're over the file descriptor limit, file descriptors " + length + ", limit " + this.f4092);
            }
        }
        return this.f4091;
    }
}
