Merge "Fix bad animation when pressing Home with translucent activity" into nyc-dev

am: c70e264de1

* commit 'c70e264de102a1e1a4b77018bcc4eded08d4b254':
  Fix bad animation when pressing Home with translucent activity

Change-Id: I18d0d0f09e68fe1db70c0edc511eac1cba222d53
This commit is contained in:
Chong Zhang
2016-05-03 17:32:00 +00:00
committed by android-build-merger

View File

@@ -2339,8 +2339,20 @@ final class ActivityStack {
if (DEBUG_SWITCH) Slog.v(TAG_SWITCH, "Resume running: " + next
+ " stopped=" + next.stopped + " visible=" + next.visible);
// If the previous activity is translucent, force a visibility update of
// the next activity, so that it's added to WM's opening app list, and
// transition animation can be set up properly.
// For example, pressing Home button with a translucent activity in focus.
// Launcher is already visible in this case. If we don't add it to opening
// apps, maybeUpdateTransitToWallpaper() will fail to identify this as a
// TRANSIT_WALLPAPER_OPEN animation, and run some funny animation.
final boolean lastActivityTranslucent = lastStack != null
&& (!lastStack.mFullscreen
|| (lastStack.mLastPausedActivity != null
&& !lastStack.mLastPausedActivity.fullscreen));
// This activity is now becoming visible.
if (!next.visible || next.stopped) {
if (!next.visible || next.stopped || lastActivityTranslucent) {
mWindowManager.setAppVisibility(next.appToken, true);
}