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

Commit a79d1acc authored by Tony Wickham's avatar Tony Wickham Committed by Android (Google) Code Review
Browse files

Merge "Remove unused TaskTransitionSpec" into main

parents 318f3edc ca3687ae
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -62,7 +62,6 @@ import android.view.InputChannel;
import android.view.InputDevice;
import android.view.IInputFilter;
import android.view.AppTransitionAnimationSpec;
import android.view.TaskTransitionSpec;
import android.view.WindowContentFrameStats;
import android.view.WindowManager;
import android.view.SurfaceControl;
@@ -961,19 +960,6 @@ interface IWindowManager
     */
    void setTaskSnapshotEnabled(boolean enabled);

    /**
     * Customized the task transition animation with a task transition spec.
     *
     * @param spec the spec that will be used to customize the task animations
     */
    void setTaskTransitionSpec(in TaskTransitionSpec spec);

    /**
     * Clears any task transition spec that has been previously set and
     * reverts to using the default task transition with no spec changes.
     */
    void clearTaskTransitionSpec();

    /**
     * Registers the frame rate per second count callback for one given task ID.
     * Each callback can only register for receiving FPS callback for one task id until unregister
+0 −20
Original line number Diff line number Diff line
/*
** Copyright 2021, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/

package android.view;

/** @hide */
parcelable TaskTransitionSpec;
+0 −64
Original line number Diff line number Diff line
/*
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.view;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Holds information about how to execute task transition animations.
 *
 * This class is intended to be used with IWindowManager.setTaskTransitionSpec methods when
 * we want more customization over the way default task transitions are executed.
 *
 * @hide
 */
public class TaskTransitionSpec implements Parcelable {
    /**
     * The background color to use during task animations (override the default background color)
     */
    public final int backgroundColor;

    public TaskTransitionSpec(int backgroundColor) {
        this.backgroundColor = backgroundColor;
    }

    public TaskTransitionSpec(Parcel in) {
        this.backgroundColor = in.readInt();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(backgroundColor);
    }

    public static final @android.annotation.NonNull Parcelable.Creator<TaskTransitionSpec>
            CREATOR = new Parcelable.Creator<TaskTransitionSpec>() {
                public TaskTransitionSpec createFromParcel(Parcel in) {
                    return new TaskTransitionSpec(in);
                }

                public TaskTransitionSpec[] newArray(int size) {
                    return new TaskTransitionSpec[size];
                }
            };
}
+0 −30
Original line number Diff line number Diff line
@@ -47,7 +47,6 @@ import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static android.provider.Settings.Secure.USER_SETUP_COMPLETE;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Display.INVALID_DISPLAY;
import static android.view.InsetsSource.FLAG_INSETS_ROUNDED_CORNER;
import static android.view.SurfaceControl.METADATA_TASK_ID;
import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
@@ -170,12 +169,10 @@ import android.util.DisplayMetrics;
import android.util.Slog;
import android.util.proto.ProtoOutputStream;
import android.view.DisplayInfo;
import android.view.InsetsSource;
import android.view.InsetsState;
import android.view.RemoteAnimationAdapter;
import android.view.Surface;
import android.view.SurfaceControl;
import android.view.TaskTransitionSpec;
import android.view.WindowManager;
import android.view.WindowManager.TransitionOldType;
import android.window.ITaskOrganizer;
@@ -2939,33 +2936,6 @@ class Task extends TaskFragment {
        return;
    }

    /**
     * Account for specified insets to crop the animation bounds by to avoid the animation
     * occurring over "out of bounds" regions
     *
     * For example this is used to make sure the tasks are cropped to be fully above the expanded
     * taskbar when animating.
     *
     * TEMPORARY FIELD (b/202383002)
     * TODO: Remove once we use surfaceflinger rounded corners on tasks rather than taskbar overlays
     *       or when shell transitions are fully enabled
     *
     * @param animationBounds The animation bounds to adjust to account for the custom spec insets.
     */
    void adjustAnimationBoundsForTransition(Rect animationBounds) {
        TaskTransitionSpec spec = mWmService.mTaskTransitionSpec;
        if (spec != null) {
            final InsetsState state =
                    getDisplayContent().getInsetsStateController().getRawInsetsState();
            for (int i = state.sourceSize() - 1; i >= 0; i--) {
                final InsetsSource source = state.sourceAt(i);
                if (source.hasFlags(FLAG_INSETS_ROUNDED_CORNER)) {
                    animationBounds.inset(source.calculateVisibleInsets(animationBounds));
                }
            }
        }
    }

    void setDragResizing(boolean dragResizing) {
        if (mDragResizing != dragResizing) {
            // No need to check if allowed if it's leaving dragResize
+0 −22
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@ import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_W
import static com.android.server.wm.AppTransition.MAX_APP_TRANSITION_DURATION;
import static com.android.server.wm.AppTransition.isActivityTransitOld;
import static com.android.server.wm.AppTransition.isTaskFragmentTransitOld;
import static com.android.server.wm.AppTransition.isTaskTransitOld;
import static com.android.server.wm.DisplayContent.IME_TARGET_LAYERING;
import static com.android.server.wm.IdentifierProto.HASH_CODE;
import static com.android.server.wm.IdentifierProto.TITLE;
@@ -72,7 +71,6 @@ import android.annotation.ColorInt;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.ActivityInfo.ScreenOrientation;
import android.content.res.Configuration;
@@ -103,7 +101,6 @@ import android.view.SurfaceControl;
import android.view.SurfaceControl.Builder;
import android.view.SurfaceControlViewHost;
import android.view.SurfaceSession;
import android.view.TaskTransitionSpec;
import android.view.WindowManager;
import android.view.WindowManager.TransitionOldType;
import android.view.animation.Animation;
@@ -3146,9 +3143,6 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
        // Separate position and size for use in animators.
        final Rect screenBounds = getAnimationBounds(appRootTaskClipMode);
        mTmpRect.set(screenBounds);
        if (this.asTask() != null && isTaskTransitOld(transit)) {
            this.asTask().adjustAnimationBoundsForTransition(mTmpRect);
        }
        getAnimationPosition(mTmpPoint);
        mTmpRect.offsetTo(0, 0);

@@ -3283,10 +3277,6 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<

            AnimationRunnerBuilder animationRunnerBuilder = new AnimationRunnerBuilder();

            if (isTaskTransitOld(transit) && getWindowingMode() == WINDOWING_MODE_FULLSCREEN) {
                animationRunnerBuilder.setTaskBackgroundColor(getTaskAnimationBackgroundColor());
            }

            // Check if the animation requests to show background color for Activity and embedded
            // TaskFragment.
            final ActivityRecord activityRecord = asActivityRecord();
@@ -3340,18 +3330,6 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
        }
    }

    private @ColorInt int getTaskAnimationBackgroundColor() {
        Context uiContext = mDisplayContent.getDisplayPolicy().getSystemUiContext();
        TaskTransitionSpec customSpec = mWmService.mTaskTransitionSpec;
        @ColorInt int defaultFallbackColor = uiContext.getColor(R.color.overview_background);

        if (customSpec != null && customSpec.backgroundColor != 0) {
            return customSpec.backgroundColor;
        }

        return defaultFallbackColor;
    }

    final SurfaceAnimationRunner getSurfaceAnimationRunner() {
        return mWmService.mSurfaceAnimationRunner;
    }
Loading