diff options
| author | 2013-04-24 16:44:56 -0700 | |
|---|---|---|
| committer | 2013-04-24 16:44:56 -0700 | |
| commit | c64f73e7785507152358fbfa89be0ce7a0196692 (patch) | |
| tree | 8348625f0fb6b19b61f3a0d2f5dec536d945fb5d | |
| parent | eb95786fd3ffa9807a9d00c25e7c7e8a62d23658 (diff) | |
Fix startActivityAndWait bugs
- Send timeout message with a delay. The delay got lost when moving
from ActivityStack to ActivityStackSupervisor. Fixes bug 8687083.
- Remove waiting activities from list after they have been awoken.
Previously the list just got bigger and bigger.
Change-Id: Icb9e394db1eefa444e58c5416472017cac32298c
| -rw-r--r-- | services/java/com/android/server/am/ActivityStackSupervisor.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/services/java/com/android/server/am/ActivityStackSupervisor.java b/services/java/com/android/server/am/ActivityStackSupervisor.java index 528bf6fb2a6b..82944a96f717 100644 --- a/services/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/java/com/android/server/am/ActivityStackSupervisor.java @@ -438,7 +438,7 @@ public class ActivityStackSupervisor { void reportActivityLaunchedLocked(boolean timeout, ActivityRecord r, long thisTime, long totalTime) { for (int i = mWaitingActivityLaunched.size() - 1; i >= 0; i--) { - WaitResult w = mWaitingActivityLaunched.get(i); + WaitResult w = mWaitingActivityLaunched.remove(i); w.timeout = timeout; if (r != null) { w.who = new ComponentName(r.info.packageName, r.info.name); @@ -2182,7 +2182,8 @@ public class ActivityStackSupervisor { } void scheduleIdleTimeoutLocked(ActivityRecord next) { - mHandler.obtainMessage(IDLE_TIMEOUT_MSG, next).sendToTarget(); + Message msg = mHandler.obtainMessage(IDLE_TIMEOUT_MSG, next); + mHandler.sendMessageDelayed(msg, IDLE_TIMEOUT); } final void scheduleIdleLocked() { |