Skip to content

Commit 26824b7

Browse files
Maciej BiałkaJean-Baptiste Queru
authored andcommitted
Remove the window from being a target for motion events when it is destroyed.
If window was destroyed when touch was pressed this destroyed window was still considered as a target for motion events. In some cases this could result with hang up inside event dispatch procedure. Change-Id: I2ede17a40b14b2f509ab3d2560abb65292324f45
1 parent 4598804 commit 26824b7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

services/java/com/android/server/WindowManagerService.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2149,6 +2149,7 @@ && updateOrientationFromAppTokensLocked()) {
21492149
private void removeWindowInnerLocked(Session session, WindowState win) {
21502150
mKeyWaiter.finishedKey(session, win.mClient, true,
21512151
KeyWaiter.RETURN_NOTHING);
2152+
mKeyWaiter.releaseMotionTarget(win);
21522153
mKeyWaiter.releasePendingPointerLocked(win.mSession);
21532154
mKeyWaiter.releasePendingTrackballLocked(win.mSession);
21542155

@@ -6120,6 +6121,12 @@ void releasePendingTrackballLocked(Session s) {
61206121
}
61216122
}
61226123

6124+
void releaseMotionTarget(WindowState win) {
6125+
if (mMotionTarget == win) {
6126+
mMotionTarget = null;
6127+
}
6128+
}
6129+
61236130
MotionEvent finishedKey(Session session, IWindow client, boolean force,
61246131
int returnWhat) {
61256132
if (DEBUG_INPUT) Slog.v(

0 commit comments

Comments
 (0)