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

Commit 31fdb654 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add a no-op animation for non-changing apps during change transition"

parents 1d4c240a cf76bedd
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import static android.view.WindowManager.TRANSIT_KEYGUARD_GOING_AWAY_ON_WALLPAPE
import static android.view.WindowManager.TRANSIT_KEYGUARD_OCCLUDE;
import static android.view.WindowManager.TRANSIT_KEYGUARD_UNOCCLUDE;
import static android.view.WindowManager.TRANSIT_NONE;
import static android.view.WindowManager.TRANSIT_TASK_CHANGE_WINDOWING_MODE;
import static android.view.WindowManager.TRANSIT_TASK_CLOSE;
import static android.view.WindowManager.TRANSIT_TASK_IN_PLACE;
import static android.view.WindowManager.TRANSIT_TASK_OPEN;
@@ -1662,6 +1663,15 @@ public class AppTransition implements Dump {
                    "applyAnimation NEXT_TRANSIT_TYPE_OPEN_CROSS_PROFILE_APPS:"
                            + " anim=" + a + " transit=" + appTransitionToString(transit)
                            + " isEntrance=true" + " Callers=" + Debug.getCallers(3));
        } else if (transit == TRANSIT_TASK_CHANGE_WINDOWING_MODE) {
            // In the absence of a specific adapter, we just want to keep everything stationary.
            a = new AlphaAnimation(1.f, 1.f);
            a.setDuration(WindowChangeAnimationSpec.ANIMATION_DURATION);
            if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
                Slog.v(TAG, "applyAnimation:"
                        + " anim=" + a + " transit=" + appTransitionToString(transit)
                        + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
            }
        } else {
            int animAttr = 0;
            switch (transit) {
+3 −8
Original line number Diff line number Diff line
@@ -2340,11 +2340,6 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
        return transit == TRANSIT_TASK_CHANGE_WINDOWING_MODE;
    }

    private int getDefaultChangeTransitionDuration() {
        return (int) (AppTransition.DEFAULT_APP_TRANSITION_DURATION
                        * mWmService.getTransitionAnimationScaleLocked());
    }

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

@@ -2378,17 +2373,17 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
                adapter = adapters.mAdapter;
                thumbnailAdapter = adapters.mThumbnailAdapter;
            } else if (isChanging) {
                int duration = getDefaultChangeTransitionDuration();
                final float durationScale = mWmService.getTransitionAnimationScaleLocked();
                mTmpRect.offsetTo(mTmpPoint.x, mTmpPoint.y);
                adapter = new LocalAnimationAdapter(
                        new WindowChangeAnimationSpec(mTransitStartRect, mTmpRect,
                                getDisplayContent().getDisplayInfo(), duration,
                                getDisplayContent().getDisplayInfo(), durationScale,
                                true /* isAppAnimation */, false /* isThumbnail */),
                        mWmService.mSurfaceAnimationRunner);
                if (mThumbnail != null) {
                    thumbnailAdapter = new LocalAnimationAdapter(
                            new WindowChangeAnimationSpec(mTransitStartRect, mTmpRect,
                                    getDisplayContent().getDisplayInfo(), duration,
                                    getDisplayContent().getDisplayInfo(), durationScale,
                                    true /* isAppAnimation */, true /* isThumbnail */),
                            mWmService.mSurfaceAnimationRunner);
                }
+4 −2
Original line number Diff line number Diff line
@@ -53,13 +53,15 @@ public class WindowChangeAnimationSpec implements AnimationSpec {
    private Animation mAnimation;
    private final boolean mIsThumbnail;

    static final int ANIMATION_DURATION = AppTransition.DEFAULT_APP_TRANSITION_DURATION;

    public WindowChangeAnimationSpec(Rect startBounds, Rect endBounds, DisplayInfo displayInfo,
            long duration, boolean isAppAnimation, boolean isThumbnail) {
            float durationScale, boolean isAppAnimation, boolean isThumbnail) {
        mStartBounds = new Rect(startBounds);
        mEndBounds = new Rect(endBounds);
        mIsAppAnimation = isAppAnimation;
        mIsThumbnail = isThumbnail;
        createBoundsInterpolator(duration, displayInfo);
        createBoundsInterpolator((int) (ANIMATION_DURATION * durationScale), displayInfo);
    }

    @Override