[sensors] [mac] Fix ambient light sensor not updating its value when closing the lid with a monitor connected.

Right now we use IOServiceAddInterestNotification with kIOGeneralInterest
as a way to get value changes from the AppleLMUController whenever
the ambient light condition changes.

However when closing the lid rapidly and a monitor is connected (which
prevents the computer to go to sleep) we don't receive a notification
and callback from the controller the whole way (until the lid is fully
closed). It means that the latest value received in JavaScript is not what
would be expected : as a developer point of view, lid closed = dark = 0.0
as a lux value.

The patch now listen kIOBusyInterest as well because when closing
the lid the AppleLMUController sends busy events which we can use
to fetch the value of the sensor and report it back in JavaScript.

BUG=606766

Review-Url: https://codereview.chromium.org/2447273002
Cr-Commit-Position: refs/heads/master@{#431046}
2 files changed