package com.tencent.mm.plugin.appbrand.jsapi.p;

import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import com.tencent.mm.plugin.appbrand.jsapi.c;
import com.tencent.mm.plugin.appbrand.jsapi.p.l.a;
import com.tencent.mm.plugin.appbrand.s.j;
import com.tencent.mm.sdk.platformtools.ab;

abstract class d$b extends a implements SensorEventListener {
    d$a hVG = new d$a();
    private j hVu;
    private boolean hVy;

    d$b(c cVar) {
        this.hVG.j(cVar);
        this.hVu = new j((long) i.hVW.aEN(), new 1(this, cVar));
    }

    public void onSensorChanged(SensorEvent sensorEvent) {
        if (!this.hVy && sensorEvent.sensor.getType() == 3) {
            float[] fArr = sensorEvent.values;
            if (fArr == null || fArr.length < 3) {
                ab.w("MicroMsg.JsApiEnableDeviceMotion", "deviceMotion sensor callback data invalidate.");
                return;
            }
            boolean l = this.hVu.l(new Object[]{fArr});
            ab.v("MicroMsg.JsApiEnableDeviceMotion", "try to do frequency limit action(%s).", new Object[]{Boolean.valueOf(l)});
        }
    }

    public void onAccuracyChanged(Sensor sensor, int i) {
    }

    public final void aEP() {
        this.hVy = true;
    }
}
