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

Commit e3d64c16 authored by Wale Ogunwale's avatar Wale Ogunwale Committed by Android (Google) Code Review
Browse files

Merge "Move home stack behind top stack when split-screen is dismissed"

parents 0cbfdf82 eb76b762
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -399,6 +399,16 @@ class ActivityDisplay extends ConfigurationContainer<ActivityStack> {
                otherStack.setWindowingMode(WINDOWING_MODE_FULLSCREEN);
            }
        } finally {
            if (mHomeStack != null && !isTopStack(mHomeStack)) {
                // Whenever split-screen is dismissed we want the home stack directly behind the
                // currently top stack so it shows up when the top stack is finished.
                final ActivityStack topStack = getTopStack();
                // TODO: Would be better to use ActivityDisplay.positionChildAt() for this, however
                // ActivityDisplay doesn't have a direct controller to WM side yet. We can switch
                // once we have that.
                mHomeStack.moveToFront("onSplitScreenModeDismissed");
                topStack.moveToFront("onSplitScreenModeDismissed");
            }
            mSupervisor.mWindowManager.continueSurfaceLayout();
        }
    }
+6 −6
Original line number Diff line number Diff line
@@ -10522,12 +10522,12 @@ public class ActivityManagerService extends IActivityManager.Stub
                            + " non-standard task " + taskId + " to windowing mode="
                            + windowingMode);
                }
                final ActivityDisplay display = task.getStack().getDisplay();
                final ActivityStack stack = display.getOrCreateStack(windowingMode,
                        task.getStack().getActivityType(), toTop);
                // TODO: Use ActivityStack.setWindowingMode instead of re-parenting.
                task.reparent(stack, toTop, REPARENT_KEEP_STACK_AT_FRONT, ANIMATE, !DEFER_RESUME,
                        "moveTaskToStack");
                final ActivityStack stack = task.getStack();
                if (toTop) {
                    stack.moveToFront("setTaskWindowingMode", task);
                }
                stack.setWindowingMode(windowingMode);
            } finally {
                Binder.restoreCallingIdentity(ident);
            }
+7 −2
Original line number Diff line number Diff line
@@ -647,8 +647,13 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
            return;
        }

        if (task.getStack().deferScheduleMultiWindowModeChanged()) {
            // Don't do anything if we are currently deferring multi-window mode change.
            return;
        }

        // An activity is considered to be in multi-window mode if its task isn't fullscreen.
        final boolean inMultiWindowMode = task.inMultiWindowMode();
        final boolean inMultiWindowMode = inMultiWindowMode();
        if (inMultiWindowMode != mLastReportedMultiWindowMode) {
            mLastReportedMultiWindowMode = inMultiWindowMode;
            scheduleMultiWindowModeChanged(getConfiguration());
@@ -675,7 +680,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
            // Picture-in-picture mode changes also trigger a multi-window mode change as well, so
            // update that here in order
            mLastReportedPictureInPictureMode = inPictureInPictureMode;
            mLastReportedMultiWindowMode = inPictureInPictureMode;
            mLastReportedMultiWindowMode = inMultiWindowMode();
            final Configuration newConfig = task.computeNewOverrideConfigurationForBounds(
                    targetStackBounds, null);
            schedulePictureInPictureModeChanged(newConfig);
+1 −1
Original line number Diff line number Diff line
@@ -494,7 +494,7 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai

        // Need to make sure windowing mode is supported.
        int windowingMode = display.resolveWindowingMode(
                null /* ActivityRecord */, mTmpOptions, topTask, getActivityType());;
                null /* ActivityRecord */, mTmpOptions, topTask, getActivityType());
        if (splitScreenStack == this && windowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY) {
            // Resolution to split-screen secondary for the primary split-screen stack means we want
            // to go fullscreen.
+4 −0
Original line number Diff line number Diff line
@@ -4308,6 +4308,10 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
            final ActivityRecord r = task.mActivities.get(i);
            if (r.app != null && r.app.thread != null) {
                mPipModeChangedActivities.add(r);
                // If we are scheduling pip change, then remove this activity from multi-window
                // change list as the processing of pip change will make sure multi-window changed
                // message is processed in the right order relative to pip changed.
                mMultiWindowModeChangedActivities.remove(r);
            }
        }
        mPipModeChangedTargetStackBounds = targetStackBounds;
Loading