diff options
| author | 2011-10-20 12:34:36 -0700 | |
|---|---|---|
| committer | 2011-10-20 12:34:36 -0700 | |
| commit | 05e9c65a53002e39306a0581310b4b0fceed7433 (patch) | |
| tree | 4bb764dfbc328716b20e89d3e49094c3afc5287c | |
| parent | ee00c0541e8f066550dcbd5bc8af257fce8d7944 (diff) | |
Don't inappropriately kill ANRing drop recipients
If an app takes the 5-second ANR timeout before responding to a
drop, but then recovers, we were inappropriately throwing an
exception back at it for having acknowledged the drop after we'd
abandoned the operation out from under it. Now we let such
responses slide without taking any punitive action: the app is
still okay, and the drag/drop operation was cleanly terminated
already anyway.
Bug 5045618
Change-Id: I0b7e76c61f0f8c97e41280b542a470a7d3c8d86f
| -rw-r--r-- | services/java/com/android/server/wm/Session.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/services/java/com/android/server/wm/Session.java b/services/java/com/android/server/wm/Session.java index 03b7546f8a7c..ee62a56ddc1f 100644 --- a/services/java/com/android/server/wm/Session.java +++ b/services/java/com/android/server/wm/Session.java @@ -306,7 +306,15 @@ final class Session extends IWindowSession.Stub synchronized (mService.mWindowMap) { long ident = Binder.clearCallingIdentity(); try { - if (mService.mDragState == null || mService.mDragState.mToken != token) { + if (mService.mDragState == null) { + // Most likely the drop recipient ANRed and we ended the drag + // out from under it. Log the issue and move on. + Slog.w(WindowManagerService.TAG, "Drop result given but no drag in progress"); + return; + } + + if (mService.mDragState.mToken != token) { + // We're in a drag, but the wrong window has responded. Slog.w(WindowManagerService.TAG, "Invalid drop-result claim by " + window); throw new IllegalStateException("reportDropResult() by non-recipient"); } |