package d2;

import android.view.MotionEvent;
import java.util.List;

/* loaded from: classes.dex */
public final class m {

    /* renamed from: a, reason: collision with root package name */
    private final List f15827a;

    /* renamed from: b, reason: collision with root package name */
    private final g f15828b;

    /* renamed from: c, reason: collision with root package name */
    private final int f15829c;

    /* renamed from: d, reason: collision with root package name */
    private final int f15830d;

    /* renamed from: e, reason: collision with root package name */
    private int f15831e;

    public m(List list, g gVar) {
        this.f15827a = list;
        this.f15828b = gVar;
        MotionEvent e10 = e();
        this.f15829c = l.a(e10 != null ? e10.getButtonState() : 0);
        MotionEvent e11 = e();
        this.f15830d = l0.b(e11 != null ? e11.getMetaState() : 0);
        this.f15831e = a();
    }

    private final int a() {
        MotionEvent e10 = e();
        if (e10 == null) {
            List list = this.f15827a;
            int size = list.size();
            for (int i10 = 0; i10 < size; i10++) {
                y yVar = (y) list.get(i10);
                if (n.d(yVar)) {
                    return q.f15839a.e();
                }
                if (n.b(yVar)) {
                    return q.f15839a.d();
                }
            }
            return q.f15839a.c();
        }
        int actionMasked = e10.getActionMasked();
        if (actionMasked != 0) {
            if (actionMasked != 1) {
                if (actionMasked != 2) {
                    switch (actionMasked) {
                        case 5:
                            break;
                        case 6:
                            break;
                        case 7:
                            break;
                        case 8:
                            return q.f15839a.f();
                        case 9:
                            return q.f15839a.a();
                        case 10:
                            return q.f15839a.b();
                        default:
                            return q.f15839a.g();
                    }
                }
                return q.f15839a.c();
            }
            return q.f15839a.e();
        }
        return q.f15839a.d();
    }

    public final int b() {
        return this.f15829c;
    }

    public final List c() {
        return this.f15827a;
    }

    public final g d() {
        return this.f15828b;
    }

    public final MotionEvent e() {
        g gVar = this.f15828b;
        if (gVar != null) {
            return gVar.c();
        }
        return null;
    }

    public final int f() {
        return this.f15831e;
    }

    public final void g(int i10) {
        this.f15831e = i10;
    }

    public m(List list) {
        this(list, null);
    }
}
