package com.ucar.vehiclesdk;

import a.a.a.b;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.SurfaceView;

public class UCarSurfaceView extends SurfaceView {

    /* renamed from: a  reason: collision with root package name */
    private static final String f230a = "UCarSurfaceView";

    public UCarSurfaceView(Context context) {
        super(context);
    }

    public UCarSurfaceView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
    }

    public boolean onTouchEvent(MotionEvent motionEvent) {
        b.a(f230a, "onTouchEvent, action:" + motionEvent.getAction());
        int action = motionEvent.getAction();
        int pointerCount = motionEvent.getPointerCount();
        int[] iArr = new int[pointerCount];
        int[] iArr2 = new int[pointerCount];
        int[] iArr3 = new int[pointerCount];
        for (int i = 0; i < pointerCount; i++) {
            iArr[i] = motionEvent.getPointerId(i);
            iArr2[i] = (int) motionEvent.getX(motionEvent.findPointerIndex(motionEvent.getPointerId(i)));
            iArr3[i] = (int) motionEvent.getY(motionEvent.findPointerIndex(motionEvent.getPointerId(i)));
        }
        UCarAdapter.getInstance().sendTouchEvent(action, pointerCount, iArr, iArr2, iArr3);
        if (motionEvent.getAction() == 0) {
            performClick();
        }
        return super.onTouchEvent(motionEvent);
    }

    public boolean performClick() {
        return super.performClick();
    }
}
