Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Unified Diff: device/generic_sensor/platform_sensor_ambient_light_mac.cc

Issue 2447273002: [sensors] [mac] Fix ambient light sensor not updating its value when closing the lid with a monitor… (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/generic_sensor/platform_sensor_ambient_light_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « device/generic_sensor/platform_sensor_ambient_light_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698