package ඓ.ῲ.K.ᓣ;

import android.annotation.TargetApi;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Looper;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Queue;
import ඓ.ῲ.K.ᕣ.㳳.AbstractC1090;

/* renamed from: ඓ.ῲ.K.ᓣ.㳳  reason: contains not printable characters */
/* compiled from: Util */
public final class C0845 {

    /* renamed from: ῲ  reason: contains not printable characters */
    public static final char[] f4070 = new char[64];

    /* renamed from: K  reason: contains not printable characters */
    public static final char[] f4071 = "0123456789abcdef".toCharArray();

    /* renamed from: ඓ.ῲ.K.ᓣ.㳳$K  reason: contains not printable characters */
    /* compiled from: Util */
    public static /* synthetic */ class C0846 {

        /* renamed from: K  reason: contains not printable characters */
        public static final /* synthetic */ int[] f4072 = new int[Bitmap.Config.values().length];

        /* JADX WARNING: Can't wrap try/catch for region: R(12:0|1|2|3|4|5|6|7|8|9|10|12) */
        /* JADX WARNING: Code restructure failed: missing block: B:13:?, code lost:
            return;
         */
        /* JADX WARNING: Failed to process nested try/catch */
        /* JADX WARNING: Missing exception handler attribute for start block: B:3:0x0014 */
        /* JADX WARNING: Missing exception handler attribute for start block: B:5:0x001f */
        /* JADX WARNING: Missing exception handler attribute for start block: B:7:0x002a */
        /* JADX WARNING: Missing exception handler attribute for start block: B:9:0x0035 */
        static {
            f4072[Bitmap.Config.ALPHA_8.ordinal()] = 1;
            f4072[Bitmap.Config.RGB_565.ordinal()] = 2;
            f4072[Bitmap.Config.ARGB_4444.ordinal()] = 3;
            f4072[Bitmap.Config.RGBA_F16.ordinal()] = 4;
            f4072[Bitmap.Config.ARGB_8888.ordinal()] = 5;
        }
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public static boolean m2449() {
        return Looper.myLooper() == Looper.getMainLooper();
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static boolean m2450() {
        return !m2449();
    }

    /* renamed from: K  reason: contains not printable characters */
    public static String m2456(byte[] bArr) {
        String str;
        synchronized (f4070) {
            char[] cArr = f4070;
            for (int i = 0; i < bArr.length; i++) {
                int i2 = bArr[i] & 255;
                int i3 = i * 2;
                char[] cArr2 = f4071;
                cArr[i3] = cArr2[i2 >>> 4];
                cArr[i3 + 1] = cArr2[i2 & 15];
            }
            str = new String(cArr);
        }
        return str;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static boolean m2460(int i, int i2) {
        if (!(i > 0 || i == Integer.MIN_VALUE)) {
            return false;
        }
        return i2 > 0 || i2 == Integer.MIN_VALUE;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static boolean m2451(Object obj, Object obj2) {
        if (obj == null) {
            return obj2 == null;
        }
        return obj.equals(obj2);
    }

    @TargetApi(19)
    /* renamed from: K  reason: contains not printable characters */
    public static int m2454(Bitmap bitmap) {
        if (!bitmap.isRecycled()) {
            int i = Build.VERSION.SDK_INT;
            try {
                return bitmap.getAllocationByteCount();
            } catch (NullPointerException unused) {
                return bitmap.getRowBytes() * bitmap.getHeight();
            }
        } else {
            throw new IllegalStateException("Cannot obtain size for recycled Bitmap: " + bitmap + "[" + bitmap.getWidth() + "x" + bitmap.getHeight() + "] " + bitmap.getConfig());
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static int m2453(int i, int i2, Bitmap.Config config) {
        int i3 = i * i2;
        if (config == null) {
            config = Bitmap.Config.ARGB_8888;
        }
        int i4 = C0846.f4072[config.ordinal()];
        int i5 = 4;
        if (i4 == 1) {
            i5 = 1;
        } else if (i4 == 2 || i4 == 3) {
            i5 = 2;
        } else if (i4 == 4) {
            i5 = 8;
        }
        return i3 * i5;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m2459() {
        if (!m2449()) {
            throw new IllegalArgumentException("You must call this method on the main thread");
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static <T> Queue<T> m2458(int i) {
        return new ArrayDeque(i);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static <T> List<T> m2457(Collection<T> collection) {
        ArrayList arrayList = new ArrayList(collection.size());
        for (T t : collection) {
            if (t != null) {
                arrayList.add(t);
            }
        }
        return arrayList;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static boolean m2461(Object obj, Object obj2) {
        if (obj == null) {
            return obj2 == null;
        }
        if (obj instanceof AbstractC1090) {
            return ((AbstractC1090) obj).m2949(obj2);
        }
        return obj.equals(obj2);
    }

    /* renamed from: K  reason: contains not printable characters */
    public static int m2452(float f) {
        return Float.floatToIntBits(f) + 527;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static int m2455(Object obj, int i) {
        return (i * 31) + (obj == null ? 0 : obj.hashCode());
    }
}
