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

Commit 3129b853 authored by Garfield Tan's avatar Garfield Tan
Browse files

Only persist launch params on freeform display.

We don't want to launch to fullscreen only because it's been launched on
a fullscreen display before. We should still restore the bounds when it
was on a freeform display last time.

Bug: 135941344
Bug: 135780225
Test: Manual tests.
Change-Id: I9f57651a01513652cc4c38c2d91d4c46db5c5d5d
parent 3b77412d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -338,6 +338,11 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
        mDisplayWindowingMode = windowingMode;
    }

    /** @hide */
    @WindowingMode
    public int getDisplayWindowingMode() {
        return mDisplayWindowingMode;
    }

    public void setActivityType(@ActivityType int activityType) {
        if (mActivityType == activityType) {
+10 −3
Original line number Diff line number Diff line
@@ -1908,7 +1908,7 @@ class TaskRecord extends ConfigurationContainer {
    /**
     * Saves launching state if necessary so that we can launch the activity to its latest state.
     * It only saves state if this task has been shown to user and it's in fullscreen or freeform
     * mode.
     * mode on freeform displays.
     */
    void saveLaunchingStateIfNeeded() {
        if (!hasBeenVisible) {
@@ -1917,8 +1917,15 @@ class TaskRecord extends ConfigurationContainer {
        }

        final int windowingMode = getWindowingMode();
        if (windowingMode != WindowConfiguration.WINDOWING_MODE_FULLSCREEN
                && windowingMode != WindowConfiguration.WINDOWING_MODE_FREEFORM) {
        if (windowingMode != WINDOWING_MODE_FULLSCREEN
                && windowingMode != WINDOWING_MODE_FREEFORM) {
            return;
        }

        // Don't persist state if display isn't in freeform mode. Then the task will be launched
        // back to its last state in a freeform display when it's launched in a freeform display
        // next time.
        if (getWindowConfiguration().getDisplayWindowingMode() != WINDOWING_MODE_FREEFORM) {
            return;
        }