From ec0832133a2115e065eed6e330da95b5c518003b Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Wed, 11 Sep 2013 20:45:25 -0700 Subject: [PATCH] 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 --- core/res/res/values/config.xml | 7 ++ core/res/res/values/symbols.xml | 1 + .../server/power/DisplayPowerController.java | 100 +++++++++++++----- .../server/power/PowerManagerService.java | 58 ++++++++-- 4 files changed, 128 insertions(+), 38 deletions(-) diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index ab95d4006bc06..83e5ae9aa9437 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -450,6 +450,13 @@ The default is false. --> false + + false +