package IMuAHx_6.KQgRr5e_0.KQgRr5e_0;

import android.util.SparseArray;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/* compiled from: UnifiedListenerManager.java */
/* loaded from: classes.dex */
public class Xgtqvk_8 {

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final List<Integer> f58KQgRr5e_0 = new ArrayList();
    public final IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0 KQgRr5e_0 = new KQgRr5e_0();

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final SparseArray<ArrayList<IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0>> f57KQgRr5e_0 = new SparseArray<>();

    public synchronized void QxJ9d_1(int i) {
        this.f57KQgRr5e_0.remove(i);
    }

    public synchronized void KQgRr5e_0(int i) {
        if (this.f58KQgRr5e_0.contains(Integer.valueOf(i))) {
            return;
        }
        this.f58KQgRr5e_0.add(Integer.valueOf(i));
    }

    /* compiled from: UnifiedListenerManager.java */
    /* loaded from: classes.dex */
    public class KQgRr5e_0 implements IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0 {
        public KQgRr5e_0() {
        }

        @Override // IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0
        public void KQgRr5e_0(PGPF6hQ_2 pGPF6hQ_2) {
            IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0[] QxJ9d_1 = Xgtqvk_8.QxJ9d_1(pGPF6hQ_2, Xgtqvk_8.this.f57KQgRr5e_0);
            if (QxJ9d_1 == null) {
                return;
            }
            for (IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0 kQgRr5e_0 : QxJ9d_1) {
                if (kQgRr5e_0 != null) {
                    kQgRr5e_0.KQgRr5e_0(pGPF6hQ_2);
                }
            }
        }

        @Override // IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0
        public void PGPF6hQ_2(PGPF6hQ_2 pGPF6hQ_2, int i, long j) {
            IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0[] QxJ9d_1 = Xgtqvk_8.QxJ9d_1(pGPF6hQ_2, Xgtqvk_8.this.f57KQgRr5e_0);
            if (QxJ9d_1 == null) {
                return;
            }
            for (IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0 kQgRr5e_0 : QxJ9d_1) {
                if (kQgRr5e_0 != null) {
                    kQgRr5e_0.PGPF6hQ_2(pGPF6hQ_2, i, j);
                }
            }
        }

        @Override // IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0
        public void QxJ9d_1(PGPF6hQ_2 pGPF6hQ_2, int i, Map<String, List<String>> map) {
            IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0[] QxJ9d_1 = Xgtqvk_8.QxJ9d_1(pGPF6hQ_2, Xgtqvk_8.this.f57KQgRr5e_0);
            if (QxJ9d_1 == null) {
                return;
            }
            for (IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0 kQgRr5e_0 : QxJ9d_1) {
                if (kQgRr5e_0 != null) {
                    kQgRr5e_0.QxJ9d_1(pGPF6hQ_2, i, map);
                }
            }
        }

        @Override // IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0
        public void KQgRr5e_0(PGPF6hQ_2 pGPF6hQ_2, Map<String, List<String>> map) {
            IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0[] QxJ9d_1 = Xgtqvk_8.QxJ9d_1(pGPF6hQ_2, Xgtqvk_8.this.f57KQgRr5e_0);
            if (QxJ9d_1 == null) {
                return;
            }
            for (IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0 kQgRr5e_0 : QxJ9d_1) {
                if (kQgRr5e_0 != null) {
                    kQgRr5e_0.KQgRr5e_0(pGPF6hQ_2, map);
                }
            }
        }

        @Override // IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0
        public void QxJ9d_1(PGPF6hQ_2 pGPF6hQ_2, int i, long j) {
            IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0[] QxJ9d_1 = Xgtqvk_8.QxJ9d_1(pGPF6hQ_2, Xgtqvk_8.this.f57KQgRr5e_0);
            if (QxJ9d_1 == null) {
                return;
            }
            for (IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0 kQgRr5e_0 : QxJ9d_1) {
                if (kQgRr5e_0 != null) {
                    kQgRr5e_0.QxJ9d_1(pGPF6hQ_2, i, j);
                }
            }
        }

        @Override // IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0
        public void KQgRr5e_0(PGPF6hQ_2 pGPF6hQ_2, IMuAHx_6.KQgRr5e_0.KQgRr5e_0.XnFJ5_9.Mqv2r_3.PGPF6hQ_2 pGPF6hQ_22, IMuAHx_6.KQgRr5e_0.KQgRr5e_0.XnFJ5_9.X6FRs_4.QxJ9d_1 qxJ9d_1) {
            IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0[] QxJ9d_1 = Xgtqvk_8.QxJ9d_1(pGPF6hQ_2, Xgtqvk_8.this.f57KQgRr5e_0);
            if (QxJ9d_1 == null) {
                return;
            }
            for (IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0 kQgRr5e_0 : QxJ9d_1) {
                if (kQgRr5e_0 != null) {
                    kQgRr5e_0.KQgRr5e_0(pGPF6hQ_2, pGPF6hQ_22, qxJ9d_1);
                }
            }
        }

