package o;

import android.app.Notification;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.ColorStateList;
import android.graphics.Bitmap;
import android.graphics.ColorSpace;
import android.graphics.PorterDuff;
import android.graphics.drawable.Icon;
import android.os.Build;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.autofill.AutofillId;
import com.google.android.gms.measurement.internal.zzw;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.function.DoubleUnaryOperator;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.i7, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public abstract class AbstractC1456i7 {
    public static final ColorSpace a(AbstractC0345Ni abstractC0345Ni) {
        if (F3.c(abstractC0345Ni, C0423Qi.e)) {
            return ColorSpace.get(ColorSpace.Named.SRGB);
        }
        if (F3.c(abstractC0345Ni, C0423Qi.q)) {
            return ColorSpace.get(ColorSpace.Named.ACES);
        }
        if (F3.c(abstractC0345Ni, C0423Qi.r)) {
            return ColorSpace.get(ColorSpace.Named.ACESCG);
        }
        if (F3.c(abstractC0345Ni, C0423Qi.f299o)) {
            return ColorSpace.get(ColorSpace.Named.ADOBE_RGB);
        }
        if (F3.c(abstractC0345Ni, C0423Qi.j)) {
            return ColorSpace.get(ColorSpace.Named.BT2020);
        }
        if (F3.c(abstractC0345Ni, C0423Qi.i)) {
            return ColorSpace.get(ColorSpace.Named.BT709);
        }
        if (F3.c(abstractC0345Ni, C0423Qi.t)) {
            return ColorSpace.get(ColorSpace.Named.CIE_LAB);
        }
        if (F3.c(abstractC0345Ni, C0423Qi.s)) {
            return ColorSpace.get(ColorSpace.Named.CIE_XYZ);
        }
        if (F3.c(abstractC0345Ni, C0423Qi.k)) {
            return ColorSpace.get(ColorSpace.Named.DCI_P3);
        }
        if (F3.c(abstractC0345Ni, C0423Qi.l)) {
            return ColorSpace.get(ColorSpace.Named.DISPLAY_P3);
        }
        if (F3.c(abstractC0345Ni, C0423Qi.g)) {
            return ColorSpace.get(ColorSpace.Named.EXTENDED_SRGB);
        }
        if (F3.c(abstractC0345Ni, C0423Qi.h)) {
            return ColorSpace.get(ColorSpace.Named.LINEAR_EXTENDED_SRGB);
        }
        if (F3.c(abstractC0345Ni, C0423Qi.f)) {
            return ColorSpace.get(ColorSpace.Named.LINEAR_SRGB);
        }
        if (F3.c(abstractC0345Ni, C0423Qi.m)) {
            return ColorSpace.get(ColorSpace.Named.NTSC_1953);
        }
        if (F3.c(abstractC0345Ni, C0423Qi.p)) {
            return ColorSpace.get(ColorSpace.Named.PRO_PHOTO_RGB);
        }
        if (F3.c(abstractC0345Ni, C0423Qi.n)) {
            return ColorSpace.get(ColorSpace.Named.SMPTE_C);
        }
        if (Build.VERSION.SDK_INT >= 34) {
            ColorSpace colorSpace = F3.c(abstractC0345Ni, C0423Qi.v) ? ColorSpace.get(ColorSpace.Named.BT2020_HLG) : F3.c(abstractC0345Ni, C0423Qi.w) ? ColorSpace.get(ColorSpace.Named.BT2020_PQ) : null;
            if (colorSpace != null) {
                return colorSpace;
            }
        }
        if (!(abstractC0345Ni instanceof R20)) {
            return ColorSpace.get(ColorSpace.Named.SRGB);
        }
        String str = abstractC0345Ni.a;
        R20 r20 = (R20) abstractC0345Ni;
        float[] fArrA = r20.d.a();
        C1595jg0 c1595jg0 = r20.g;
        ColorSpace.Rgb.TransferParameters transferParameters = c1595jg0 != null ? new ColorSpace.Rgb.TransferParameters(c1595jg0.b, c1595jg0.c, c1595jg0.d, c1595jg0.e, c1595jg0.f, c1595jg0.g, c1595jg0.a) : null;
        if (transferParameters != null) {
            return new ColorSpace.Rgb(str, r20.h, fArrA, transferParameters);
        }
        float[] fArr = r20.h;
        final Q20 q20 = r20.l;
        final int i = 0;
        DoubleUnaryOperator doubleUnaryOperator = new DoubleUnaryOperator() { // from class: o.Oi
            @Override // java.util.function.DoubleUnaryOperator
            public final double applyAsDouble(double d) {
                switch (i) {
                }
                return ((Number) q20.g(Double.valueOf(d))).doubleValue();
            }
        };
        final Q20 q202 = r20.f306o;
        final int i2 = 1;
        return new ColorSpace.Rgb(str, fArr, fArrA, doubleUnaryOperator, new DoubleUnaryOperator() { // from class: o.Oi
            @Override // java.util.function.DoubleUnaryOperator
            public final double applyAsDouble(double d) {
                switch (i2) {
                }
                return ((Number) q202.g(Double.valueOf(d))).doubleValue();
            }
        }, r20.e, r20.f);
    }

    public static Notification.Builder b(Context context, String str) {
        return new Notification.Builder(context, str);
    }

    public static Icon c(Bitmap bitmap) {
        return Icon.createWithAdaptiveBitmap(bitmap);
    }

    public static AutofillId d(View view) {
        return view.getAutofillId();
    }

    public static float e(ViewConfiguration viewConfiguration) {
        return viewConfiguration.getScaledHorizontalScrollFactor();
    }

    public static float f(ViewConfiguration viewConfiguration) {
        return viewConfiguration.getScaledHorizontalScrollFactor();
    }

    public static float g(ViewConfiguration viewConfiguration) {
        return viewConfiguration.getScaledVerticalScrollFactor();
    }

    public static float h(ViewConfiguration viewConfiguration) {
        return viewConfiguration.getScaledVerticalScrollFactor();
    }

    public static boolean i(File file, File file2) throws IOException {
        try {
            Files.move(file.toPath(), file2.toPath(), StandardCopyOption.REPLACE_EXISTING);
            return true;
        } catch (IOException unused) {
            return false;
        }
    }

    public static Intent j(Context context, zzw zzwVar, IntentFilter intentFilter) {
        return context.registerReceiver(zzwVar, intentFilter, null, null, 0);
    }

    public static Intent k(Context context, zzw zzwVar, IntentFilter intentFilter) {
        return context.registerReceiver(zzwVar, intentFilter, null, null, 2);
    }

    public static void l(MenuItem menuItem, char c, int i) {
        menuItem.setAlphabeticShortcut(c, i);
    }

    public static void m(Notification.Builder builder) {
        builder.setBadgeIconType(0);
    }

    public static void n(MenuItem menuItem, CharSequence charSequence) {
        menuItem.setContentDescription(charSequence);
    }

    public static void o(Notification.Builder builder) {
        builder.setGroupAlertBehavior(0);
    }

    public static void p(MenuItem menuItem, ColorStateList colorStateList) {
        menuItem.setIconTintList(colorStateList);
    }

    public static void q(MenuItem menuItem, PorterDuff.Mode mode) {
        menuItem.setIconTintMode(mode);
    }

    public static void r(MenuItem menuItem, char c, int i) {
        menuItem.setNumericShortcut(c, i);
    }

    public static void s(Notification.Builder builder) {
        builder.setSettingsText(null);
    }

    public static void t(Notification.Builder builder, String str) {
        builder.setShortcutId(str);
    }

    public static void u(Notification.Builder builder) {
        builder.setTimeoutAfter(0L);
    }

    public static void v(MenuItem menuItem, CharSequence charSequence) {
        menuItem.setTooltipText(charSequence);
    }

    public static void w(Context context, Intent intent) {
        context.startForegroundService(intent);
    }
}
