package o;

import java.util.ArrayList;
import java.util.Map;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class YB implements InterfaceC2677v1 {
    public final /* synthetic */ int l;
    public final /* synthetic */ androidx.fragment.app.s m;

    public /* synthetic */ YB(androidx.fragment.app.s sVar, int i) {
        this.l = i;
        this.m = sVar;
    }

    @Override // o.InterfaceC2677v1
    public final void c(Object obj) {
        switch (this.l) {
            case 0:
                Map map = (Map) obj;
                String[] strArr = (String[]) map.keySet().toArray(new String[0]);
                ArrayList arrayList = new ArrayList(map.values());
                int[] iArr = new int[arrayList.size()];
                for (int i = 0; i < arrayList.size(); i++) {
                    iArr[i] = ((Boolean) arrayList.get(i)).booleanValue() ? 0 : -1;
                }
                androidx.fragment.app.s sVar = this.m;
                C0985dC c0985dC = (C0985dC) sVar.C.pollFirst();
                if (c0985dC != null) {
                    String str = c0985dC.l;
                    int i2 = c0985dC.m;
                    androidx.fragment.app.l lVarC = sVar.c.c(str);
                    if (lVarC != null) {
                        lVarC.onRequestPermissionsResult(i2, strArr, iArr);
                        break;
                    }
                }
                break;
            case 1:
                C2582u1 c2582u1 = (C2582u1) obj;
                androidx.fragment.app.s sVar2 = this.m;
                C0985dC c0985dC2 = (C0985dC) sVar2.C.pollFirst();
                if (c0985dC2 != null) {
                    String str2 = c0985dC2.l;
                    int i3 = c0985dC2.m;
                    androidx.fragment.app.l lVarC2 = sVar2.c.c(str2);
                    if (lVarC2 != null) {
                        lVarC2.onActivityResult(i3, c2582u1.l, c2582u1.m);
                        break;
                    }
                }
                break;
            default:
                C2582u1 c2582u12 = (C2582u1) obj;
                androidx.fragment.app.s sVar3 = this.m;
                C0985dC c0985dC3 = (C0985dC) sVar3.C.pollFirst();
                if (c0985dC3 != null) {
                    String str3 = c0985dC3.l;
                    int i4 = c0985dC3.m;
                    androidx.fragment.app.l lVarC3 = sVar3.c.c(str3);
                    if (lVarC3 != null) {
                        lVarC3.onActivityResult(i4, c2582u12.l, c2582u12.m);
                        break;
                    }
                }
                break;
        }
    }
}
