package C0;

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

/* JADX INFO: renamed from: C0.q, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0116q {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final Object f627a;

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final int f629c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final int f630d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final int f631e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public int f632f;

    /* JADX WARN: Removed duplicated region for block: B:27:0x0055  */
    /* JADX WARN: Removed duplicated region for block: B:28:0x0057  */
    /* JADX WARN: Removed duplicated region for block: B:29:0x0059  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public C0116q(List list, C0109j c0109j) {
        MotionEvent motionEventA;
        this.f627a = list;
        this.f628b = c0109j;
        int i6 = 0;
        this.f629c = (Build.VERSION.SDK_INT < 29 || (motionEventA = a()) == null) ? 0 : motionEventA.getClassification();
        MotionEvent motionEventA2 = a();
        this.f630d = motionEventA2 != null ? motionEventA2.getButtonState() : 0;
        MotionEvent motionEventA3 = a();
        this.f631e = motionEventA3 != null ? motionEventA3.getMetaState() : 0;
        MotionEvent motionEventA4 = a();
        if (motionEventA4 != null) {
            int actionMasked = motionEventA4.getActionMasked();
            if (actionMasked == 0) {
                i6 = 1;
            } else if (actionMasked == 1) {
                i6 = 2;
            } else if (actionMasked != 2) {
                switch (actionMasked) {
                    case 7:
                        i6 = 3;
                        break;
                    case 8:
                        i6 = 6;
                        break;
                    case 9:
                        i6 = 4;
                        break;
                    case 10:
                        i6 = 5;
                        break;
                }
            }
        } else {
            int size = list.size();
            while (i6 < size) {
                C0124z c0124z = (C0124z) list.get(i6);
                if (AbstractC0123y.d(c0124z)) {
                    i6 = 2;
                } else if (AbstractC0123y.b(c0124z)) {
                    i6 = 1;
                } else {
                    i6++;
                }
            }
            i6 = 3;
        }
        this.f632f = i6;
    }

    public final MotionEvent a() {
        C0109j c0109j = this.f628b;
        if (c0109j != null) {
            return (MotionEvent) ((T.p) c0109j.f608d).f6346c;
        }
        return null;
    }
}
