Shift Recents task to top when opening Recents.

Unlike usual opening/closing app transition, the Recents task should
above Home task when opening recents, otherwise the home task would
above the recents task so it will seems like the home been add into
recents animation.

Bug: 207297486
Test: enable shell transition, setup 3rd-party launcher as default
home. Entering recents at home page and verify the home task won't
stay on top.

Change-Id: I9bac97cb79febf112ec9ac1bdbe3de205604b01d
This commit is contained in:
wilsonshih
2022-01-14 11:12:48 +08:00
committed by Wei Sheng Shih
parent ad88b15572
commit 798075a566

View File

@@ -25,6 +25,8 @@ import static android.view.WindowManager.TRANSIT_TO_BACK;
import static android.view.WindowManager.TRANSIT_TO_FRONT;
import static android.window.TransitionFilter.CONTAINER_ORDER_TOP;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.ACTIVITY_TYPE_RECENTS;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
@@ -145,6 +147,11 @@ public class RemoteTransitionCompat implements Parcelable {
&& taskInfo.pictureInPictureParams.isAutoEnterEnabled()) {
pipTask = taskInfo.token;
}
} else if (change.getTaskInfo() != null
&& change.getTaskInfo().topActivityType == ACTIVITY_TYPE_RECENTS) {
// This task is for recents, keep it on top.
t.setLayer(leashMap.get(change.getLeash()),
info.getChanges().size() * 3 - i);
}
}
// Also make all the wallpapers opaque since we want the visible from the start