sm8150-common: Apply ALS correction to the RAW sensor value
* Probably a derp here 07c6e1a71f
Signed-off-by: Rituj Beniwal <ritujbeniwal@gmail.com>
This commit is contained in:
parent
d782530f3a
commit
562f63234f
|
@ -73,11 +73,13 @@ void AlsCorrection::correct(float& light) {
|
|||
correction = correction * (((float) screen_brightness) / ((float) max_brightness));
|
||||
correction += als_bias;
|
||||
}
|
||||
ALOGV("Final correction: %f", correction);
|
||||
// Sensor is not accurate for low values
|
||||
if (light < correction) {
|
||||
if (light - correction >= 0) {
|
||||
light -= correction;
|
||||
} else {
|
||||
light = correction;
|
||||
}
|
||||
ALOGV("Corrected reading: %f", light);
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
|
|
Loading…
Reference in New Issue