summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-11-08 15:51:02 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-11-08 15:51:02 -0800
commit17479ebe90a5ebd17ee386b8fd83256765afce0b (patch)
treebdf83b93fcd737094dbdb146b7496aa512a28a09
parent1dacdd482894bee9fbc1993cbb525fb800750222 (diff)
parent497087e33d422d576d007f72fb970613d008f1cf (diff)
downloadframeworks_base-17479ebe90a5ebd17ee386b8fd83256765afce0b.zip
frameworks_base-17479ebe90a5ebd17ee386b8fd83256765afce0b.tar.gz
frameworks_base-17479ebe90a5ebd17ee386b8fd83256765afce0b.tar.bz2
Merge change I1bc566a1 into eclair
* changes: Ignore the light sensor if the screen is turning off.
-rw-r--r--services/java/com/android/server/PowerManagerService.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java
index af93d36..596325c 100644
--- a/services/java/com/android/server/PowerManagerService.java
+++ b/services/java/com/android/server/PowerManagerService.java
@@ -1440,6 +1440,8 @@ class PowerManagerService extends IPowerManager.Stub
sendNotificationLocked(true, -1);
}
} else {
+ // cancel light sensor task
+ mHandler.removeCallbacks(mAutoBrightnessTask);
mScreenOffTime = SystemClock.elapsedRealtime();
long identity = Binder.clearCallingIdentity();
try {
@@ -1803,6 +1805,10 @@ class PowerManagerService extends IPowerManager.Stub
}
}
+ private boolean isScreenTurningOffLocked() {
+ return (mScreenBrightness.animating && mScreenBrightness.targetValue == 0);
+ }
+
private void forceUserActivityLocked() {
// cancel animation so userActivity will succeed
mScreenBrightness.animating = false;
@@ -1863,7 +1869,7 @@ class PowerManagerService extends IPowerManager.Stub
+ " force=" + force);
}
// ignore user activity if we are in the process of turning off the screen
- if (mScreenBrightness.animating && mScreenBrightness.targetValue == 0) {
+ if (isScreenTurningOffLocked()) {
Log.d(TAG, "ignoring user activity while turning off screen");
return;
}
@@ -2441,6 +2447,11 @@ class PowerManagerService extends IPowerManager.Stub
SensorEventListener mLightListener = new SensorEventListener() {
public void onSensorChanged(SensorEvent event) {
synchronized (mLocks) {
+ // ignore light sensor while screen is turning off
+ if (isScreenTurningOffLocked()) {
+ return;
+ }
+
int value = (int)event.values[0];
long milliseconds = event.timestamp / 1000000;
if (mDebugLightSensor) {