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

Commit 2be12211 authored by Chris Li's avatar Chris Li Committed by Android (Google) Code Review
Browse files

Merge "Exclude embedded TaskFragment from non-app windows" into tm-qpr-dev

parents 4355d317 51ee2e37
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_OPEN;
import static android.view.WindowManager.TRANSIT_TO_BACK;
import static android.view.WindowManager.TRANSIT_TO_FRONT;
import static android.window.TransitionInfo.FLAG_IN_TASK_WITH_EMBEDDED_ACTIVITY;
import static android.window.TransitionInfo.FLAG_IS_WALLPAPER;
import static android.window.TransitionInfo.FLAG_STARTING_WINDOW_TRANSFER_RECIPIENT;

@@ -228,7 +229,8 @@ public class RemoteAnimationTargetCompat {
    public static RemoteAnimationTarget[] wrapNonApps(TransitionInfo info, boolean wallpapers,
            SurfaceControl.Transaction t, ArrayMap<SurfaceControl, SurfaceControl> leashMap) {
        return wrap(info, t, leashMap, (change, taskInfo) -> (taskInfo == null)
                && wallpapers == ((change.getFlags() & TransitionInfo.FLAG_IS_WALLPAPER) != 0));
                && wallpapers == change.hasFlags(FLAG_IS_WALLPAPER)
                && !change.hasFlags(FLAG_IN_TASK_WITH_EMBEDDED_ACTIVITY));
    }

    private static RemoteAnimationTarget[] wrap(TransitionInfo info,
+5 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_OPEN;
import static android.window.TransitionInfo.FLAG_FIRST_CUSTOM;
import static android.window.TransitionInfo.FLAG_IN_TASK_WITH_EMBEDDED_ACTIVITY;
import static android.window.TransitionInfo.FLAG_IS_WALLPAPER;
import static android.window.TransitionInfo.FLAG_SHOW_WALLPAPER;
import static android.window.TransitionInfo.FLAG_TRANSLUCENT;
@@ -69,10 +70,13 @@ public class RemoteTransitionTest extends SysuiTestCase {
        TransitionInfo combined = new TransitionInfoBuilder(TRANSIT_CLOSE)
                .addChange(TRANSIT_CHANGE, FLAG_SHOW_WALLPAPER,
                        createTaskInfo(1 /* taskId */, ACTIVITY_TYPE_STANDARD))
                // Embedded TaskFragment should be excluded when animated with Task.
                .addChange(TRANSIT_CLOSE, FLAG_IN_TASK_WITH_EMBEDDED_ACTIVITY, null /* taskInfo */)
                .addChange(TRANSIT_CLOSE, 0 /* flags */,
                        createTaskInfo(2 /* taskId */, ACTIVITY_TYPE_STANDARD))
                .addChange(TRANSIT_OPEN, FLAG_IS_WALLPAPER, null /* taskInfo */)
                .addChange(TRANSIT_CHANGE, FLAG_FIRST_CUSTOM, null /* taskInfo */).build();
                .addChange(TRANSIT_CHANGE, FLAG_FIRST_CUSTOM, null /* taskInfo */)
                .build();
        // Check apps extraction
        RemoteAnimationTarget[] wrapped = RemoteAnimationTargetCompat.wrapApps(combined,
                mock(SurfaceControl.Transaction.class), null /* leashes */);