DO NOT MERGE - cherry-picked from master:
PowerManager: Fix problem waking screen from negative proximity sensor events.
Fixes bug b/2048591
Signed-off-by: Mike Lockwood <lockwood@android.com>
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java
index 447e9fa..1249289 100644
--- a/services/java/com/android/server/PowerManagerService.java
+++ b/services/java/com/android/server/PowerManagerService.java
@@ -2054,7 +2054,15 @@
if (event.values[0] == 0.0) {
goToSleep(milliseconds);
} else {
- userActivity(milliseconds, false);
+ // proximity sensor negative events user activity.
+ // temporarily set mUserActivityAllowed to true so this will work
+ // even when the keyguard is on.
+ synchronized (mLocks) {
+ boolean savedActivityAllowed = mUserActivityAllowed;
+ mUserActivityAllowed = true;
+ userActivity(milliseconds, false);
+ mUserActivityAllowed = savedActivityAllowed;
+ }
}
}