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

Commit 7d0c2c0d authored by Hongwei Wang's avatar Hongwei Wang
Browse files

Save pinned stack bounds when there is no reparenting

This is regression caused by ag/9577803 that we no longer do task
reparenting when exit PiP, in which we signal the SysUI to save reentry
fraction and bounds for PiP window.

Fixed this by moving the save logic to ActivityStack#dismissPip when the
PiP window is about to be transformed to fullscreen.

Bug: 144368633
Test: atest PinnedStackTests#testEnterPictureInPictureSavePosition
Change-Id: I895c33d34b268aed3f8adbf4c905837775b8e30c
parent d1da43b5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -4708,6 +4708,12 @@ class ActivityStack extends TaskStack {
            throw new RuntimeException("There should be only one task in a pinned stack.");
        }

        // give pinned stack a chance to save current bounds, this should happen before reparent.
        final ActivityRecord top = topRunningNonOverlayTaskActivity();
        if (top != null && top.isVisible()) {
            top.savePinnedStackBounds();
        }

        mWindowManager.inSurfaceTransaction(() -> {
            final Task task = mChildren.get(0);
            setWindowingMode(WINDOWING_MODE_UNDEFINED);
+0 −7
Original line number Diff line number Diff line
@@ -674,13 +674,6 @@ class Task extends WindowContainer<ActivityRecord> implements ConfigurationConta
        boolean kept = true;
        try {
            final ActivityRecord r = topRunningActivityLocked();
            // give pinned stack a chance to save current bounds, this needs to be before the
            // actual reparent.
            if (inPinnedWindowingMode()
                    && !(toStackWindowingMode == WINDOWING_MODE_UNDEFINED)
                    && r.isVisible()) {
                r.savePinnedStackBounds();
            }
            final boolean wasFocused = r != null && root.isTopDisplayFocusedStack(sourceStack)
                    && (topRunningActivityLocked() == r);
            final boolean wasResumed = r != null && sourceStack.getResumedActivity() == r;