I registered interrupt listener for light sensor. Listener gets event all the time even light level (lux) is not changed.
if (DeviceInfoHelper.isSensorSupported(context, mHostAppPackageName, SensorTypeValue.LIGHT)) {
lightSensor = sensorManager.getSensor(SensorTypeValue.LIGHT);
try {
if (lightSensor != null) {
lightSensor.registerInterruptListener(this);
Log.d(LOG_TAG, "register LightSensor ");
} else {
Log.w(LOG_TAG, "registerLightSensor: ERROR");
}
} catch (AccessorySensorException e) {
e.printStackTrace();
}
}