summaryrefslogtreecommitdiff
path: root/docs/html/sdk/api_diff/12/changes
diff options
context:
space:
mode:
authorSiarhei Vishniakou <svv@google.com>2018-03-09 15:38:12 -0800
committerSiarhei Vishniakou <svv@google.com>2018-04-04 14:22:13 -0700
commitc6442335be20f2435b7b67c419e5f7cad9921afa (patch)
tree1b8345026129482c56108a8320cffa1eb52ff0e0 /docs/html/sdk/api_diff/12/changes
parenta9c406bacb87055491138a693390ec8169a795a0 (diff)
Dismiss Dialog in post instead of immediately
When ViewGroup is dispatching touch events to children, it can happen that a child, upon receiving a touch event, may decide to close the window. In this case, dispatchDetachedFromWindow will be called, which would invalidate (=recycle) the TouchTargets. As the ViewGroup would continue dispatching the event to other children, those TouchTargets would already no longer be valid. This could cause an NPE. In one particular example, there could be several views in a Dialog, and one of the views would dismiss the Dialog in a click handler. Since the click handler executes events immediately, this makes ViewGroup.dispatchTouchEvent recurse on itself, and modify the internal state. This would later cause the NPE. Calling dismiss in a message avoids this issue by letting the event handling finish before dispatching dispatchDetachedFromWindow, which would cause another ACTION_CANCEL to be sent to the view. Bug: 26611563 Test: created a sample app and recorded a sequence of touch events using inputstudio in order to reproduce the crash. The repro rate was 100%. Could no longer repro with this change. Change-Id: Ia1d8070152c7ba2d14cddebcc5844994fe3ab5da
Diffstat (limited to 'docs/html/sdk/api_diff/12/changes')
0 files changed, 0 insertions, 0 deletions