package o;

import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.webkit.MimeTypeMap;
import com.google.android.gms.common.api.Api;
import java.io.Closeable;
import java.io.IOException;
import java.util.ArrayList;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.h, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public abstract class AbstractC1345h {
    public static final Bitmap.Config[] a;
    public static final Bitmap.Config b;
    public static final LE c;

    static {
        int i = Build.VERSION.SDK_INT;
        a = i >= 26 ? new Bitmap.Config[]{Bitmap.Config.ARGB_8888, Bitmap.Config.RGBA_F16} : new Bitmap.Config[]{Bitmap.Config.ARGB_8888};
        b = i >= 26 ? Bitmap.Config.HARDWARE : Bitmap.Config.ARGB_8888;
        c = new LE((String[]) new ArrayList(20).toArray(new String[0]));
    }

    public static final void a(Closeable closeable) throws IOException {
        try {
            closeable.close();
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception unused) {
        }
    }

    public static final String b(MimeTypeMap mimeTypeMap, String str) {
        if (str == null || Za0.Y(str)) {
            return null;
        }
        int iB0 = Za0.b0(str, '#', 0, 6);
        if (iB0 != -1) {
            str = str.substring(0, iB0);
        }
        int iB02 = Za0.b0(str, '?', 0, 6);
        if (iB02 != -1) {
            str = str.substring(0, iB02);
        }
        return mimeTypeMap.getMimeTypeFromExtension(Za0.m0(Za0.m0(str, '/', str), '.', ""));
    }

    public static final boolean c(Uri uri) {
        return F3.c(uri.getScheme(), "file") && F3.c((String) AbstractC3117zi.f0(uri.getPathSegments()), "android_asset");
    }

    public static final int d(IJ ij, int i) {
        if (ij instanceof C0536Ur) {
            return ((C0536Ur) ij).m;
        }
        int iW = AbstractC2462sn.w(i);
        if (iW == 0) {
            return Integer.MIN_VALUE;
        }
        if (iW == 1) {
            return Api.BaseClientBuilder.API_PRIORITY_OTHER;
        }
        throw new C2170pj();
    }
}
