DO NOT MERGE: Dynamic doze check should be required before adjusting sensor rate.

Some devices have catastrophic firmware issues in switching the sensor rate;
for these devices, the sensor rate switch should be skipped entirely.

Change-Id: I04fc3d27c99f95b33f86f012a8d398f817f7713a
This commit is contained in:
Julius D'souza
2017-09-05 10:17:06 -07:00
parent 02d802e71e
commit 1f3da1c8b9

View File

@@ -275,9 +275,9 @@ class AutomaticBrightnessController {
boolean enableSensor = enable && !dozing;
if (enableSensor && !mLightSensorEnabled && mActiveDozeLightSensor) {
mActiveDozeLightSensor = false;
} else if (!enableSensor && mLightSensorEnabled) {
} else if (!enableSensor && mLightSensorEnabled && mLuxLevels.hasDynamicDozeBrightness()) {
// keep the light sensor active until another light sample is taken while dozing
mActiveDozeLightSensor = mLuxLevels.hasDynamicDozeBrightness();
mActiveDozeLightSensor = true;
adjustLightSensorRate(mInitialLightSensorRate);
if (mUseNewSensorSamplesForDoze) {
mAmbientLightRingBuffer.clear();