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

Commit baf21c13 authored by Winson Chung's avatar Winson Chung Committed by Schneider Victor-tulias
Browse files

Synthetic target tweaks

- Just pass the app bounds for the synthetic target (so at least the
  bounds are valid)
- We should be sending the home task surface, and not the home task
  overlay surface

Bug: 366021931
Bug: 366022874
Test: atest WMShellUnitTests
Flag: EXEMPT bugfix
Change-Id: Id031024f53e03185f293b3689ef0742ea4b7b79d
parent c6ad9c24
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -360,7 +360,7 @@ public class TransitionUtil {
            windowConfiguration = new WindowConfiguration();
        }

        Rect localBounds = new Rect();
        Rect bounds = windowConfiguration.getBounds();
        RemoteAnimationTarget target = new RemoteAnimationTarget(
                taskId,
                newModeToLegacyMode(mode),
@@ -373,12 +373,12 @@ public class TransitionUtil {
                new Rect(0, 0, 0, 0),
                order,
                null,
                localBounds,
                new Rect(),
                bounds,
                bounds,
                windowConfiguration,
                isNotInRecents,
                null,
                new Rect(),
                bounds,
                taskInfo,
                false,
                INVALID_WINDOW_TYPE
+14 −0
Original line number Diff line number Diff line
@@ -487,6 +487,20 @@ public class ShellTaskOrganizer extends TaskOrganizer {
        return mHomeTaskOverlayContainer;
    }

    /**
     * Returns the home task surface, not for wide use.
     */
    @Nullable
    public SurfaceControl getHomeTaskSurface() {
        for (int i = 0; i < mTasks.size(); i++) {
            final TaskAppearedInfo info = mTasks.valueAt(i);
            if (info.getTaskInfo().getActivityType() == ACTIVITY_TYPE_HOME) {
                return info.getLeash();
            }
        }
        return null;
    }

    @Override
    public void addStartingWindow(StartingWindowInfo info) {
        if (mStartingWindow != null) {
+2 −2
Original line number Diff line number Diff line
@@ -544,10 +544,10 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler,
                            .findFirst()
                            .get();
            final RemoteAnimationTarget openingTarget = TransitionUtil.newSyntheticTarget(
                    homeTask, mShellTaskOrganizer.getHomeTaskOverlayContainer(), TRANSIT_OPEN,
                    homeTask, mShellTaskOrganizer.getHomeTaskSurface(), TRANSIT_OPEN,
                    0, true /* isTranslucent */);
            final RemoteAnimationTarget closingTarget = TransitionUtil.newSyntheticTarget(
                    homeTask, mShellTaskOrganizer.getHomeTaskOverlayContainer(), TRANSIT_CLOSE,
                    homeTask, mShellTaskOrganizer.getHomeTaskSurface(), TRANSIT_CLOSE,
                    0, true /* isTranslucent */);
            final ArrayList<RemoteAnimationTarget> apps = new ArrayList<>();
            apps.add(openingTarget);