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

Commit b87855f6 authored by Wale Ogunwale's avatar Wale Ogunwale Committed by android-build-merger
Browse files

Merge "Reland: Clear transitions for app windows display change." into qt-dev...

Merge "Reland: Clear transitions for app windows display change." into qt-dev am: bf4eee21 am: c5116d9d
am: d14d6bc2

Change-Id: I0fbbc927ad82ed7159cd156288a569241cdf90ab
parents 4675762f d14d6bc2
Loading
Loading
Loading
Loading
+5 −11
Original line number Original line Diff line number Diff line
@@ -4750,18 +4750,12 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {


    private void applyUpdateVrModeLocked(ActivityRecord r) {
    private void applyUpdateVrModeLocked(ActivityRecord r) {
        // VR apps are expected to run in a main display. If an app is turning on VR for
        // VR apps are expected to run in a main display. If an app is turning on VR for
        // itself, but lives in a dynamic stack, then make sure that it is moved to the main
        // itself, but isn't on the main display, then move it there before enabling VR Mode.
        // fullscreen stack before enabling VR Mode.
        // TODO: The goal of this code is to keep the VR app on the main display. When the
        // stack implementation changes in the future, keep in mind that the use of the fullscreen
        // stack is a means to move the activity to the main display and a moveActivityToDisplay()
        // option would be a better choice here.
        if (r.requestedVrComponent != null && r.getDisplayId() != DEFAULT_DISPLAY) {
        if (r.requestedVrComponent != null && r.getDisplayId() != DEFAULT_DISPLAY) {
            Slog.i(TAG, "Moving " + r.shortComponentName + " from stack " + r.getStackId()
            Slog.i(TAG, "Moving " + r.shortComponentName + " from display " + r.getDisplayId()
                    + " to main stack for VR");
                    + " to main display for VR");
            final ActivityStack stack = mRootActivityContainer.getDefaultDisplay().getOrCreateStack(
            mRootActivityContainer.moveStackToDisplay(
                    WINDOWING_MODE_FULLSCREEN, r.getActivityType(), true /* toTop */);
                    r.getStackId(), DEFAULT_DISPLAY, true /* toTop */);
            moveTaskToStack(r.getTaskRecord().taskId, stack.mStackId, true /* toTop */);
        }
        }
        mH.post(() -> {
        mH.post(() -> {
            if (!mVrController.onVrModeChanged(r)) {
            if (!mVrController.onVrModeChanged(r)) {
+11 −11
Original line number Original line Diff line number Diff line
@@ -1322,7 +1322,15 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
        if (prevDc == null || prevDc == mDisplayContent) {
        if (prevDc == null || prevDc == mDisplayContent) {
            return;
            return;
        }
        }
        if (prevDc.mChangingApps.contains(this)) {

        if (prevDc.mOpeningApps.remove(this)) {
            // Transfer opening transition to new display.
            mDisplayContent.mOpeningApps.add(this);
            mDisplayContent.prepareAppTransition(prevDc.mAppTransition.getAppTransition(), true);
            mDisplayContent.executeAppTransition();
        }

        if (prevDc.mChangingApps.remove(this)) {
            // This gets called *after* the AppWindowToken has been reparented to the new display.
            // This gets called *after* the AppWindowToken has been reparented to the new display.
            // That reparenting resulted in this window changing modes (eg. FREEFORM -> FULLSCREEN),
            // That reparenting resulted in this window changing modes (eg. FREEFORM -> FULLSCREEN),
            // so this token is now "frozen" while waiting for the animation to start on prevDc
            // so this token is now "frozen" while waiting for the animation to start on prevDc
@@ -1331,6 +1339,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
            // so we need to cancel the change transition here.
            // so we need to cancel the change transition here.
            clearChangeLeash(getPendingTransaction(), true /* cancel */);
            clearChangeLeash(getPendingTransaction(), true /* cancel */);
        }
        }
        prevDc.mClosingApps.remove(this);

        if (prevDc.mFocusedApp == this) {
        if (prevDc.mFocusedApp == this) {
            prevDc.setFocusedApp(null);
            prevDc.setFocusedApp(null);
            final TaskStack stack = dc.getTopStack();
            final TaskStack stack = dc.getTopStack();
@@ -3216,16 +3226,6 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
                true /* topToBottom */);
                true /* topToBottom */);
    }
    }


    void removeFromPendingTransition() {
        if (isWaitingForTransitionStart() && mDisplayContent != null) {
            mDisplayContent.mOpeningApps.remove(this);
            if (mDisplayContent.mChangingApps.remove(this)) {
                clearChangeLeash(getPendingTransaction(), true /* cancel */);
            }
            mDisplayContent.mClosingApps.remove(this);
        }
    }

    private void updateColorTransform() {
    private void updateColorTransform() {
        if (mSurfaceControl != null && mLastAppSaturationInfo != null) {
        if (mSurfaceControl != null && mLastAppSaturationInfo != null) {
            getPendingTransaction().setColorTransform(mSurfaceControl,
            getPendingTransaction().setColorTransform(mSurfaceControl,
+0 −3
Original line number Original line Diff line number Diff line
@@ -2397,9 +2397,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
                    + " to its current displayId=" + mDisplayId);
                    + " to its current displayId=" + mDisplayId);
        }
        }


        // Clean up all pending transitions when stack reparent to another display.
        stack.forAllAppWindows(AppWindowToken::removeFromPendingTransition);

        prevDc.mTaskStackContainers.removeChild(stack);
        prevDc.mTaskStackContainers.removeChild(stack);
        mTaskStackContainers.addStackToDisplay(stack, onTop);
        mTaskStackContainers.addStackToDisplay(stack, onTop);
    }
    }