Skip to content

Commit 257e67e

Browse files
Christopher TateAndroid (Google) Code Review
authored andcommitted
Merge "Don't inappropriately kill ANRing drop recipients"
2 parents 8de952b + 05e9c65 commit 257e67e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

services/java/com/android/server/wm/Session.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,15 @@ public void reportDropResult(IWindow window, boolean consumed) {
306306
synchronized (mService.mWindowMap) {
307307
long ident = Binder.clearCallingIdentity();
308308
try {
309-
if (mService.mDragState == null || mService.mDragState.mToken != token) {
309+
if (mService.mDragState == null) {
310+
// Most likely the drop recipient ANRed and we ended the drag
311+
// out from under it. Log the issue and move on.
312+
Slog.w(WindowManagerService.TAG, "Drop result given but no drag in progress");
313+
return;
314+
}
315+
316+
if (mService.mDragState.mToken != token) {
317+
// We're in a drag, but the wrong window has responded.
310318
Slog.w(WindowManagerService.TAG, "Invalid drop-result claim by " + window);
311319
throw new IllegalStateException("reportDropResult() by non-recipient");
312320
}

0 commit comments

Comments
 (0)