When waiting for activity to finish don't reset

In cases where the client is waiting for an activity to launch
(startActivityMayWait()) it is a bad idea to clear
ActivityRecord.displayStartTime when going into the pause state. If
displayStartTime is cleared before the activity is displayed,
the client will never be released.

This fix keeps pause from clearing displayStartTime if any client
is waiting for the activity to be displayed.

Fixes bug 10095558. But not a permanent fix, startActivityMayWait()
should not be called by any production code.

Change-Id: I7cbdcb04256f4a26233867c52aedd3bc4151adc3
This commit is contained in:
Craig Mautner
2013-09-06 11:59:38 -07:00
parent bdd61696c6
commit 5c494547af

View File

@@ -620,7 +620,13 @@ final class ActivityStack {
}
void clearLaunchTime(ActivityRecord r) {
r.displayStartTime = r.fullyDrawnStartTime = 0;
// Make sure that there is no activity waiting for this to launch.
if (mStackSupervisor.mWaitingActivityLaunched.isEmpty()) {
r.displayStartTime = r.fullyDrawnStartTime = 0;
} else {
mStackSupervisor.removeTimeoutsForActivityLocked(r);
mStackSupervisor.scheduleIdleTimeoutLocked(r);
}
}
void awakeFromSleepingLocked() {