summaryrefslogtreecommitdiff
path: root/libs/binder/ProcessState.cpp
diff options
context:
space:
mode:
author Rob Carr <racarr@google.com> 2020-03-06 12:44:45 -0800
committer Rob Carr <racarr@google.com> 2020-03-06 15:38:33 -0800
commit9a2cc990b0a4f7670b38d28913a5ef0e809ffe4f (patch)
tree55cb5d79b81bdca8bfefe166b33d05ea0f9c91da /libs/binder/ProcessState.cpp
parent34560b6d0950b54497d70a319d5496ccc0ffec10 (diff)
SurfaceFlinger: Ensure syncInputWindows is processed.
Imagine the following situation: 1. We set mPendingInputWindowCommands.syncInputWindows = true, and block on the condition variable from a binder thread. 2. We Handle MessageQueue::INVALIDATE 3. This will invoke handleTransaction which will copy mPendingInputWindowCommands to mInputWindowCommands and clear mPendingInputWindowCommands 4. Now imagine due to the performSetActiveConfig conditional in MessageQueue::INVALIDATE handler we break out of our handling before calling updateInputFlinger. 5. Since we didn't call updateInputFlinger we will never receive setInputWindowsFinished and the condition variable is still blocking 6. The next time we enter MessageQueue::INVALIDATE we have already cleared mPendingInput WindowCommands, and so by the time we get to updateInputFligner we no longer think a sync is required and don't request the callback. 7. No callback ever arrives, our binder thread blocks for the whole 5 seconds. To fix this we just ensure mInputWindowCommands.syncInputWindows wont become false after becoming true until we actually are sure we will broadcast the condition variable. Bug: 147257069 Test: Existing tests pass Change-Id: I5f5728c29f36bb5e0bdf11b3f34e956bb529706f
Diffstat (limited to 'libs/binder/ProcessState.cpp')
0 files changed, 0 insertions, 0 deletions