Allow phone to enter suspend with positive proximity.

As part of the power manager rewrite in JB MR1, we removed the ability
for the phone to suspend with positive proximity because it was not
clear that the proximity sensor was always correctly registered as
a wake-up source.  The sensor service itself does not contain any
code to manage wake-ups.  Therefore proximity sensor based wake-up
relies on the sensor driver acquiring a timed wake lock when the
sensor reports a negative result.  This behavior is not very well
defined in the sensor HAL so there is a chance that it will not
work reliably on all devices.

This change adds a new config.xml resource to specify whether the
device should be allowed to suspend when the screen is off due to
positive proximity.  Devices that support this feature should set
the "config_suspendWhenScreenOffDueToProximity" resource to "true" in
their resource overlays.  The feature is disabled by default.

Bug: 9760828
Change-Id: Ic65ab7df0357271b133e2e44f5e35e7756e1e9e0
4 files changed