summaryrefslogtreecommitdiff
path: root/core/java/android/inputmethodservice/InputMethodService.java
diff options
context:
space:
mode:
authorDaniel Solomon <solomondaniel@google.com>2022-01-21 16:45:49 -0800
committerDaniel Solomon <solomondaniel@google.com>2022-01-21 18:18:24 -0800
commit8f0fb92919de27f07efb2e641a802b13daa987a5 (patch)
tree593bef1fbc7c1aa92c7c63a4131ecfd4979ee5ab /core/java/android/inputmethodservice/InputMethodService.java
parent2f53619f594c07e6e452791d4759e7ac008fced3 (diff)
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
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
0 files changed, 0 insertions, 0 deletions