summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-11-09 21:51:32 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2011-11-09 21:51:32 +0000
commite55418beaf43b52b91f53342be1475c0524dcbd6 (patch)
treec57da233662a5333152ba816763a56a5be3bfbaf /services
parent1284a49315fed25571b8e7832ec31f7237492a96 (diff)
parenta508f056d0b5a439b9436604824739049fd25be6 (diff)
downloadframeworks_base-e55418beaf43b52b91f53342be1475c0524dcbd6.zip
frameworks_base-e55418beaf43b52b91f53342be1475c0524dcbd6.tar.gz
frameworks_base-e55418beaf43b52b91f53342be1475c0524dcbd6.tar.bz2
am a508f056: am e4a1bafb: Merge "decrease the light-sensor rate to 1Hz (from ~15Hz) for ALS purposes." into ics-mr1
* commit 'a508f056d0b5a439b9436604824739049fd25be6': decrease the light-sensor rate to 1Hz (from ~15Hz) for ALS purposes.
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/PowerManagerService.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/services/java/com/android/server/PowerManagerService.java b/services/java/com/android/server/PowerManagerService.java
index e97ee7a..5788a31 100644
--- a/services/java/com/android/server/PowerManagerService.java
+++ b/services/java/com/android/server/PowerManagerService.java
@@ -100,10 +100,13 @@ public class PowerManagerService extends IPowerManager.Stub
private static final int LONG_KEYLIGHT_DELAY = 6000; // t+6 sec
private static final int LONG_DIM_TIME = 7000; // t+N-5 sec
- // How long to wait to debounce light sensor changes.
+ // How long to wait to debounce light sensor changes in milliseconds
private static final int LIGHT_SENSOR_DELAY = 2000;
- // For debouncing the proximity sensor.
+ // light sensor events rate in microseconds
+ private static final int LIGHT_SENSOR_RATE = 1000000;
+
+ // For debouncing the proximity sensor in milliseconds
private static final int PROXIMITY_SENSOR_DELAY = 1000;
// trigger proximity if distance is less than 5 cm
@@ -3048,7 +3051,7 @@ public class PowerManagerService extends IPowerManager.Stub
handleLightSensorValue(value);
}
mSensorManager.registerListener(mLightListener, mLightSensor,
- SensorManager.SENSOR_DELAY_NORMAL);
+ LIGHT_SENSOR_RATE);
} else {
mSensorManager.unregisterListener(mLightListener);
mHandler.removeCallbacks(mAutoBrightnessTask);