0
我註冊了光傳感器的中斷監聽器。監聽器始終獲取事件,即使亮度(勒克斯)不變。索尼SmartEyeglass光傳感器中斷監聽器始終獲取值
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();
}
}