package com.apm.insight.runtime;

import androidx.annotation.NonNull;
import com.apm.insight.CrashType;
import com.apm.insight.ICrashCallback;
import com.apm.insight.IOOMCallback;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

/* JADX INFO: loaded from: classes.dex */
public final class c {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private final List<ICrashCallback> f5463a = new CopyOnWriteArrayList();

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private final List<ICrashCallback> f5464b = new CopyOnWriteArrayList();

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private final List<ICrashCallback> f5465c = new CopyOnWriteArrayList();

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private final List<ICrashCallback> f5466d = new CopyOnWriteArrayList();

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private final List<IOOMCallback> f5467e = new CopyOnWriteArrayList();

    /* JADX INFO: renamed from: com.apm.insight.runtime.c$1, reason: invalid class name */
    public static /* synthetic */ class AnonymousClass1 {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        static final /* synthetic */ int[] f5468a;

        static {
            int[] iArr = new int[CrashType.values().length];
            f5468a = iArr;
            try {
                iArr[CrashType.ALL.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                f5468a[CrashType.ANR.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                f5468a[CrashType.JAVA.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                f5468a[CrashType.LAUNCH.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                f5468a[CrashType.NATIVE.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
        }
    }

    @NonNull
    public final List<IOOMCallback> a() {
        return this.f5467e;
    }

    @NonNull
    public final List<ICrashCallback> b() {
        return this.f5463a;
    }

    @NonNull
    public final List<ICrashCallback> c() {
        return this.f5464b;
    }

    @NonNull
    public final List<ICrashCallback> d() {
        return this.f5465c;
    }

    @NonNull
    public final List<ICrashCallback> e() {
        return this.f5466d;
    }

    public final void a(ICrashCallback iCrashCallback, CrashType crashType) {
        int i10 = AnonymousClass1.f5468a[crashType.ordinal()];
        if (i10 == 1) {
            this.f5463a.add(iCrashCallback);
            this.f5464b.add(iCrashCallback);
            this.f5465c.add(iCrashCallback);
            this.f5466d.add(iCrashCallback);
            return;
        }
        if (i10 == 2) {
            this.f5466d.add(iCrashCallback);
            return;
        }
        if (i10 == 3) {
            this.f5464b.add(iCrashCallback);
        } else if (i10 == 4) {
            this.f5463a.add(iCrashCallback);
        } else {
            if (i10 != 5) {
                return;
            }
            this.f5465c.add(iCrashCallback);
        }
    }

    public final void b(ICrashCallback iCrashCallback, CrashType crashType) {
        int i10 = AnonymousClass1.f5468a[crashType.ordinal()];
        if (i10 == 1) {
            this.f5463a.remove(iCrashCallback);
            this.f5464b.remove(iCrashCallback);
            this.f5465c.remove(iCrashCallback);
            this.f5466d.remove(iCrashCallback);
            return;
        }
        if (i10 == 2) {
            this.f5466d.remove(iCrashCallback);
            return;
        }
        if (i10 == 3) {
            this.f5464b.remove(iCrashCallback);
        } else if (i10 == 4) {
            this.f5463a.remove(iCrashCallback);
        } else {
            if (i10 != 5) {
                return;
            }
            this.f5465c.remove(iCrashCallback);
        }
    }

    public final void a(IOOMCallback iOOMCallback) {
        this.f5467e.add(iOOMCallback);
    }

    public final void b(IOOMCallback iOOMCallback) {
        this.f5467e.remove(iOOMCallback);
    }
}
