Skip to content

Commit e4a1baf

Browse files
pixelflingerAndroid (Google) Code Review
authored andcommitted
Merge "decrease the light-sensor rate to 1Hz (from ~15Hz) for ALS purposes." into ics-mr1
2 parents cd489c4 + 47f1fe5 commit e4a1baf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

services/java/com/android/server/PowerManagerService.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,13 @@ public class PowerManagerService extends IPowerManager.Stub
100100
private static final int LONG_KEYLIGHT_DELAY = 6000; // t+6 sec
101101
private static final int LONG_DIM_TIME = 7000; // t+N-5 sec
102102

103-
// How long to wait to debounce light sensor changes.
103+
// How long to wait to debounce light sensor changes in milliseconds
104104
private static final int LIGHT_SENSOR_DELAY = 2000;
105105

106-
// For debouncing the proximity sensor.
106+
// light sensor events rate in microseconds
107+
private static final int LIGHT_SENSOR_RATE = 1000000;
108+
109+
// For debouncing the proximity sensor in milliseconds
107110
private static final int PROXIMITY_SENSOR_DELAY = 1000;
108111

109112
// trigger proximity if distance is less than 5 cm
@@ -3049,7 +3052,7 @@ private void enableLightSensorLocked(boolean enable) {
30493052
try {
30503053
if (enable) {
30513054
mSensorManager.registerListener(mLightListener, mLightSensor,
3052-
SensorManager.SENSOR_DELAY_NORMAL);
3055+
LIGHT_SENSOR_RATE);
30533056
} else {
30543057
mSensorManager.unregisterListener(mLightListener);
30553058
mHandler.removeCallbacks(mAutoBrightnessTask);

0 commit comments

Comments
 (0)