Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bba0ac0b authored by Luca Zuccarini's avatar Luca Zuccarini
Browse files

Update RemoteTransition wrapper to better match pre-Shell behavior.

Specifically, activity->activity transitions used to be categorized as
apps, whereas now they are categorized as nonApps because they don't
have a task associated with them.

Bug: 320961634
Flag: NA
Test: see videos in b/320963010 for the before/after of an animation that
worked pre-Shell

Change-Id: Ie7b35e4619b1f47d366f98382703e2b6add56a52
parent 5e0cc0b9
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -40,7 +40,15 @@ public class RemoteAnimationTargetCompat {
     */
    public static RemoteAnimationTarget[] wrapApps(TransitionInfo info,
            SurfaceControl.Transaction t, ArrayMap<SurfaceControl, SurfaceControl> leashMap) {
        return wrap(info, t, leashMap, new TransitionUtil.LeafTaskFilter());
        // LeafTaskFilter is order-dependent, so the same object needs to be used for all Change
        // objects. That's why it's constructed here and captured by the lambda instead of building
        // a new one ad hoc every time.
        TransitionUtil.LeafTaskFilter taskFilter = new TransitionUtil.LeafTaskFilter();
        return wrap(info, t, leashMap, (change) -> {
            // Intra-task activity -> activity transitions should be categorized as apps.
            if (change.getActivityComponent() != null) return true;
            return taskFilter.test(change);
        });
    }

    /**
@@ -53,8 +61,12 @@ public class RemoteAnimationTargetCompat {
     */
    public static RemoteAnimationTarget[] wrapNonApps(TransitionInfo info, boolean wallpapers,
            SurfaceControl.Transaction t, ArrayMap<SurfaceControl, SurfaceControl> leashMap) {
        return wrap(info, t, leashMap, (change) -> (wallpapers
                ? TransitionUtil.isWallpaper(change) : TransitionUtil.isNonApp(change)));
        return wrap(info, t, leashMap, (change) -> {
            // Intra-task activity -> activity transitions should be categorized as apps.
            if (change.getActivityComponent() != null) return false;
            return wallpapers
                    ? TransitionUtil.isWallpaper(change) : TransitionUtil.isNonApp(change);
        });
    }

    private static RemoteAnimationTarget[] wrap(TransitionInfo info,