summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Martin Wallgren <martin.wallgren@sonyericsson.com> 2011-08-31 12:39:31 +0200
committer Johan Redestig <johan.redestig@sonymobile.com> 2013-12-19 13:24:00 +0100
commitc8733b818d9e7eef0d986128f16d12145486b69f (patch)
tree7d68c89d378e7f13a3dc51031a932c5ef13ed23c
parenta11371f42b4dd793a48faa3323be34bca0f6d2e6 (diff)
Keydispatching timeout while finish Activity
If there is input to be handled during finish activity we can get a keydispatching timeout ANR. The reason is that finish activity is some times not possible, and the activity is instead put on a finish queue. The activity will then be finished sometime in the future. When we add the activity to the finish queue, key dispatching is paused, and there is an ANR timer waiting for it to be resumed again. Since it can take a long time before the activity is actually finished, we need to resume the key dispatching to avoid the ANR. Change-Id: Icea4ab3b5ad05c8bfbadf8f5cece1a59ec621469
-rw-r--r--services/java/com/android/server/am/ActivityStack.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index 47593f27a77f..37f4cd7a32af 100644
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -2526,6 +2526,7 @@ final class ActivityStack {
// activity into the stopped state and then finish it.
if (localLOGV) Slog.v(TAG, "Enqueueing pending finish: " + r);
mStackSupervisor.mFinishingActivities.add(r);
+ r.resumeKeyDispatchingLocked();
mStackSupervisor.getFocusedStack().resumeTopActivityLocked(null);
return r;
}