Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4a1bafb authored by Mathias Agopian's avatar Mathias Agopian Committed by Android (Google) Code Review
Browse files

Merge "decrease the light-sensor rate to 1Hz (from ~15Hz) for ALS purposes." into ics-mr1

parents cd489c4c 47f1fe52
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -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
@@ -3049,7 +3052,7 @@ public class PowerManagerService extends IPowerManager.Stub
            try {
                if (enable) {
                    mSensorManager.registerListener(mLightListener, mLightSensor,
                            SensorManager.SENSOR_DELAY_NORMAL);
                            LIGHT_SENSOR_RATE);
                } else {
                    mSensorManager.unregisterListener(mLightListener);
                    mHandler.removeCallbacks(mAutoBrightnessTask);