diff options
| author | 2016-04-20 20:37:45 -0700 | |
|---|---|---|
| committer | 2016-04-21 14:54:17 -0700 | |
| commit | 4ccfc30a80d6b63cc938ce3578b19773ca00a2ea (patch) | |
| tree | 08cdd6a1c96ea66f6b9365dae27a5e9a422aa685 | |
| parent | b8c5876dc020959e133c0c7975d8ef65e4d47a27 (diff) | |
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
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityStack.java | 4 | ||||
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityStarter.java | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index b043311b2d5e..61f2af089e08 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -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); } diff --git a/services/core/java/com/android/server/am/ActivityStarter.java b/services/core/java/com/android/server/am/ActivityStarter.java index 4d24a8b7dc97..6622b34c1106 100644 --- a/services/core/java/com/android/server/am/ActivityStarter.java +++ b/services/core/java/com/android/server/am/ActivityStarter.java @@ -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; } |