package androidx.lifecycle;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/* JADX INFO: renamed from: androidx.lifecycle.c, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1094c {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final HashMap f12158a = new HashMap();

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final HashMap f12159b;

    public C1094c(HashMap map) {
        this.f12159b = map;
        for (Map.Entry entry : map.entrySet()) {
            EnumC1107p enumC1107p = (EnumC1107p) entry.getValue();
            List arrayList = (List) this.f12158a.get(enumC1107p);
            if (arrayList == null) {
                arrayList = new ArrayList();
                this.f12158a.put(enumC1107p, arrayList);
            }
            arrayList.add((C1095d) entry.getKey());
        }
    }

    public static void a(List list, InterfaceC1113w interfaceC1113w, EnumC1107p enumC1107p, InterfaceC1112v interfaceC1112v) {
        if (list != null) {
            for (int size = list.size() - 1; size >= 0; size--) {
                C1095d c1095d = (C1095d) list.get(size);
                c1095d.getClass();
                try {
                    int i6 = c1095d.f12163a;
                    Method method = c1095d.f12164b;
                    if (i6 == 0) {
                        method.invoke(interfaceC1112v, new Object[0]);
                    } else if (i6 == 1) {
                        method.invoke(interfaceC1112v, interfaceC1113w);
                    } else if (i6 == 2) {
                        method.invoke(interfaceC1112v, interfaceC1113w, enumC1107p);
                    }
                } catch (IllegalAccessException e6) {
                    throw new RuntimeException(e6);
                } catch (InvocationTargetException e7) {
                    throw new RuntimeException("Failed to call observer method", e7.getCause());
                }
            }
        }
    }
}
