Make transit to home activity always be close transit
Previously, we used the wallpaper transition when going to the home activity. The idea was that on devices that have no wallpaper, this is safe. However, the check for the wallpaper was incorrect. A better approach is to detect when a task open transition is happening and check if it's the home task that is being brought to front. If yes, then we use a close transition, closing the previous activity to show the home activity Bug: 237371677 Bug: 220024691 Test: m && manually check that keyevent HOME fades out the top app Change-Id: I46ba3d363b581f07e153e032689261821cbbe9e4
This commit is contained in:
@@ -467,16 +467,6 @@ public class AppTransitionController {
|
||||
return TRANSIT_OLD_WALLPAPER_OPEN;
|
||||
}
|
||||
|
||||
// Some devices don't show a wallpaper. In that case we should still trigger wallpaper
|
||||
// transitions when animating to/from the home activity
|
||||
if (wallpaperTarget == null) {
|
||||
if (topOpeningApp != null && topOpeningApp.isActivityTypeHome()) {
|
||||
return TRANSIT_OLD_WALLPAPER_OPEN;
|
||||
} else if (topClosingApp != null && topClosingApp.isActivityTypeHome()) {
|
||||
return TRANSIT_OLD_WALLPAPER_CLOSE;
|
||||
}
|
||||
}
|
||||
|
||||
final ArraySet<WindowContainer> openingWcs = getAnimationTargets(
|
||||
openingApps, closingApps, true /* visible */);
|
||||
final ArraySet<WindowContainer> closingWcs = getAnimationTargets(
|
||||
@@ -488,6 +478,11 @@ public class AppTransitionController {
|
||||
@TransitContainerType int openingType = getTransitContainerType(openingContainer);
|
||||
@TransitContainerType int closingType = getTransitContainerType(closingContainer);
|
||||
if (appTransition.containsTransitRequest(TRANSIT_TO_FRONT) && openingType == TYPE_TASK) {
|
||||
if (topOpeningApp != null && topOpeningApp.isActivityTypeHome()) {
|
||||
// If we are opening the home task, we want to play an animation as if
|
||||
// the task on top is being brought to back.
|
||||
return TRANSIT_OLD_TASK_TO_BACK;
|
||||
}
|
||||
return TRANSIT_OLD_TASK_TO_FRONT;
|
||||
}
|
||||
if (appTransition.containsTransitRequest(TRANSIT_TO_BACK) && closingType == TYPE_TASK) {
|
||||
|
||||
Reference in New Issue
Block a user