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

Commit 69b5f6a9 authored by Evan Rosky's avatar Evan Rosky Committed by Automerger Merge Worker
Browse files

Merge "Animate divider bar and roottasks along with keyguard-exit" into...

Merge "Animate divider bar and roottasks along with keyguard-exit" into rvc-dev am: 32d37c9d am: 1eb02a8a am: ec8dd0c3 am: 14290d86

Change-Id: Id39111fc1f3844372882e4a74e2212af627e8c87
parents 9151b784 14290d86
Loading
Loading
Loading
Loading
+2 −7
Original line number Original line Diff line number Diff line
@@ -76,7 +76,6 @@ import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerInternal.AppTransitionListener;
import static com.android.server.wm.WindowManagerInternal.AppTransitionListener;
import static com.android.server.wm.WindowStateAnimator.STACK_CLIP_AFTER_ANIM;
import static com.android.server.wm.WindowStateAnimator.STACK_CLIP_AFTER_ANIM;
import static com.android.server.wm.WindowStateAnimator.STACK_CLIP_BEFORE_ANIM;
import static com.android.server.wm.WindowStateAnimator.STACK_CLIP_NONE;
import static com.android.server.wm.WindowStateAnimator.STACK_CLIP_NONE;


import android.annotation.DrawableRes;
import android.annotation.DrawableRes;
@@ -1808,15 +1807,11 @@ public class AppTransition implements Dump {
    }
    }


    int getAppStackClipMode() {
    int getAppStackClipMode() {
        // When dismiss keyguard animation occurs, clip before the animation to prevent docked
        // app from showing beyond the divider
        if (mNextAppTransition == TRANSIT_KEYGUARD_GOING_AWAY
                || mNextAppTransition == TRANSIT_KEYGUARD_GOING_AWAY_ON_WALLPAPER) {
            return STACK_CLIP_BEFORE_ANIM;
        }
        return mNextAppTransition == TRANSIT_ACTIVITY_RELAUNCH
        return mNextAppTransition == TRANSIT_ACTIVITY_RELAUNCH
                || mNextAppTransition == TRANSIT_DOCK_TASK_FROM_RECENTS
                || mNextAppTransition == TRANSIT_DOCK_TASK_FROM_RECENTS
                || mNextAppTransitionType == NEXT_TRANSIT_TYPE_CLIP_REVEAL
                || mNextAppTransitionType == NEXT_TRANSIT_TYPE_CLIP_REVEAL
                || mNextAppTransition == TRANSIT_KEYGUARD_GOING_AWAY
                || mNextAppTransition == TRANSIT_KEYGUARD_GOING_AWAY_ON_WALLPAPER
                ? STACK_CLIP_NONE
                ? STACK_CLIP_NONE
                : STACK_CLIP_AFTER_ANIM;
                : STACK_CLIP_AFTER_ANIM;
    }
    }
+4 −1
Original line number Original line Diff line number Diff line
@@ -197,7 +197,6 @@ import android.view.ViewRootImpl;
import android.view.WindowInsets;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.view.WindowManager;
import android.view.WindowManagerPolicyConstants.PointerEventListener;
import android.view.WindowManagerPolicyConstants.PointerEventListener;
import android.window.ITaskOrganizer;


import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.MetricsLogger;
@@ -3554,6 +3553,10 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
                        onWallpaper, goingToShade, subtle));
                        onWallpaper, goingToShade, subtle));
            }
            }
        }, true /* traverseTopToBottom */);
        }, true /* traverseTopToBottom */);
        for (int i = mShellRoots.size() - 1; i >= 0; --i) {
            mShellRoots.valueAt(i).startAnimation(policy.createHiddenByKeyguardExit(
                    onWallpaper, goingToShade, subtle));
        }
    }
    }


    /** @return {@code true} if there is window to wait before enabling the screen. */
    /** @return {@code true} if there is window to wait before enabling the screen. */
+32 −0
Original line number Original line Diff line number Diff line
@@ -16,12 +16,20 @@


package com.android.server.wm;
package com.android.server.wm;


import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER;

import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_WINDOW_ANIMATION;
import static com.android.server.wm.WindowManagerService.MAX_ANIMATION_DURATION;

import android.annotation.NonNull;
import android.annotation.NonNull;
import android.graphics.Point;
import android.os.IBinder;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.RemoteException;
import android.util.Slog;
import android.util.Slog;
import android.view.DisplayInfo;
import android.view.IWindow;
import android.view.IWindow;
import android.view.SurfaceControl;
import android.view.SurfaceControl;
import android.view.animation.Animation;


/**
/**
 * Represents a piece of the hierarchy under which a client Shell can manage sub-windows.
 * Represents a piece of the hierarchy under which a client Shell can manage sub-windows.
@@ -70,5 +78,29 @@ public class ShellRoot {
    IWindow getClient() {
    IWindow getClient() {
        return mClient;
        return mClient;
    }
    }

    void startAnimation(Animation anim) {
        // Only do this for the divider
        if (mToken.windowType != TYPE_DOCK_DIVIDER) {
            return;
        }

        DisplayInfo displayInfo = mToken.getFixedRotationTransformDisplayInfo();
        if (displayInfo == null) {
            displayInfo = mDisplayContent.getDisplayInfo();
        }

        // Mostly copied from WindowState to enable keyguard transition animation
        anim.initialize(displayInfo.logicalWidth, displayInfo.logicalHeight,
                displayInfo.appWidth, displayInfo.appHeight);
        anim.restrictDuration(MAX_ANIMATION_DURATION);
        anim.scaleCurrentDuration(mDisplayContent.mWmService.getWindowAnimationScaleLocked());
        final AnimationAdapter adapter = new LocalAnimationAdapter(
                new WindowAnimationSpec(anim, new Point(0, 0), false /* canSkipFirstFrame */,
                        0 /* windowCornerRadius */),
                mDisplayContent.mWmService.mSurfaceAnimationRunner);
        mToken.startAnimation(mToken.getPendingTransaction(), adapter, false /* hidden */,
                ANIMATION_TYPE_WINDOW_ANIMATION, null /* animationFinishedCallback */);
    }
}
}
+5 −0
Original line number Original line Diff line number Diff line
@@ -1612,6 +1612,11 @@ final class TaskDisplayArea extends DisplayArea<ActivityStack> {
        }
        }
    }
    }


    @Override
    boolean canCreateRemoteAnimationTarget() {
        return true;
    }

    /**
    /**
     * Callback for when the order of the stacks in the display changes.
     * Callback for when the order of the stacks in the display changes.
     */
     */
+1 −0
Original line number Original line Diff line number Diff line
@@ -380,6 +380,7 @@ class TaskSnapshotSurface implements StartingSurface {
            frame = null;
            frame = null;
            mTmpDstFrame.set(mFrame);
            mTmpDstFrame.set(mFrame);
        }
        }
        mTmpDstFrame.offsetTo(0, 0);


        // Scale the mismatch dimensions to fill the task bounds
        // Scale the mismatch dimensions to fill the task bounds
        mTmpSnapshotSize.set(0, 0, buffer.getWidth(), buffer.getHeight());
        mTmpSnapshotSize.set(0, 0, buffer.getWidth(), buffer.getHeight());
Loading