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

Skip to content
Commit 8f0fb929 authored by Daniel Solomon's avatar Daniel Solomon
Browse files

Cancel brightness slider animation before checking its value

One of the checks that occurs before initiating a brightness slider
animation is a comparison of the current slider value versus the current
display brightness value.

There is a race condition wherein,
1. There's an outstanding animation that is about to move the slider to
a stale brightness value, but hasn't started yet.
2. A new animation to the current display brightness value is being
considered. During this time, the slider value (which hasn't been moved
yet by the outstanding animation) is being compared against the current
display brightness value. They match, and a new animation isn't started.
3. The animation from step #1 proceeds, and moves the slider to a
location that no longer matches the current display brightness value.

To fix this, we first cancel any outstanding slider animation, and only
then compare the slider's position to display brightness.

Bug: 202873446
Bug: 214849040
Test: Manual, sliding the brightness slider around and ensuring it stays
    in place after the user lets go of it.
Test: atest QuickQSBrightnessControllerTest BrightnessSliderTest
Change-Id: I036638561bef6c5f10a11f5e50957c39cd792705
parent 2f53619f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment