Fixing timeout caused by non executed animation

The problem became apparent after a springboard activity
called another activity and a moveTaskToFront got requested.

This issue is similar to ag/1647538 where an
ExecuteAppTransision was missing and a timeout occured.

Bug: 33307856
Test: Start PlayStore on ARC++ several times to see that
it shows up immediately and not after a considerable delay.

Change-Id: I25b63bd65385a4ad45bbb1803ae92fb48fe5fe4d
(cherry picked from commit 06f78e83d1010fa5420c7fe88a0b27eb3651bdc3)
This commit is contained in:
skuhne@google.com
2016-12-09 13:41:29 -08:00
committed by Stefan Kuhne
parent 221bffe01b
commit 1b974dc979
2 changed files with 12 additions and 9 deletions

View File

@@ -2150,9 +2150,7 @@ final class ActivityStack extends ConfigurationContainer {
mStackSupervisor.allResumedActivitiesComplete()) {
// Make sure we have executed any pending transitions, since there
// should be nothing left to do at this point.
mWindowManager.executeAppTransition();
mNoAnimActivities.clear();
ActivityOptions.abort(options);
executeAppTransition(options);
if (DEBUG_STATES) Slog.d(TAG_STATES,
"resumeTopActivityLocked: Top activity resumed " + next);
if (DEBUG_STACK) mStackSupervisor.validateTopActivitiesLocked();
@@ -2187,9 +2185,7 @@ final class ActivityStack extends ConfigurationContainer {
&& mStackSupervisor.allPausedActivitiesComplete()) {
// Make sure we have executed any pending transitions, since there
// should be nothing left to do at this point.
mWindowManager.executeAppTransition();
mNoAnimActivities.clear();
ActivityOptions.abort(options);
executeAppTransition(options);
if (DEBUG_STATES) Slog.d(TAG_STATES,
"resumeTopActivityLocked: Going to sleep and all paused");
if (DEBUG_STACK) mStackSupervisor.validateTopActivitiesLocked();
@@ -2252,9 +2248,7 @@ final class ActivityStack extends ConfigurationContainer {
// So, nothing else to-do except:
// Make sure we have executed any pending transitions, since there
// should be nothing left to do at this point.
mWindowManager.executeAppTransition();
mNoAnimActivities.clear();
ActivityOptions.abort(options);
executeAppTransition(options);
if (DEBUG_STATES) Slog.d(TAG_STATES,
"resumeTopActivityLocked: Top activity resumed (dontWaitForPause) " + next);
if (DEBUG_STACK) mStackSupervisor.validateTopActivitiesLocked();
@@ -5056,4 +5050,10 @@ final class ActivityStack extends ConfigurationContainer {
mTaskHistory.get(taskNdx).setLockTaskAuth();
}
}
void executeAppTransition(ActivityOptions options) {
mWindowManager.executeAppTransition();
mNoAnimActivities.clear();
ActivityOptions.abort(options);
}
}

View File

@@ -1844,6 +1844,9 @@ public class ActivityStackSupervisor extends ConfigurationContainer
final ActivityRecord r = mFocusedStack.topRunningActivityLocked();
if (r == null || r.state != RESUMED) {
mFocusedStack.resumeTopActivityUncheckedLocked(null, null);
} else if (r.state == RESUMED) {
// Kick off any lingering app transitions form the MoveTaskToFront operation.
mFocusedStack.executeAppTransition(targetOptions);
}
return false;
}