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
Loading
Please register or sign in to comment