Skip to content
Commit 37427762 authored by Fiona Campbell's avatar Fiona Campbell
Browse files

Fix memory leak in BrightnessSynchronizer

Previously, a queue would be written to, a lot more often than items
were removed from it. This caused it to grow massively.

This cl changes the way that the synchronizer works, updating both
values when needed and avoiding potential race conditions.

It's relevant to note that mDisplayManager.setBrightness will only change the value if it is different, but Settings.System.putIntForUser will set it regardless, therefore causing a second "int changed" message to be sent.

Bug: 177523959
Test: manual
Test: loop this command: adb shell settings put system screen_brightness \
$((RANDOM%100))
Test: loop this command: adb shell settings put system \
screen_brightness_float 0.$((RANDOM%100))

Change-Id: I6cafb48c204ce5245c4450a6098473e06c334667
parent 89681165
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment