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

Commit 45ad7f77 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Force embedded activity resizable" into sc-v2-dev am: 6727ad6c

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

Change-Id: I1d7f28e620594a4480ac61d94016ff49db501286
parents 28c84452 6727ad6c
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -2607,6 +2607,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        return parent != null ? parent.getOrganizedTaskFragment() : null;
    }

    boolean isEmbedded() {
        final TaskFragment parent = getTaskFragment();
        return parent != null && parent.isEmbedded();
    }

    @Override
    @Nullable
    TaskDisplayArea getDisplayArea() {
@@ -2698,7 +2703,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    boolean isResizeable() {
        return mAtmService.mForceResizableActivities
                || ActivityInfo.isResizeableMode(info.resizeMode)
                || info.supportsPictureInPicture();
                || info.supportsPictureInPicture()
                // If the activity can be embedded, it should inherit the bounds of task fragment.
                || isEmbedded();
    }

    /** @return whether this activity is non-resizeable but is forced to be resizable. */
+3 −1
Original line number Diff line number Diff line
@@ -2724,9 +2724,11 @@ public class ActivityRecordTests extends WindowTestsBase {
                mAtm, null /* fragmentToken */, false /* createdByOrganizer */);
        fragmentSetup.accept(taskFragment2, new Rect(width / 2, 0, width, height));
        task.addChild(taskFragment2, POSITION_TOP);
        final ActivityRecord activity2 = new ActivityBuilder(mAtm).build();
        final ActivityRecord activity2 = new ActivityBuilder(mAtm)
                .setResizeMode(ActivityInfo.RESIZE_MODE_UNRESIZEABLE).build();
        activity2.mVisibleRequested = true;
        taskFragment2.addChild(activity2);
        assertTrue(activity2.isResizeable());
        activity1.reparent(taskFragment1, POSITION_TOP);

        assertEquals(task, activity1.mStartingData.mAssociatedTask);