Skip to content

Commit

Permalink
decrease the light-sensor rate to 1Hz (from ~15Hz) for ALS purposes.
Browse files Browse the repository at this point in the history
the intent here is to save power.

Change-Id: I6cc1cae865cc46551afcfcec9ca03faaa5b6936f
  • Loading branch information
pixelflinger committed Nov 9, 2011
1 parent 3af8b88 commit 47f1fe5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions services/java/com/android/server/PowerManagerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -3049,7 +3052,7 @@ private void enableLightSensorLocked(boolean enable) {
try {
if (enable) {
mSensorManager.registerListener(mLightListener, mLightSensor,
SensorManager.SENSOR_DELAY_NORMAL);
LIGHT_SENSOR_RATE);
} else {
mSensorManager.unregisterListener(mLightListener);
mHandler.removeCallbacks(mAutoBrightnessTask);
Expand Down

0 comments on commit 47f1fe5

Please sign in to comment.