package com.reyun.wandun;

import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.util.Log;

public class WdSensorEventListener implements SensorEventListener {
    private SensorManager mSensorManager;
    private Context mContext;
    public WdSensorEventListener(Context context, SensorManager sm) {
        mSensorManager = sm;
        mContext = context;
    }

    @Override
    public void onSensorChanged(SensorEvent event) {
        float[] fArr = event.values;
        event.sensor.getType();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < fArr.length; i++) {
            sb.append(fArr[i] + "");
            sb.append(" , ");
        }
        Log.d("WdSdk", "onSensorChanged: " + event.sensor.getType() + " --> " + sb.toString());
        //   onSensorChangedNative(event);
        mSensorManager.unregisterListener(this);
    }

    @Override
    public void onAccuracyChanged(Sensor sensor, int accuracy) {

    }
}
