summaryrefslogtreecommitdiff
path: root/libs/input/PointerController.cpp
diff options
context:
space:
mode:
author Nicolo' Mazzucato <nicomazz@google.com> 2023-01-09 08:04:05 +0000
committer Nicolò Mazzucato <nicomazz@google.com> 2023-01-09 11:36:51 +0000
commite4fccc2d9fd7382dacb4a546858eca93127c4c50 (patch)
treed6a58892adfa80489a4b2601db4c9d3f0075d28d /libs/input/PointerController.cpp
parentf2b5978c5ce53351ef5ce0c1b00f1e2b1af330ea (diff)
Fix DisplayManager race condition when state is unknown
The race was happening when: 1. STATE_UNKNOWN arrives to PhotonicModulator#setState. 2. Inside PhotonicModulator#setState, mStateChangeInprogress is set to true, and the setState method finishes. 3. in the run loop, in one iteration, we reach mLock.wait() (with mStateChangeInprogress still set to true, as the state changed from something to unknown). Now, setState can be executed again as the lock is not held anymore. 4. A new PhotonicModulator#setState arrives. however, mStateChangeInProgress is true, so mLock.notifyAll() is not called anymore. It was previously fixed by I903f6392cbe42031aab8ffdbfbe541463d6b5e01 making the display not going to UNKNOWN state anymore, but this cl fixes the general case and revert the changes to set the display to off in `onDisplayChanged`. Bug: 262294651 Test: Running foldable test suite for 20 times with abtd: before the fix it had high flakiness, after it had 0% flakiness. There are no tests for DisplayPowerState currently. Change-Id: I165b260d60e03c8e4707c7704847c77a225fd43d
Diffstat (limited to 'libs/input/PointerController.cpp')
0 files changed, 0 insertions, 0 deletions