Animation fixes when task is not resumed

- Make sure to add the activity to mWaitingVisibleActivities
to not destroy the activity before the app transition has
started.
- Defer layouts in startActivityUnchecked so when clearing the
current activities in the current stack, we don't execute the
app transition yet. We need to wait until the new activities
are added as well.

Bug: 28026847
Change-Id: I252cf139e06197ea34329d1466f1f6162f3e7a30
This commit is contained in:
Jorim Jaggi
2016-04-20 20:37:45 -07:00
parent b8c5876dc0
commit 4ccfc30a80
2 changed files with 10 additions and 3 deletions

View File

@@ -3431,8 +3431,10 @@ final class ActivityStack {
mWindowManager.prepareAppTransition(transit, false);
mWindowManager.setAppVisibility(r.appToken, false);
mWindowManager.executeAppTransition();
mStackSupervisor.mWaitingVisibleActivities.add(r);
}
return finishCurrentActivityLocked(r, FINISH_AFTER_PAUSE, oomAdj) == null;
return finishCurrentActivityLocked(r,
r.visible ? FINISH_AFTER_VISIBLE : FINISH_AFTER_PAUSE, oomAdj) == null;
} else {
if (DEBUG_PAUSE) Slog.v(TAG_PAUSE, "Finish waiting for pause of: " + r);
}

View File

@@ -527,8 +527,13 @@ class ActivityStarter {
doPendingActivityLaunchesLocked(false);
err = startActivityUnchecked(
r, sourceRecord, voiceSession, voiceInteractor, startFlags, true, options, inTask);
try {
mService.mWindowManager.deferSurfaceLayout();
err = startActivityUnchecked(r, sourceRecord, voiceSession, voiceInteractor, startFlags,
true, options, inTask);
} finally {
mService.mWindowManager.continueSurfaceLayout();
}
postStartActivityUncheckedProcessing(r, err, stack.mStackId);
return err;
}