package p037.p065.p070;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.os.CancellationSignal;
import java.io.File;
import java.io.InputStream;
import java.util.concurrent.ConcurrentHashMap;
import p037.p041.p042.LayoutInflaterFactory2C1494;
import p037.p065.p068.p069.C1854;
import p037.p065.p075.C1884;

/* JADX INFO: renamed from: މ.ރ.ބ.އ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C1871 {

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public ConcurrentHashMap<Long, C1854> f6276 = new ConcurrentHashMap<>();

    /* JADX INFO: renamed from: ֏ */
    public Typeface mo3682(Context context, Resources resources, int i, String str, int i2) {
        File fileM2909 = LayoutInflaterFactory2C1494.C1505.m2909(context);
        if (fileM2909 == null) {
            return null;
        }
        try {
            if (LayoutInflaterFactory2C1494.C1505.m2961(fileM2909, resources, i)) {
                return Typeface.createFromFile(fileM2909.getPath());
            }
            return null;
        } catch (RuntimeException unused) {
            return null;
        } finally {
            fileM2909.delete();
        }
    }

    /* JADX INFO: renamed from: ֏ */
    public Typeface mo3677(Context context, CancellationSignal cancellationSignal, C1884.C1890[] c1890Arr, int i) {
        throw null;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public Typeface m3692(Context context, InputStream inputStream) {
        File fileM2909 = LayoutInflaterFactory2C1494.C1505.m2909(context);
        if (fileM2909 == null) {
            return null;
        }
        try {
            if (LayoutInflaterFactory2C1494.C1505.m2962(fileM2909, inputStream)) {
                return Typeface.createFromFile(fileM2909.getPath());
            }
            return null;
        } catch (RuntimeException unused) {
            return null;
        } finally {
            fileM2909.delete();
        }
    }

    /* JADX INFO: renamed from: ֏ */
    public Typeface mo3678(Context context, C1854 c1854, Resources resources, int i) {
        throw null;
    }

    /* JADX INFO: renamed from: ֏ */
    public C1884.C1890 mo3691(C1884.C1890[] c1890Arr, int i) {
        int i2 = (i & 1) == 0 ? 400 : 700;
        boolean z = (i & 2) != 0;
        C1884.C1890 c1890 = null;
        int i3 = Integer.MAX_VALUE;
        for (C1884.C1890 c18902 : c1890Arr) {
            int iAbs = (Math.abs(c18902.f6314 - i2) * 2) + (c18902.f6315 == z ? 0 : 1);
            if (c1890 == null || i3 > iAbs) {
                c1890 = c18902;
                i3 = iAbs;
            }
        }
        return c1890;
    }
}
