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

Commit b04b4657 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Remove unused code of legacy transition

Clean up some leftovers of deleted legacy transition.

Bug: 365884835
Flag: EXEMPT remove unused code
Test: CtsWindowManagerDeviceWindow
Change-Id: I62311588169dc3554f2eda890c9f4ceb99544ab3
parent 230ffb85
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -525,10 +525,6 @@ abstract class AbsAppSnapshotController<TYPE extends WindowContainer,
        mCache.onAppDied(activity);
    }

    boolean isAnimatingByRecents(@NonNull Task task) {
        return task.isAnimatingByRecents();
    }

    void dump(PrintWriter pw, String prefix) {
        pw.println(prefix + "mHighResSnapshotScale=" + mHighResSnapshotScale);
        pw.println(prefix + "mSnapshotEnabled=" + mSnapshotEnabled);
+2 −52
Original line number Diff line number Diff line
@@ -227,7 +227,6 @@ import static com.android.server.wm.WindowContainer.AnimationFlags.PARENTS;
import static com.android.server.wm.WindowContainer.AnimationFlags.TRANSITION;
import static com.android.server.wm.WindowContainerChildProto.ACTIVITY;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_CONFIGURATION;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT_REPEATS;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STARTING_WINDOW_VERBOSE;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_NORMAL;
@@ -307,7 +306,6 @@ import android.os.UserHandle;
import android.service.contentcapture.ActivityEvent;
import android.service.dreams.DreamActivity;
import android.service.voice.IVoiceInteractionSession;
import android.util.ArraySet;
import android.util.EventLog;
import android.util.Log;
import android.util.MergedConfiguration;
@@ -363,8 +361,6 @@ import com.android.window.flags.Flags;

import dalvik.annotation.optimization.NeverCompile;

import com.google.android.collect.Sets;

import org.xmlpull.v1.XmlPullParserException;

import java.io.File;
@@ -1716,11 +1712,6 @@ final class ActivityRecord extends WindowToken {
        return mAppCompatController.getLetterboxOverrides().hasWallpaperBackgroundForLetterbox();
    }

    void updateLetterboxSurfaceIfNeeded(WindowState winHint, Transaction t) {
        mAppCompatController.getLetterboxPolicy()
                .updateLetterboxSurfaceIfNeeded(winHint, t, getPendingTransaction());
    }

    void updateLetterboxSurfaceIfNeeded(WindowState winHint) {
        mAppCompatController.getLetterboxPolicy().updateLetterboxSurfaceIfNeeded(winHint);
    }
@@ -3631,24 +3622,11 @@ final class ActivityRecord extends WindowToken {
                    Slog.v(TAG_TRANSITION, "Prepare close transition: finishing " + this);
                }

                // When finishing the activity preemptively take the snapshot before the app window
                // is marked as hidden and any configuration changes take place
                // Note that RecentsAnimation will handle task snapshot while switching apps with
                // the best capture timing (e.g. IME window capture),
                // No need additional task capture while task is controlled by RecentsAnimation.
                if (!mTransitionController.isShellTransitionsEnabled()
                        && !task.isAnimatingByRecents()) {
                    final ArraySet<Task> tasks = Sets.newArraySet(task);
                    mAtmService.mWindowManager.mTaskSnapshotController.snapshotTasks(tasks);
                    mAtmService.mWindowManager.mTaskSnapshotController
                            .addSkipClosingAppSnapshotTasks(tasks);
                }

                // Tell window manager to prepare for this one to be removed.
                setVisibility(false);
                // Propagate the last IME visibility in the same task, so the IME can show
                // automatically if the next activity has a focused editable view.
                if (mLastImeShown && mTransitionController.isShellTransitionsEnabled()) {
                if (mLastImeShown) {
                    final ActivityRecord nextRunning = task.topRunningActivity();
                    if (nextRunning != null) {
                        nextRunning.mLastImeShown = true;
@@ -4471,16 +4449,6 @@ final class ActivityRecord extends WindowToken {
        updateLetterboxSurfaceIfNeeded(child);
    }

    void setAppLayoutChanges(int changes, String reason) {
        if (!mChildren.isEmpty()) {
            final DisplayContent dc = getDisplayContent();
            dc.pendingLayoutChanges |= changes;
            if (DEBUG_LAYOUT_REPEATS) {
                mWmService.mWindowPlacerLocked.debugLayoutRepeats(reason, dc.pendingLayoutChanges);
            }
        }
    }

    /**
     * Returns {@code true} if the requested orientation of this activity is the same as the
     * resolved orientation of the from activity.
@@ -5371,9 +5339,7 @@ final class ActivityRecord extends WindowToken {
            Slog.w(TAG_WM, "Attempted to set visibility of non-existing app token: " + token);
            return;
        }
        if (visible == mVisibleRequested && visible == mVisible && visible == isClientVisible()
                && mTransitionController.isShellTransitionsEnabled()) {
            // For shell transition, it is no-op if there is no state change.
        if (visible == mVisibleRequested && visible == mVisible && visible == isClientVisible()) {
            return;
        }
        if (visible) {
@@ -8210,22 +8176,6 @@ final class ActivityRecord extends WindowToken {
                requestsTmpConfig, gender, mAtmService.mGrammaticalManagerInternal, getUid());
    }

    @VisibleForTesting
    @Override
    Rect getAnimationBounds(int appRootTaskClipMode) {
        // Use TaskFragment-bounds if available so that activity-level letterbox (maxAspectRatio) is
        // included in the animation.
        final TaskFragment taskFragment = getTaskFragment();
        return taskFragment != null ? taskFragment.getBounds() : getBounds();
    }

    @Override
    void getAnimationPosition(Point outPosition) {
        // Always animate from zero because if the activity doesn't fill the task, the letterbox
        // will fill the remaining area that should be included in the animation.
        outPosition.set(0, 0);
    }

    @Override
    public void onConfigurationChanged(Configuration newParentConfig) {
        // We want to collect the ActivityRecord if the windowing mode is changed, so that it will
+0 −13
Original line number Diff line number Diff line
@@ -178,19 +178,6 @@ class AppCompatLetterboxPolicy {
        return mLetterboxPolicyState.isFullyTransparentBarAllowed(rect);
    }

    /**
     * Updates the letterbox surfaces in case this is needed.
     *
     * @param winHint   The WindowState for the letterboxed Activity.
     * @param t         The current Transaction.
     * @param inputT    The pending transaction used for the input surface.
     */
    void updateLetterboxSurfaceIfNeeded(@NonNull WindowState winHint,
            @NonNull SurfaceControl.Transaction t,
            @NonNull SurfaceControl.Transaction inputT) {
        mLetterboxPolicyState.updateLetterboxSurfaceIfNeeded(winHint, t, inputT);
    }

    void updateLetterboxSurfaceIfNeeded(@NonNull WindowState winHint) {
        mLetterboxPolicyState.updateLetterboxSurfaceIfNeeded(winHint,
                mActivityRecord.getSyncTransaction(), mActivityRecord.getPendingTransaction());
+0 −7
Original line number Diff line number Diff line
@@ -830,13 +830,6 @@ public class DisplayArea<T extends WindowContainer> extends WindowContainer<T> {
                }
            }

            // If SystemUI is dragging for recents, we want to reset the dim state so any dim layer
            // on the display level fades out.
            if (!mTransitionController.isShellTransitionsEnabled()
                    && forAllTasks(task -> !task.canAffectSystemUiFlags())) {
                mDimmer.resetDimStates();
            }

            if (mDimmer.hasDimState()) {
                if (mDimmer.updateDims(getSyncTransaction())) {
                    scheduleAnimation();
+0 −1
Original line number Diff line number Diff line
@@ -184,7 +184,6 @@ class RootWindowContainer extends WindowContainer<DisplayContent>

    private static final long SLEEP_TRANSITION_WAIT_MILLIS = 1000L;

    private Object mLastWindowFreezeSource = null;
    // Per-display WindowManager overrides that are passed on.
    private final SparseArray<DisplayBrightnessOverrideRequest> mDisplayBrightnessOverrides =
            new SparseArray<>();
Loading