        @Override // IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0
        public void KQgRr5e_0(PGPF6hQ_2 pGPF6hQ_2, IMuAHx_6.KQgRr5e_0.KQgRr5e_0.XnFJ5_9.Mqv2r_3.PGPF6hQ_2 pGPF6hQ_22) {
            IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0[] QxJ9d_1 = Xgtqvk_8.QxJ9d_1(pGPF6hQ_2, Xgtqvk_8.this.f57KQgRr5e_0);
            if (QxJ9d_1 == null) {
                return;
            }
            for (IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0 kQgRr5e_0 : QxJ9d_1) {
                if (kQgRr5e_0 != null) {
                    kQgRr5e_0.KQgRr5e_0(pGPF6hQ_2, pGPF6hQ_22);
                }
            }
        }

        @Override // IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0
        public void KQgRr5e_0(PGPF6hQ_2 pGPF6hQ_2, int i, Map<String, List<String>> map) {
            IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0[] QxJ9d_1 = Xgtqvk_8.QxJ9d_1(pGPF6hQ_2, Xgtqvk_8.this.f57KQgRr5e_0);
            if (QxJ9d_1 == null) {
                return;
            }
            for (IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0 kQgRr5e_0 : QxJ9d_1) {
                if (kQgRr5e_0 != null) {
                    kQgRr5e_0.KQgRr5e_0(pGPF6hQ_2, i, map);
                }
            }
        }

        @Override // IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0
        public void KQgRr5e_0(PGPF6hQ_2 pGPF6hQ_2, int i, int i2, Map<String, List<String>> map) {
            IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0[] QxJ9d_1 = Xgtqvk_8.QxJ9d_1(pGPF6hQ_2, Xgtqvk_8.this.f57KQgRr5e_0);
            if (QxJ9d_1 == null) {
                return;
            }
            for (IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0 kQgRr5e_0 : QxJ9d_1) {
                if (kQgRr5e_0 != null) {
                    kQgRr5e_0.KQgRr5e_0(pGPF6hQ_2, i, i2, map);
                }
            }
        }

        @Override // IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0
        public void KQgRr5e_0(PGPF6hQ_2 pGPF6hQ_2, int i, long j) {
            IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0[] QxJ9d_1 = Xgtqvk_8.QxJ9d_1(pGPF6hQ_2, Xgtqvk_8.this.f57KQgRr5e_0);
            if (QxJ9d_1 == null) {
                return;
            }
            for (IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0 kQgRr5e_0 : QxJ9d_1) {
                if (kQgRr5e_0 != null) {
                    kQgRr5e_0.KQgRr5e_0(pGPF6hQ_2, i, j);
                }
            }
        }

        @Override // IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0
        public void KQgRr5e_0(PGPF6hQ_2 pGPF6hQ_2, IMuAHx_6.KQgRr5e_0.KQgRr5e_0.XnFJ5_9.X6FRs_4.KQgRr5e_0 kQgRr5e_0, Exception exc) {
            IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0[] QxJ9d_1 = Xgtqvk_8.QxJ9d_1(pGPF6hQ_2, Xgtqvk_8.this.f57KQgRr5e_0);
            if (QxJ9d_1 == null) {
                return;
            }
            for (IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0 kQgRr5e_02 : QxJ9d_1) {
                if (kQgRr5e_02 != null) {
                    kQgRr5e_02.KQgRr5e_0(pGPF6hQ_2, kQgRr5e_0, exc);
                }
            }
            if (Xgtqvk_8.this.f58KQgRr5e_0.contains(Integer.valueOf(pGPF6hQ_2.KQgRr5e_0()))) {
                Xgtqvk_8.this.QxJ9d_1(pGPF6hQ_2.KQgRr5e_0());
            }
        }
    }

    public synchronized void QxJ9d_1(PGPF6hQ_2 pGPF6hQ_2, IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0 kQgRr5e_0) {
        KQgRr5e_0(pGPF6hQ_2, kQgRr5e_0);
        pGPF6hQ_2.KQgRr5e_0(this.KQgRr5e_0);
    }

    public synchronized void KQgRr5e_0(PGPF6hQ_2 pGPF6hQ_2, IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0 kQgRr5e_0) {
        int KQgRr5e_02 = pGPF6hQ_2.KQgRr5e_0();
        ArrayList<IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0> arrayList = this.f57KQgRr5e_0.get(KQgRr5e_02);
        if (arrayList == null) {
            arrayList = new ArrayList<>();
            this.f57KQgRr5e_0.put(KQgRr5e_02, arrayList);
        }
        if (!arrayList.contains(kQgRr5e_0)) {
            arrayList.add(kQgRr5e_0);
            if (kQgRr5e_0 instanceof IMuAHx_6.KQgRr5e_0.KQgRr5e_0.XnFJ5_9.KNBe_11.PGPF6hQ_2.PGPF6hQ_2) {
                ((IMuAHx_6.KQgRr5e_0.KQgRr5e_0.XnFJ5_9.KNBe_11.PGPF6hQ_2.PGPF6hQ_2) kQgRr5e_0).KQgRr5e_0(true);
            }
        }
    }

    public static IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0[] QxJ9d_1(PGPF6hQ_2 pGPF6hQ_2, SparseArray<ArrayList<IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0>> sparseArray) {
        ArrayList<IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0> arrayList = sparseArray.get(pGPF6hQ_2.KQgRr5e_0());
        if (arrayList == null || arrayList.size() <= 0) {
            return null;
        }
        IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0[] kQgRr5e_0Arr = new IMuAHx_6.KQgRr5e_0.KQgRr5e_0.KQgRr5e_0[arrayList.size()];
        arrayList.toArray(kQgRr5e_0Arr);
        return kQgRr5e_0Arr;
    }
}
