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

Commit 8ae8c3e9 authored by Evan Rosky's avatar Evan Rosky Committed by Automerger Merge Worker
Browse files

Merge "Enable keyguard remote animation when WMShell is used." into sc-v2-dev am: 58fd4834

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15027112

Change-Id: Ib6bc7cf0eaa142baf5306829c2fb359d22604f93
parents 701607c7 58fd4834
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -399,6 +399,11 @@ public interface WindowManager extends ViewManager {
     * @hide
     */
    int TRANSIT_PIP = 10;
    /**
     * The screen is turning on.
     * @hide
     */
    int TRANSIT_WAKE = 11;
    /**
     * The first slot for custom transition types. Callers (like Shell) can make use of custom
     * transition types for dealing with special cases. These types are effectively ignored by
@@ -408,7 +413,7 @@ public interface WindowManager extends ViewManager {
     * implementation.
     * @hide
     */
    int TRANSIT_FIRST_CUSTOM = 11;
    int TRANSIT_FIRST_CUSTOM = 12;

    /**
     * @hide
@@ -425,6 +430,7 @@ public interface WindowManager extends ViewManager {
            TRANSIT_KEYGUARD_OCCLUDE,
            TRANSIT_KEYGUARD_UNOCCLUDE,
            TRANSIT_PIP,
            TRANSIT_WAKE,
            TRANSIT_FIRST_CUSTOM
    })
    @Retention(RetentionPolicy.SOURCE)
+2 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.window;

import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
import static android.view.WindowManager.TransitionType;

import android.annotation.IntDef;
import android.annotation.NonNull;
@@ -52,7 +53,7 @@ public final class TransitionFilter implements Parcelable {
     * When non-null: this is a list of transition types that this filter applies to. This filter
     * will fail for transitions that aren't one of these types.
     */
    @Nullable public int[] mTypeSet = null;
    @Nullable public @TransitionType int[] mTypeSet = null;

    /**
     * A list of required changes. To pass, a transition must meet all requirements.
+6 −6
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@ import static android.view.WindowManager.TRANSIT_NONE;
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.view.WindowManager.TransitionFlags;
import static android.view.WindowManager.TransitionType;
import static android.view.WindowManager.transitTypeToString;

import android.annotation.IntDef;
@@ -42,7 +44,6 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.view.Surface;
import android.view.SurfaceControl;
import android.view.WindowManager;

import java.util.ArrayList;
import java.util.List;
@@ -106,8 +107,8 @@ public final class TransitionInfo implements Parcelable {
    })
    public @interface ChangeFlags {}

    private final @WindowManager.TransitionOldType int mType;
    private final @WindowManager.TransitionFlags int mFlags;
    private final @TransitionType int mType;
    private final @TransitionFlags int mFlags;
    private final ArrayList<Change> mChanges = new ArrayList<>();

    private SurfaceControl mRootLeash;
@@ -116,8 +117,7 @@ public final class TransitionInfo implements Parcelable {
    private AnimationOptions mOptions;

    /** @hide */
    public TransitionInfo(@WindowManager.TransitionOldType int type,
            @WindowManager.TransitionFlags int flags) {
    public TransitionInfo(@TransitionType int type, @TransitionFlags int flags) {
        mType = type;
        mFlags = flags;
    }
@@ -173,7 +173,7 @@ public final class TransitionInfo implements Parcelable {
        mOptions = options;
    }

    public int getType() {
    public @TransitionType int getType() {
        return mType;
    }

+10 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ import android.util.ArrayMap;
import android.view.Choreographer;
import android.view.SurfaceControl;
import android.view.SurfaceSession;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.Transformation;
@@ -132,6 +133,15 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
            @NonNull Transitions.TransitionFinishCallback finishCallback) {
        ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS,
                "start default transition animation, info = %s", info);

        // Fallback for screen wake. This just immediately finishes since there is no
        // animation for screen-wake.
        if (info.getType() == WindowManager.TRANSIT_WAKE) {
            startTransaction.apply();
            finishCallback.onTransitionFinished(null /* wct */, null /* wctCB */);
            return true;
        }

        if (mAnimations.containsKey(transition)) {
            throw new IllegalStateException("Got a duplicate startAnimation call for "
                    + transition);
+1 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@ public class RemoteTransitionHandler implements Transitions.TransitionHandler {
                ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TRANSITIONS, " Checking filter %s",
                        mFilters.get(i));
                if (mFilters.get(i).first.matches(info)) {
                    Slog.d(TAG, "Found filter" + mFilters.get(i));
                    pendingRemote = mFilters.get(i).second;
                    // Add to requested list so that it can be found for merge requests.
                    mRequestedRemotes.put(transition, pendingRemote);
Loading