Index: device/generic_sensor/platform_sensor_ambient_light_mac.cc |
diff --git a/device/generic_sensor/platform_sensor_ambient_light_mac.cc b/device/generic_sensor/platform_sensor_ambient_light_mac.cc |
index d83114c3ac3d3dbb8b174ccd66d6619b604c1335..e96299e4db013927a9c1121e1aaf261c6e8aa5d9 100644 |
--- a/device/generic_sensor/platform_sensor_ambient_light_mac.cc |
+++ b/device/generic_sensor/platform_sensor_ambient_light_mac.cc |
@@ -94,6 +94,13 @@ bool PlatformSensorAmbientLightMac::StartSensor( |
if (kr != KERN_SUCCESS) |
return false; |
+ kr = IOServiceAddInterestNotification( |
+ light_sensor_port_.get(), light_sensor_service_, kIOBusyInterest, |
+ IOServiceCallback, this, |
+ light_sensor_busy_notification_.InitializeInto()); |
+ if (kr != KERN_SUCCESS) |
+ return false; |
+ |
kr = IOServiceOpen(light_sensor_service_, mach_task_self(), 0, |
light_sensor_object_.InitializeInto()); |
if (kr != KERN_SUCCESS) |
@@ -109,6 +116,7 @@ bool PlatformSensorAmbientLightMac::StartSensor( |
void PlatformSensorAmbientLightMac::StopSensor() { |
light_sensor_port_.reset(); |
light_sensor_notification_.reset(); |
+ light_sensor_busy_notification_.reset(); |
light_sensor_object_.reset(); |
light_sensor_service_.reset(); |
current_lux_ = 0.0; |