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

Commit cb437ade authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge changes I7d2ca2a2,I9f1fc593 into rvc-dev

* changes:
  Fix a couple issues with previous CL (keeping tasks hidden)
  Keep task hidden until task appeared
parents 9454e04c 8b5d23ab
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -254,7 +254,9 @@ public class TaskOrganizerTaskEmbedder extends TaskEmbedder {
            mTaskToken = taskInfo.token;
            mTaskLeash = mTaskToken.getLeash();
            mTransaction.reparent(mTaskLeash, mSurfaceControl)
                    .show(mSurfaceControl).apply();
                    .show(mTaskLeash)
                    .show(mSurfaceControl)
                    .apply();
            if (mPendingNotifyBoundsChanged) {
                // TODO: Either defer show or hide and synchronize show with the resize
                notifyBoundsChanged();
+2 −0
Original line number Diff line number Diff line
@@ -319,6 +319,7 @@ public class PipAnimationController {
                    getSurfaceTransactionHelper()
                            .crop(tx, leash, getDestinationBounds())
                            .round(tx, leash, shouldApplyCornerRadius());
                    tx.show(leash);
                    tx.apply();
                }
            };
@@ -359,6 +360,7 @@ public class PipAnimationController {
                    getSurfaceTransactionHelper()
                            .alpha(tx, leash, 1f)
                            .round(tx, leash, shouldApplyCornerRadius());
                    tx.show(leash);
                    tx.apply();
                }

+4 −1
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ public class PipAnimationControllerTest extends SysuiTestCase {

    private PipAnimationController mPipAnimationController;

    @Mock
    private SurfaceControl mLeash;

    @Mock
@@ -61,6 +60,10 @@ public class PipAnimationControllerTest extends SysuiTestCase {
    public void setUp() throws Exception {
        mPipAnimationController = new PipAnimationController(
                mContext, new PipSurfaceTransactionHelper(mContext));
        mLeash = new SurfaceControl.Builder()
                .setContainerLayer()
                .setName("FakeLeash")
                .build();
        MockitoAnnotations.initMocks(this);
    }

+6 −0
Original line number Diff line number Diff line
@@ -5212,6 +5212,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        updateReportedVisibilityLocked();
    }

    void onStartingWindowDrawn() {
        if (task != null) {
            task.setHasBeenVisible(true);
        }
    }

    /** Called when the windows associated app window container are drawn. */
    void onWindowsDrawn(boolean drawn, long timestampNs) {
        mDrawn = drawn;
+6 −7
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import static android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_SUSTAINED_PERFORMANCE_MODE;
import static android.view.WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG;
import static android.view.WindowManager.TRANSIT_CRASHING_ACTIVITY_CLOSE;
import static android.view.WindowManager.TRANSIT_NONE;
import static android.view.WindowManager.TRANSIT_SHOW_SINGLE_TASK_DISPLAY;

import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT;
@@ -2116,16 +2117,19 @@ class RootWindowContainer extends WindowContainer<DisplayContent>

        try {
            final Task task = r.getTask();

            final ActivityStack pinnedStack = taskDisplayArea.getRootPinnedTask();

            // This will change the pinned stack's windowing mode to its original mode, ensuring
            // we only have one stack that is in pinned mode.
            if (pinnedStack != null) {
                pinnedStack.dismissPip();
            }

            final boolean singleActivity = task.getChildCount() == 1;
            // Set a transition to ensure that we don't immediately try and update the visibility
            // of the activity entering PIP
            r.getDisplayContent().prepareAppTransition(TRANSIT_NONE, false);

            final boolean singleActivity = task.getChildCount() == 1;
            final ActivityStack stack;
            if (singleActivity) {
                stack = r.getRootTask();
@@ -2148,11 +2152,6 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
            mService.continueWindowLayout();
        }

        // TODO: revisit the following statement after the animation is moved from WM to SysUI.
        // Update the visibility of all activities after the they have been reparented to the new
        // stack.  This MUST run after the animation above is scheduled to ensure that the windows
        // drawn signal is scheduled after the bounds animation start call on the bounds animator
        // thread.
        ensureActivitiesVisible(null, 0, false /* preserveWindows */);
        resumeFocusedStacksTopActivities();

Loading