Use ambient light to avoid false positives with magnetic cover sensors
Use ambient light to avoid false positives with magnetic cover sensors

Depending on shielding and magnet strength the magnetic cover sensors
can get triggered by a magnet underneath the device too. This is
problematic since the policy for the lid sensor is not to allow
turning display on for any reason - power key, double tap etc will
not function.

Ignore cover closed events while display is on unless they happen in
close proximity to ambient light level dropping close to zero.

Opening the cover is not subject to ALS rules and always turns on
the display.

[mce] Use ambient light to avoid false positives with magnetic cover sensors. Contributes to JB#29011

android-808/mce,android-808/mce,spiiroin/mce,maikelwever/mce,kimmoli/mce,mikkoharju/mce,maikelwever/mce,mikkoharju/mce,kimmoli/mce,mlehtima/mce,mikkoharju/mce,maikelwever/mce,kimmoli/mce,spiiroin/mce,spiiroin/mce,maikelwever/mce,android-808/mce,mikkoharju/mce,spiiroin/mce,mlehtima/mce,mlehtima/mce,mlehtima/mce,android-808/mce,kimmoli/mce