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

Commit ef6d79a5 authored by Evan Rosky's avatar Evan Rosky Committed by Automerger Merge Worker
Browse files

Merge "Use actual resizability for split-screen operations" into rvc-dev am: 058a713a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11854827

Change-Id: I4ac3a3db752aa2381e0c16401c85b4b00d6501a1
parents a7dad0b5 058a713a
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package android.app;

import static android.content.pm.ActivityInfo.RESIZE_MODE_UNRESIZEABLE;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.TestApi;
@@ -170,6 +168,14 @@ public class TaskInfo {
    @Nullable
    public ActivityInfo topActivityInfo;

    /**
     * Whether this task is resizable. Unlike {@link #resizeMode} (which is what the top activity
     * supports), this is what the system actually uses for resizability based on other policy and
     * developer options.
     * @hide
     */
    public boolean isResizeable;

    TaskInfo() {
        // Do nothing
    }
@@ -192,11 +198,6 @@ public class TaskInfo {
        }
    }

    /** @hide */
    public boolean isResizable() {
        return resizeMode != RESIZE_MODE_UNRESIZEABLE;
    }

    /** @hide */
    @NonNull
    @TestApi
@@ -245,6 +246,7 @@ public class TaskInfo {
        topActivityInfo = source.readInt() != 0
                ? ActivityInfo.CREATOR.createFromParcel(source)
                : null;
        isResizeable = source.readBoolean();
    }

    /**
@@ -294,6 +296,7 @@ public class TaskInfo {
            dest.writeInt(1);
            topActivityInfo.writeToParcel(dest, flags);
        }
        dest.writeBoolean(isResizeable);
    }

    @Override
@@ -308,6 +311,7 @@ public class TaskInfo {
                + " lastActiveTime=" + lastActiveTime
                + " supportsSplitScreenMultiWindow=" + supportsSplitScreenMultiWindow
                + " resizeMode=" + resizeMode
                + " isResizeable=" + isResizeable
                + " token=" + token
                + " topActivityType=" + topActivityType
                + " pictureInPictureParams=" + pictureInPictureParams
+1 −1
Original line number Diff line number Diff line
@@ -523,7 +523,7 @@ public class Divider extends SystemUI implements DividerView.DividerCallbacks,
    }

    void ensureMinimizedSplit() {
        setHomeMinimized(true /* minimized */, mSplits.mSecondary.isResizable());
        setHomeMinimized(true /* minimized */, mSplits.mSecondary.isResizeable);
        if (!isDividerVisible()) {
            // Wasn't in split-mode yet, so enter now.
            if (DEBUG) {
+2 −2
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ public class WindowManagerProxy {
            final ActivityManager.RunningTaskInfo ti = rootTasks.get(i);
            out.add(ti.token);
            if (ti.topActivityType == ACTIVITY_TYPE_HOME) {
                resizable = ti.isResizable();
                resizable = ti.isResizeable;
            }
        }
        return resizable;
@@ -179,7 +179,7 @@ public class WindowManagerProxy {
        for (int i = rootTasks.size() - 1; i >= 0; --i) {
            final ActivityManager.RunningTaskInfo rootTask = rootTasks.get(i);
            // Only move resizeable task to split secondary. WM will just ignore this anyways...
            if (!rootTask.isResizable()) continue;
            if (!rootTask.isResizeable) continue;
            // Only move fullscreen tasks to split secondary.
            if (rootTask.configuration.windowConfiguration.getWindowingMode()
                    != WINDOWING_MODE_FULLSCREEN) {
+3 −1
Original line number Diff line number Diff line
@@ -2208,7 +2208,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    }

    boolean isResizeable() {
        return ActivityInfo.isResizeableMode(info.resizeMode) || info.supportsPictureInPicture();
        return mAtmService.mForceResizableActivities
                || ActivityInfo.isResizeableMode(info.resizeMode)
                || info.supportsPictureInPicture();
    }

    /** @return whether this activity is non-resizeable or forced to be resizeable */
+4 −2
Original line number Diff line number Diff line
@@ -939,14 +939,15 @@ class Task extends WindowContainer<WindowContainer> {

    /** Sets the original intent, _without_ updating the calling uid or package. */
    private void setIntent(Intent _intent, ActivityInfo info) {
        final boolean isLeaf = isLeafTask();
        if (intent == null) {
            mNeverRelinquishIdentity =
                    (info.flags & FLAG_RELINQUISH_TASK_IDENTITY) == 0;
        } else if (mNeverRelinquishIdentity) {
        } else if (mNeverRelinquishIdentity && isLeaf) {
            return;
        }

        affinity = isLeafTask() ? info.taskAffinity : null;
        affinity = isLeaf ? info.taskAffinity : null;
        if (intent == null) {
            // If this task already has an intent associated with it, don't set the root
            // affinity -- we don't want it changing after initially set, but the initially
@@ -3587,6 +3588,7 @@ class Task extends WindowContainer<WindowContainer> {
        final Task top = getTopMostTask();
        info.resizeMode = top != null ? top.mResizeMode : mResizeMode;
        info.topActivityType = top.getActivityType();
        info.isResizeable = isResizeable();

        ActivityRecord rootActivity = top.getRootActivity();
        if (rootActivity == null || rootActivity.pictureInPictureArgs.empty()) {
Loading