summaryrefslogtreecommitdiff
path: root/libs/gui/BufferQueueThreadState.cpp
diff options
context:
space:
mode:
author Prabir Pradhan <prabirmsp@google.com> 2022-10-31 21:09:21 +0000
committer Prabir Pradhan <prabirmsp@google.com> 2022-10-31 21:55:37 +0000
commit211ba627f011fb25c4457a12bee7919c93334361 (patch)
treee80211bb3896d1eb5b7aaa305ee000f92dc1ecbe /libs/gui/BufferQueueThreadState.cpp
parentae4d05384bebad96510969e859dc2af1bd6b81c4 (diff)
Use the last cooked touch state for generating button release events
This bug was exposed by the refactor in ag/20068126 that cleans up the CookedPointerState by ensuring it is always zero-initialized. Button release events are generated before the touch state change events are generated. If the touch goes up before or at the same time as the button goes up, the "current" touch state will have no pointers. The old logic got around this by using the getting the values for the "last" touch state's pointers from the "current" touch state. This wrong, because the "last" state's pointers no longer exist in the "current" state. However, because the CookedState copying logic never reset the underlying PointerCoords data after the pointer is lifted, the "last" state's pointer's values were essentially preserved in the "current" state in some cases. This meant the expected behavior was observed most of the time even though the logic was incorrect. This CL corrects the button release event generation logic to ensure that "last" state is used when generating those events. Bug: 245989146 Test: atest inputflinger_tests Change-Id: I9889e7f816f4ba885eae783ebf4c7721eb60db3a
Diffstat (limited to 'libs/gui/BufferQueueThreadState.cpp')
0 files changed, 0 insertions, 0 deletions