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

Commit 499f61aa authored by Evan Rosky's avatar Evan Rosky Committed by Android (Google) Code Review
Browse files

Merge changes I1375c198,I49bc9bb6

* changes:
  Clean-up some out-dated layout shenanigans
  Fix Restore transition
parents 248e3e59 4fb1e911
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -443,7 +443,7 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants {
         * Returns true if the window is current in multi-windowing mode. i.e. it shares the
         * screen with other application windows.
         */
        public boolean isInMultiWindowMode();
        boolean inMultiWindowMode();

        public int getRotationAnimationHint();

+4 −0
Original line number Diff line number Diff line
@@ -2237,6 +2237,10 @@ public class AppTransition implements Dump {
                || transit == TRANSIT_ACTIVITY_RELAUNCH;
    }

    static boolean isChangeTransit(int transit) {
        return transit == TRANSIT_TASK_CHANGE_WINDOWING_MODE;
    }

    /**
     * @return whether the transition should show the thumbnail being scaled down.
     */
+8 −1
Original line number Diff line number Diff line
@@ -513,8 +513,11 @@ public class AppTransitionController {
        // Given no app transition pass it through instead of a wallpaper transition.
        // Never convert the crashing transition.
        // Never update the transition for the wallpaper if we are just docking from recents
        // Never convert a change transition since the top activity isn't changing and will likely
        // still be above an opening wallpaper.
        if (transit == TRANSIT_NONE || transit == TRANSIT_CRASHING_ACTIVITY_CLOSE
                || transit == TRANSIT_DOCK_TASK_FROM_RECENTS) {
                || transit == TRANSIT_DOCK_TASK_FROM_RECENTS
                || AppTransition.isChangeTransit(transit)) {
            return transit;
        }

@@ -601,6 +604,10 @@ public class AppTransitionController {
     */
    @VisibleForTesting
    int maybeUpdateTransitToTranslucentAnim(int transit) {
        if (AppTransition.isChangeTransit(transit)) {
            // There's no special animation to handle change animations with translucent apps
            return transit;
        }
        final boolean taskOrActivity = AppTransition.isTaskTransit(transit)
                || AppTransition.isActivityTransit(transit);
        boolean allOpeningVisible = true;
+17 −32
Original line number Diff line number Diff line
@@ -1747,7 +1747,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
    }

    boolean isInChangeTransition() {
        return mTransitChangeLeash != null || isChangeTransition(mTransit);
        return mTransitChangeLeash != null || AppTransition.isChangeTransit(mTransit);
    }

    @VisibleForTesting
@@ -1979,7 +1979,14 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
                mLetterbox.attachInput(w);
            }
            getPosition(mTmpPoint);
            mLetterbox.layout(getParent().getBounds(), w.getFrameLw(), mTmpPoint);
            // Get the bounds of the "space-to-fill". We union the Task and the Stack bounds here
            // to handle both split window (where task-bounds can be larger) and orientation
            // letterbox (where the task is letterboxed within stack).
            Rect spaceToFill = getTask().getBounds();
            if (getStack() != null) {
                spaceToFill.union(getStack().getBounds());
            }
            mLetterbox.layout(spaceToFill, w.getFrameLw(), mTmpPoint);
        } else if (mLetterbox != null) {
            mLetterbox.hide();
        }
@@ -2448,30 +2455,6 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
        return boundsLayer;
    }

    /** Get position and crop region of animation. */
    @VisibleForTesting
    void getAnimationBounds(Point outPosition, Rect outBounds) {
        outPosition.set(0, 0);
        outBounds.setEmpty();

        final TaskStack stack = getStack();
        final Task task = getTask();
        if (task != null && task.inFreeformWindowingMode()) {
            task.getRelativeDisplayedPosition(outPosition);
        } else if (stack != null) {
            stack.getRelativeDisplayedPosition(outPosition);
        }

        // Always use stack bounds in order to have the ability to animate outside the task region.
        // It also needs to be consistent when {@link #mNeedsAnimationBoundsLayer} is set that crops
        // according to the bounds.
        if (stack != null) {
            stack.getBounds(outBounds);
        }
        // We have the relative position so the local position can be removed from bounds.
        outBounds.offsetTo(0, 0);
    }

    @Override
    Rect getDisplayedBounds() {
        final Task task = getTask();
@@ -2484,10 +2467,6 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
        return getBounds();
    }

    private static boolean isChangeTransition(int transit) {
        return transit == TRANSIT_TASK_CHANGE_WINDOWING_MODE;
    }

    boolean applyAnimationLocked(WindowManager.LayoutParams lp, int transit, boolean enter,
            boolean isVoiceInteraction) {

@@ -2507,9 +2486,15 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
        if (okToAnimate()) {
            final AnimationAdapter adapter;
            AnimationAdapter thumbnailAdapter = null;
            getAnimationBounds(mTmpPoint, mTmpRect);

            boolean isChanging = isChangeTransition(transit) && enter;
            // Separate position and size for use in animators. Use task-bounds for now so
            // that activity-level letterbox (maxAspectRatio) is included in the animation.
            mTmpRect.set(getTask() != null ? getTask().getBounds() : getBounds());
            mTmpPoint.set(mTmpRect.left, mTmpRect.top);
            mTmpRect.offsetTo(0, 0);

            final boolean isChanging = AppTransition.isChangeTransit(transit) && enter
                    && getDisplayContent().mChangingApps.contains(this);

            // Delaying animation start isn't compatible with remote animations at all.
            if (getDisplayContent().mAppTransition.getRemoteAnimationController() != null
+1 −1
Original line number Diff line number Diff line
@@ -2146,7 +2146,7 @@ public class DisplayPolicy {
        // TYPE_SYSTEM_ERROR is above the NavigationBar so it can't be allowed to extend over it.
        // Also, we don't allow windows in multi-window mode to extend out of the screen.
        if ((fl & FLAG_LAYOUT_NO_LIMITS) != 0 && type != TYPE_SYSTEM_ERROR
                && !win.isInMultiWindowMode()) {
                && !win.inMultiWindowMode()) {
            df.left = df.top = -10000;
            df.right = df.bottom = 10000;
            if (type != TYPE_WALLPAPER) {
Loading