summaryrefslogtreecommitdiff
path: root/libs/gui/BufferQueueThreadState.cpp
diff options
context:
space:
mode:
author Siarhei Vishniakou <svv@google.com> 2020-09-22 21:43:09 -0500
committer Siarhei Vishniakou <svv@google.com> 2020-09-24 04:33:38 +0000
commita72accd83cc7f7144ad19439c24d4db7a1572141 (patch)
treeee067234308225d8b4b2c4adecb6b7c3f1fc3a1e /libs/gui/BufferQueueThreadState.cpp
parentb0e74832ca6f87687d5eccbdc1b60c343b8e3b07 (diff)
Check window token when extending timeout
When the "no focused window" ANR is raised, the policy responds with a timeout. The timeout indicates whether or not to extend the ANR, and by how much. When we process the response from the policy, it is done in the 'commands' portion of the dispatch cycle. At that time, we already have lost the context about the ANR. We used to rely on the optional 'mNoFocusedWindowTimeout' being set to determine whether this is a 'no focused window' ANR. However, there's a better way to do this, by simply checking the inputs that were first provided to the policy. This way, we are free to modify 'mNoFocusedWindowTimeout' in other portions of the code. Other changes in this CL: * In 'onAnrLocked', we are assuming the connection is non-null, so let's pass it by reference. This will get us closer to the goal of using std::unique_ptr for the connection. * In 'InputDispatcher_test', when we had a missing ANR, we would go on to try to derefence a null (or empty) object. This caused crashes on hwasan build. Fix this by returning default pair when the error condition has been detected. Bug: 164754075 Test: atest inputflinger_tests Change-Id: I656315eda001f1fff31cd265eadce5397606b855
Diffstat (limited to 'libs/gui/BufferQueueThreadState.cpp')
0 files changed, 0 insertions, 0 deletions